Devlog – Checkpoint 3: Enemies / Interaction / Puzzles


As this checkpoint focuses on "Enemies / Interaction / Puzzles," much of what I have covered in previous devlog entries applies directly to these areas. For instance, during Checkpoint 1: Player Movement (September 21, 2024), I developed the basic player movement controls, including interactions with enemies, and implemented the A* Pathfinding Project for enemy AI targeting. This system allowed the enemies to seek out the player, dynamically tracking their position as they moved throughout the scene.

Additionally, I have previously covered how I refined enemy and player interactions in Checkpoint 2: Basic Level Blocking (September 29, 2024) by transitioning from hierarchy-based objects to prefabs. This change required reconfiguring the player and enemy prefabs to dynamically select their targets and properly spawn into the game scene. These updates improved the overall interaction flow between player and enemies, with enemies now correctly tracking the player in real-time.

 Player-Enemy Dynamics and the Score/Health System

In this game, the interaction between the player and enemies forms the core of the challenge. Players and enemies have health systems that determine their survival, while the scoring system rewards the player for defeating enemies and collecting items.

Enemy Behaviour and Attack Mechanics

Enemies in the game actively engage the player by dealing damage when the player comes within range. The EnemyAttack script handles this interaction, where enemies reduce the player's health by a set amount (10) whenever they collide with or remain near the player. Each enemy attack triggers a cooldown, preventing continuous damage and giving the player time to escape or retaliate. This mechanic adds a strategic layer to combat, requiring players to time their movements carefully to avoid excessive damage.

Player Health and Survival

The player’s health is managed by the PlayerHealth script, which tracks current health and updates the UI accordingly. The player starts with a maximum health of 3000, which can now be adjusted directly in the PlayerHealth component within the Unity inspector. Each enemy attack reduces this value. If the player’s health drops below a critical threshold (e.g., 20), the player experiences a flashing visual effect to signal danger. If the player’s health reaches zero, the PlayerHealth script triggers the player's death, transitioning them to the main menu and ending the game.

To counteract enemy attacks, the player can restore health using items collected in the game. These items are managed by the PlayerInventory and ItemPickup scripts. The ItemPickup script plays a key role here by allowing the player to collect various items, such as health potions or enhancement items like the "Death Potion." Soon, health potions, when picked up, will immediately restore the player's health by an amount defined in the ItemPickup script. This script also handles adding the "Death Potion" to the player's inventory, allowing them to use it later to destroy nearby enemies and gain points. The player must balance collecting these items with managing enemy threats to maintain a healthy state throughout the game.

Enemy Health and Score System

Enemies also have their health, managed by the EnemyHealth script. When the player attacks enemies, their health decreases with each hit, and upon reaching zero, they are destroyed. In the white state, the enemy has 2 health points, meaning it takes 2 arrows to defeat. In the red state, the enemy’s health increases to 3 points, requiring 3 arrows to kill. The state of the enemy (white or red) affects how much health they have and how many points the player earns for defeating them. White enemies offer 25 points, while red enemies—who have increased health and a brief period of invulnerability—provide 50 points upon defeat.

The ItemPickup script ties directly into this system by allowing players to collect items that increase their score. Certain items, such as treasures, add points to the player’s total score when picked up, with values defined in the script. The ScoreManager and PlayerInventory scripts work together to track and display the player’s overall score, ensuring that every item collected or enemy defeated contributes to their progress. The score is updated in real-time in the UI, providing clear feedback to the player.

Overall Dynamic

The interplay between health, score, and item collection creates a dynamic where the player must navigate between surviving enemy attacks and maximising their score. Enemies represent both a threat and an opportunity: they reduce the player’s health, but defeating them or collecting valuable items rewards points. The strategic use of health items, avoidance of enemy attacks, and quick dispatch of enemies are all crucial to achieving a high score while ensuring the player’s survival. The ItemPickup script further enhances gameplay by giving the player the ability to collect and use items that affect both health and score, adding another layer of depth to the game.

Feedback and Adjustments

Last Monday, I received feedback from the unit coordinator, which highlighted the issue of starting the game immediately in an attack situation. It was pointed out that this approach is not ideal, as players need time to assess the game scene and gain an understanding of the mechanics before being thrust into combat. Based on this feedback, I made several changes to improve the player’s experience. 

I have added a pause feature (menu) that allows the game to pause, giving the player a moment to evaluate the situation. The pause menu also includes an option to quit the game. Additionally, I implemented a help button on the main menu that provides some basic information about gameplay. This feature is still a work in progress and will be expanded to include more details, eventually being made available across all game scenes. The following images are of the pause/quit game feature and the main menu help feature.


I also received feedback from one of my peers, Chloe, who mentioned that the game is looking better, which is encouraging as I continue refining and improving the project.

Leave a comment

Log in with itch.io to leave a comment.