|
#1
|
|||
|
|||
|
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(); |
|
|
|||
|
|
|
#2
|
||||
|
||||
|
this is your thread
http://www.anythingbutipod.com/forum...ad.php?t=63221
__________________
Snake [Ru/Eng] | Who Wants to Be a Millionaire? [Ru/Eng] | Pacman [Ru] | BrainStorm [Ru/Eng] |
|
#3
|
|||
|
|||
|
Thank you, but it is some bugs in it and i cant fix it
|
|
#4
|
||||
|
||||
|
There are several things wrong, first off when calling a function ie: function menu () you simply type menu()
And i see no function avbryt()
__________________
Tools: Playlist Manager , Document to RSS , Notepad++ Instellisense Games/Apps: Asteroids, ZenFrame, Graphing Calculator, Pingus X-Fi2, Boxwars, SkiFree, Jezzball |
|
#5
|
|||
|
|||
|
OKEY i see! Igain Thank you
|
|
#6
|
|||
|
|||
|
Hey texme remember the idea of the imposible game? I think it's starting to work.
|
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
All times are GMT -5. The time now is 07:12 PM.











Linear Mode
