![]() |
As i have said earlier, i am new in this!
As i have said Earlier, i am new in this! I've tried to put together a simple application of codes I got from Jbob182 (I hope it is okay) but I can't make it work. Can anyone help me?
sheight = screen.height()--declare width and hieght of screen for later refernce swidth = screen.width() --load images imgstart = image.load("start.png") imgclose = image.load("stop.png") imgball = image.load("ball.png") cblack = color.new(0,0,0) -- declare black menu="menu" function gameplay() screen.fillrect(0,0,swidth,sheight,cblack) imgball:draw(ball_x,ball_y); ball_x=200 -- put the ball in the middle of the screen ball_y=240-imgball:height(); -- set the height of the ball to the bottom of the screen end function menu() menu="menu"; screen.fillrect(0,0,swidth,sheight,cblack) imgstart:draw(50,50,150,150); imgclose:draw(200,50,150,150); if touch_x >= 50 and touch_x <= (50 + 150) and touch_y >= 50 and touch_y <= (150 + 50) then menu = "gameplay"; -- the user is now in gameplay mode so the ball will be active elseif touch_x >=200 and touch_x <= (150 + 200) and touch_y >= 50 and touch_y <= (150 + 50) then menu="break"; end end function homebutton() if button.click() == 1 then if menu == "menu" then menu="break" elseif menu == "gameplay" then menu="menu" end end end while true do if menu == "gameplay" then function gameplay() if menu == "menu" then function menu() if menu == "break" then function avbryt() end end end end end end if control.read() == 1 then if touch.click() == 1 then function menu() end function homebutton() end end end screen.update end imgstart:close(); imgclose:close(); imgball:close(); |
this is your thread
http://www.anythingbutipod.com/forum...ad.php?t=63221 |
Thank you, but it is some bugs in it and i cant fix it
|
There are several things wrong, first off when calling a function ie: function menu () you simply type menu()
And i see no function avbryt() |
OKEY i see! Igain Thank you
|
Hey texme remember the idea of the imposible game? I think it's starting to work.
|
| All times are GMT -5. The time now is 02:01 PM. |