How to reset game at game over?

I am wondering how I can reset my code after the player runs out of time in my game. I have the loss conditions I just don’t know how to reset all the variables and tuples, and labels that have been changed as the game went along. It is a text based game. Do I try and call viewdidload?
I wasn’t sure where to post this.

Hi @derekm

It really is up to you, how to reset the game view, there is no a silver bullet here. The best way would be probably to write a function that will reset all your labels/variables/player state and call it from viewDidLoad method of your controller. And when you need to reset your game( when player runs out of time ) you call that reset method again.

I hope this was helpful.

Nikita

This topic was automatically closed after 166 days. New replies are no longer allowed.