| View previous topic :: View next topic |
| Author |
Message |
bdpuk
Joined: 15 Dec 2005 Posts: 4
|
Posted: Sat Jan 14, 2006 9:08 pm Post subject: exit code |
|
|
| 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? |
|
| Back to top |
|
 |
ShUr1k3n
Joined: 16 Oct 2005 Posts: 42
|
Posted: Sun Jan 15, 2006 2:31 am Post subject: |
|
|
| Ur program will EXIT when u press the "HOME" button and then select "Yes"... |
|
| Back to top |
|
 |
MikeHaggar
Joined: 18 Jul 2005 Posts: 116
|
Posted: Sun Jan 15, 2006 4:08 am Post subject: |
|
|
You add a break condition to your game loop, like:
| Code: |
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 ;) |
|
| Back to top |
|
 |
bdpuk
Joined: 15 Dec 2005 Posts: 4
|
Posted: Sun Jan 15, 2006 7:10 am Post subject: |
|
|
| yep, sorry i was quite silly, i guess i did not think about the home button. |
|
| Back to top |
|
 |
|