Game Development Community

Resetting the game (Solved)

by Matthew · in Torque X 2D · 07/30/2009 (2:26 pm) · 2 replies

Is there a method I can call that will reset the game to the default state it's in when it starts? Currently, the user can play the game and when his lives=0, it goes to a "Game Over" screen and I can make it go back to the title screen. At first, I realized that from the title screen, it would go back to the current game session (now with -1 lives.) I figured out that in my StartGame() function in game.cs, I can call "SceneLoader.UnloadLastScene();" which will essentially restart the game but with one exception: I can no longer move the player! I think something happens to my input map. Is there a way to re-register the component that has my input map in it? Am I just resetting the game incorrectly? I imagine this has to be a very common problem with a simple solution. Any help would be appreciated.

#1
07/31/2009 (3:30 am)
Have you tried unbinding your input when you restart?

Scott Zarnke wrote a nice topic about how to unbind here:
www.garagegames.com/community/forums/viewthread/97325
#2
08/06/2009 (7:50 pm)
Got it!
http://www.garagegames.com/community/forums/viewthread/97879
Thanks again, Scott!