Week 4 - Simple Game using Unity AI


For this week's self-study I improved upon the tutorial project previously shown, and turned it into a (simple, yet proper) game. This meant implementing a full health system for the player, enemy spawning, and a user interface. The first thing I needed to do in this conversion from the tutorial project was disabling the point-and-click spawning of enemies, and instead add a bunch of invisible spawner objects around the level that periodically spawn enemies in. Additionally, I gave these enemies some collision and a script that decreases the player health by 1 each time they collide. Here's an animation showcasing these two additions:


Another part of the game is health packs strewn around the level. This is so the player has some way to earn back their health, thus prolonging the game a little. Here's an animation of the player obtaining a health pack (and yes, even though it may be hard to tell, they spin!): 


Once the player's health reaches zero, they lose and a "game over" overlay appears indicating this. In addition, in order to make the gameplay discontinue, the player's hitbox, model, and movement script are all disabled. The reason I didn't just delete the player instead is because this causes errors with other parts of the game that reference the player in some way. Here's one last animation showing the end screen (and the player being swarmed by enemies):


Overall this was good practise for the upcoming game project I'll be working on, and it helped me get my head around the main concepts of making 3D games. I'm quite happy with how it turned out in the end.

Leave a comment

Log in with itch.io to leave a comment.