Restarting a Game Discussion

Hi all,

I’m not sure if this is the right place to post this, but I wanted to have a bit of a discussion and get your thoughts on how you would go about restarting a game?

I guess we can use the Card Matching app from the Foundations Course as an example. Let’s say mid game you were doing terribly and you wanted to restart so you could get a good score. How would you incorporate that functionality into your app, both in terms of UI buttons and menus etc. as well as the actual code in the background to restart it?

You are probably better off to use the existing functionality to start the game again after the conclusion of the current game either by winning it or running out of time.

Either way, the simplest way is to take into account what was done to set up the game and with that in mind, call a function to reset the game after you have tapped on the OK button in the Alert.

1 Like