In a game I made, I want to restart the game when the players presses a button.
I have an instance of a
Game class, which is where most of the game happens.
I though that I could simply initialize it again, and it will be reset.
Game game = new Game(); - When the program launches.
game = new Game(); - When restarting the game.
But the game uses a lot of additional classes, such as
Missile. Do I have to initialize all of them too, or is initializing the Game class, which will create new
Tank objects and
Missile objects (with the same reference names as the previous Game instance), enough?
In general, what would be the best way to reset a game or a level in a game?