Skip to content

Instantly share code, notes, and snippets.

@CMThre3
Last active June 28, 2019 15:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CMThre3/1c4aea82a36203fa8cc8450ea98fd2a4 to your computer and use it in GitHub Desktop.
Save CMThre3/1c4aea82a36203fa8cc8450ea98fd2a4 to your computer and use it in GitHub Desktop.

This is an example of making the Fabulous Planets project into a game.

When the user starts the app, all of the planets appear unnamed and the user has to name them. The way that the user names the planets is by tapping on them, when this is done they get a close up preview of the planet as well as some details, If the user taps on the ?????? box, they can attempt to name the planet. If the planet is nammed correctly they are bought back to the previous menu, the name will now also appear with the planet that was just named, if they are incorrect they are told to try again.

To do this a new bool called GuessMade was created for each planet that would verify wether or not the planet has been guessed correctly, if the planet has not been guessed then placeholder entry would be displayed under the planet rather than the name.

Comparison of the changed code and the original code: https://github.com/TimLariviere/FabulousPlanets/compare/master...CMThre3:planets-game

I have also added some unit tests included in the code changes above:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment