Post by magique on Dec 28, 2018 22:00:56 GMT
I'm finishing up the first version of my game and I'm having trouble with various restart scenarios. There seem to be 2 issues, but maybe I'm just not doing things correctly.
The first issue is when I get a true game over state when the player has lost all lives and the game kit goes into game over state. I want to restart the game from the main menu, but it doesn't work as expected. I call LevelSettings.RestartGame followed by LevelSettings.PauseWave. Then when the player presses the Play button I call LevelSettings.UnpauseWave so it should start the first wave. However, this does not start the first wave. If I also call LevelSettings.ContinueGame then it will start the waves again. But from the documentation, it seems like I shouldn't have to call ContinueGame because I have completely restarted the game.
The second issue arises from the first issue. I can't seem to find a way to quit the game and completely restart it. If the player presses Escape, I have a Pause menu appear that has Resume and Quit buttons. If the player selects Quit then I want to RestartGame and PauseWave as before, but in this case we are not in a game over state. If I perform the same sequence I do for game over then the game simply continues on from the next wave and doesn't even let me pause it. I also tried first calling EndWave, but that didn't help either.
So, basically I need to know if it's a bug that forces me to call ContinueGame after calling RestartGame. And I need to know the best way to abort a game that has not ended and restart it cleanly.
The first issue is when I get a true game over state when the player has lost all lives and the game kit goes into game over state. I want to restart the game from the main menu, but it doesn't work as expected. I call LevelSettings.RestartGame followed by LevelSettings.PauseWave. Then when the player presses the Play button I call LevelSettings.UnpauseWave so it should start the first wave. However, this does not start the first wave. If I also call LevelSettings.ContinueGame then it will start the waves again. But from the documentation, it seems like I shouldn't have to call ContinueGame because I have completely restarted the game.
The second issue arises from the first issue. I can't seem to find a way to quit the game and completely restart it. If the player presses Escape, I have a Pause menu appear that has Resume and Quit buttons. If the player selects Quit then I want to RestartGame and PauseWave as before, but in this case we are not in a game over state. If I perform the same sequence I do for game over then the game simply continues on from the next wave and doesn't even let me pause it. I also tried first calling EndWave, but that didn't help either.
So, basically I need to know if it's a bug that forces me to call ContinueGame after calling RestartGame. And I need to know the best way to abort a game that has not ended and restart it cleanly.