This site requires JavaScript, please enable it in your browser!
Greenfoot back
Tamas
Tamas wrote ...

2016/4/28

Closeing the game

Tamas Tamas

2016/4/28

#
Hi! I'm new here and Irun into a problem that:If the user press a button (in my case "q") the program whole close. Oh..and if someone can help if i finish the game how i can "convert" or what i need to do to the game can start from an .exe file?
danpost danpost

2016/4/28

#
In the world act method, just use:
1
if (Greenfoot.isKeyDown("q")) Greenfoot.sttop();
The 'Share' button at the top right will pop up a dialog with three tabs -- one which is to create a standalone executable jar file. I am not sure if that would be sufficient, but it may be an option.
Tamas Tamas

2016/4/30

#
Ok thanks but I don't want to stop the game ,I want to quite the game like shut down the java tab
danpost danpost

2016/4/30

#
Tamas wrote...
Ok thanks but I don't want to stop the game ,I want to quite the game like shut down the java tab
Do you mean like:
1
System.exit(0);
Tamas Tamas

2016/5/1

#
Thank you!
You need to login to post a reply.