View Full Version : how do i close the world...

12-02-2009, 11:16 AM
I want to be able to get the game to close when a key is pressed on the keyboard but not sure how to do this, any ideas are greatly appriciated!!

Thanks in advance

12-02-2009, 05:09 PM
Unfortunately, you can't. All you can do (to my knowledge) is reset the world with the Backspace key. Just add some instructions to click the Stop button in your world when the world ends.

12-02-2009, 07:24 PM
I think you can close the world by having a method that creates an error which in turn shuts the world down. Dameria and I have experimented with this before although it was never taken far.

12-02-2009, 08:29 PM
I don't think people want to see an error window when the world ends though. Another alternative is just making a billboard that says "The End" or "Game Over" and import, so that way when the game or animation is over the billboards "isShowing" property is then set to true. I don't know if that is what you're going for though.

12-03-2009, 08:38 PM
There's a way to make the world zero out by dividing by -x (negative x) or subtracting x or something. Not completely sure but I've seen it done somewhere.

12-03-2009, 08:48 PM
If you want when the world ends you can have a message saying "Game Over" or whatever you want to say, and then "wait 5 seconds" or something and have a line where you set the value of an integer to "1 / 0" Since a number cannot divide by 0, the world will close with an error, and you can time the error with the wait command.