Self-Study 4


This week's task was to add some basic functionality to the game I created last week. The game needed to have a health bar, health pickups, enemies that reduced the player's health when they collided with them and a trigger for the game to end when the player's health reaches 0.

Here you can see an enemy chasing the player, colliding with them and the game ending when the health bar reaches 0.

The health bar was created using a red slider inside of a black outline that would grow and shrink based on what was happening to the player in the game world. If an enemy entered the player's trigger, 10 HP would be continuously removed until the player got away from them.

Enemies still spawn at dedicated spawners and chase the player around the level.

Here you can see the player collecting a health pickup, which adds 10 HP to the player's health bar.

The health bottle has a trigger script attached to it that says that when the player makes contact with it, add 10 HP to the player and set the bottle to inactive, which makes it disappear and be no longer accessible to the player.

Leave a comment

Log in with itch.io to leave a comment.