so I’m having a very easy to solve ( I think) problem.
I’m making some mini-games, lets say I have game 1, game2, game3.
I can start game1 then after it’s done I can start the game from the beginning.
The problem is that when I start the game again when I do game1=new Game1(); it doesn’t start from 0, some objects are already asigned to game1 so I obviously get errors.
To clarify a little bit more:
User chooses: Game1,Game2,Game3 –> He chooses Game1 –> CreateGame1(); –> game1=new Game1();
User finishes the game and chooses to enter the game again: CreateGame1() –> game1=new Game1(); here is where the problem is. game1 is defined at the beginning of my class as Game1 game1;
Is there any easy way to solve this or should I remove every item manually?
Thanks in advance!
I think that you have some static properties whose values are not reset when a new object is created. I do not see other reason for this issue. Anyway, it’s difficult to answer the question precisely since you did not post your code.