Finishing the Game and Next Steps
20 Mins
You will add health and define the winning conditions for the game
Tutorial Outcome
By the end of this tutorial, you will be able to
  • Add script to keep track of the health of a player
  • Make obstacles subtract a player’s health
  • Display the health of a player
  • Add User Interface design to the game
  • Tag GameObjects
  • Define the winning conditions
Key concepts:
  • Game level design
  • Unity Playground scripts
Game Ideas
  • Dog fight game between two players
  • Spaceship precision flying game
  • Space racing game  
Challenge Ideas:
  • Now that you have gotten started with Unity Playground, make a creative rescue mission game or something completely different!
  • Want to use completely different characters and backgrounds? Check out: free game assets by Kenney:
Recommended Unity Versions
2017.4 and Above
Finishing the Game and Next Steps
Add aliens that need to be rescued to the screen

You’ll finish the game by turning it into a rescue mission
  1. Go to Project > Assets > Images > Creatures and drag and drop an alien onto the Hierarchy
  2. In the Inspector, add the Polygon Collider 2D and tick off the Trigger option. Also add the Auto Rotate script
  3. In the Rigidbody 2D that is automatically added, make Gravity 0, make Friction 1, and Angular Friction 0.5
  4. Add the Collectable Attribute (Script) so that when the player touches the alien, the player receives one point and the alien is removed from the screen
  5. Press play and check that when the player touches the alien, the alien is removed and the player receives one point
  • Auto Rotate script: automatically rotates a GameObject
  • Collectable Attribute script: allows an object to be picked up for score

Design the levels of the game
You’ll add levels to the game  
  1. From the Hierarchy, drag the alien and the asteroid into the Prefab folder (Project > Prefab)
  2. Now, duplicate the objects and place them around the game scene to make your game more exciting and challenging
  3. It’s now your turn to complete the game design! Will you make it a rescue mission? Racing game? Fighter game? Use the Playground Project Design Document to write out your ideas. You can always look at the Playground script cheat sheet for all the pre-made scripts that you can use
  4. Make sure to also check out the Getting Started, Reference Guide, and the example games. Use #UnityPlayground and share your game on Twitter once you’re done