exit code

Discuss using and improving Lua and the Lua Player specific to the PSP.

Moderators: Shine, Insert_witty_name

Post Reply
bdpuk
Posts: 4
Joined: Thu Dec 15, 2005 4:35 am

exit code

Post by bdpuk »

hi, i'm a bit of a noob when it comes to lua. i'm trying to fix a program which is broken. my main question is, how do i get lua to exit my program. i read that i have to stop all sound and music etc. i haven't the faintest where to start. i looked in the tutorial, and there wasn't a bit for exit code? any help?
ShUr1k3n
Posts: 42
Joined: Sun Oct 16, 2005 9:04 pm

Post by ShUr1k3n »

Ur program will EXIT when u press the "HOME" button and then select "Yes"...
MikeHaggar
Posts: 116
Joined: Mon Jul 18, 2005 2:20 am

Post by MikeHaggar »

You add a break condition to your game loop, like:

Code: Select all

REPEAT = 0

while REPEAT==0 do
-- other game stuff here

  if Controls.read():start()then
    REPEAT = 1
  end

end
Then, when you press start, the game wil exit back to lowser (or whatever else). If you want to exit back to the psp's browser then you have to do what ShUr1k3n said ;)
bdpuk
Posts: 4
Joined: Thu Dec 15, 2005 4:35 am

Post by bdpuk »

yep, sorry i was quite silly, i guess i did not think about the home button.
Post Reply