android
  #1  
Old 05-25-2011, 12:14 PM
TexMex TexMex is offline
Junior Member
 
Join Date: May 2011
Posts: 20
Help 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();
Reply With Quote

Advertisement [Remove Advertisement]

  #2  
Old 05-25-2011, 01:25 PM
alexvilla's Avatar
alexvilla alexvilla is offline
Junior Member
 
Join Date: Sep 2010
Location: Russia, Saint Petersburg
Posts: 64
Default

this is your thread
http://www.anythingbutipod.com/forum...ad.php?t=63221
Reply With Quote

  #3  
Old 05-25-2011, 01:46 PM
TexMex TexMex is offline
Junior Member
 
Join Date: May 2011
Posts: 20
Default

Thank you, but it is some bugs in it and i cant fix it
Reply With Quote

  #4  
Old 05-25-2011, 02:52 PM
jbob182's Avatar
jbob182 jbob182 is offline
X-Fi2 Development Moderator
 
Join Date: Feb 2010
Location: The U.S.A.
Posts: 554
Default

There are several things wrong, first off when calling a function ie: function menu () you simply type menu()

And i see no function avbryt()
Reply With Quote

  #5  
Old 05-26-2011, 05:59 AM
TexMex TexMex is offline
Junior Member
 
Join Date: May 2011
Posts: 20
Default

OKEY i see! Igain Thank you
Reply With Quote

  #6  
Old 06-04-2011, 03:37 PM
mininanook mininanook is offline
Junior Member
 
Join Date: Apr 2011
Posts: 12
Default

Hey texme remember the idea of the imposible game? I think it's starting to work.
Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 01:38 AM.