A downloadable game

Summary

In this Unit of Create with Code, I had to program a top-down game with the objective of throwing food to hungry animals - who are stampeding towards the player - before they can run past the player. 

How to Play

  • A & D to move horizontally 
  • Left click to shoot

Project Outcomes

I was required to become much more familiar with some of the most important programming and Unity concepts, including if-then statements, random value generation, arrays, collision detection, prefabs, and instantiation. In completing this Unit, I learnt how to program a basic game with the ability to launch projectiles and manoeuvre the player to keep the game alive.

After completing this project, I am now able to:

  • Create an if-then statement in order to implement basic logic in your project, including the use of greater than (>) and less than (<) operators
  • Transform a gameobject into a prefab that can be instantiated into the scene
  • Work with prefabs to add efficiencies in your workflows
  • Get user input with GetKey and KeyCode to test for specific keyboard presses
  • Use arrays to create an accessible list of objects or values and randomly select an object from that array
  • Randomly generate values to randomize spawn positions
  • Change the camera’s perspective to better suit your game
  • Repeat functions on a timer with InvokeRepeating
  • Write custom methods to make your code more readable
  • Detect collisions and destroy objects that collide with each other
  • Display messages in the console with Debug Log