abi>>forums

abi>>forums (http://www.anythingbutipod.com/forum/index.php)
-   Zen X-Fi2 Applications & Development (http://www.anythingbutipod.com/forum/forumdisplay.php?f=221)
-   -   As i have said earlier, i am new in this! (http://www.anythingbutipod.com/forum/showthread.php?t=63308)

TexMex 05-25-2011 12:14 PM

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();

alexvilla 05-25-2011 01:25 PM

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

TexMex 05-25-2011 01:46 PM

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

jbob182 05-25-2011 02:52 PM

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

And i see no function avbryt()

TexMex 05-26-2011 05:59 AM

OKEY i see! Igain Thank you

mininanook 06-04-2011 03:37 PM

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 03:00 AM.