appropriate method to end the game?
by Joe Olivieri · in iTorque 2D · 04/19/2011 (10:39 pm) · 5 replies
I have a button that is displayed when my menu is clicked. Ideally this button would allow me to return the user to the home screen when pressed... underneath it would do all the right stuff to close up shop.
Right now this button calls a function on my level to end the game. This function in turn calls my endGame function defined in game.cs. When I execute this through the simulator I hit a EXC_BAD_ACCESS though.
So... anyone care to lend some advice on this one? I'd like to wrap up the level, close up shop and return to the home screen in an orderly fashion.
(If it's not too much trouble I'd take a restart button too!)
Right now this button calls a function on my level to end the game. This function in turn calls my endGame function defined in game.cs. When I execute this through the simulator I hit a EXC_BAD_ACCESS though.
So... anyone care to lend some advice on this one? I'd like to wrap up the level, close up shop and return to the home screen in an orderly fashion.
(If it's not too much trouble I'd take a restart button too!)
#2
04/20/2011 (4:55 am)
A restart button is fine if it's for a level.
#3
So if someone hits the home button, and the app goes into the "suspended" state I'm supposed to deal with it "appropriately"? Easy enough, I'll have a restart level button and a menu button to take them back to the main screen.
Thanks for the tip.
I think what I'll do is use a UIKit view (similar to http://docs.torquepowered.com/it2d/official/content/documentation/Tutorials/iOS%20Series/interfaces.html ) to provide a main menu and pause menu. Instead of quit, it will just be a main menu button and I'll keep the restart.
The original question still stands (to some extent)... if I want to unload the level and load it back up , what's the preferred method to do so?
04/20/2011 (7:13 am)
Seriously? So if someone hits the home button, and the app goes into the "suspended" state I'm supposed to deal with it "appropriately"? Easy enough, I'll have a restart level button and a menu button to take them back to the main screen.
Thanks for the tip.
I think what I'll do is use a UIKit view (similar to http://docs.torquepowered.com/it2d/official/content/documentation/Tutorials/iOS%20Series/interfaces.html ) to provide a main menu and pause menu. Instead of quit, it will just be a main menu button and I'll keep the restart.
The original question still stands (to some extent)... if I want to unload the level and load it back up , what's the preferred method to do so?
#4
There's also .endLevel() but that's called from inside loadLevel anyways.
04/20/2011 (7:51 am)
sceneWindow2d.loadLevel()There's also .endLevel() but that's called from inside loadLevel anyways.
#5
I went through the tutorial for the UIKit ViewController bit - it seems awful clunky. What are you guys doing for GUIs? Are you using the torque gui system or are you just adding buttons to your levels?
I'm going to explore those options next - just curious what anyone else might be doing. Thanks!
04/20/2011 (9:32 pm)
Last question...I went through the tutorial for the UIKit ViewController bit - it seems awful clunky. What are you guys doing for GUIs? Are you using the torque gui system or are you just adding buttons to your levels?
I'm going to explore those options next - just curious what anyone else might be doing. Thanks!
Torque 3D Owner Aun Taraseina