Devlog 3 - Week 10: Interactions


Implementation

The checkpoint for this week's implementation is enemies and interaction. As hinted at in previous devlogs, I drew up a simple zombie enemy to wander throughout the world. To implement some kind of interaction for this checkpoint, I started with the basics - health, enemy behaviour, and damage from enemies.

To capture the nostalgic nature of arcade games, I introduced a classic three-point health bar in the form of a purple three-heart UI. Intended to be the same colour as Davey's guitar, these hearts serve as the visual representation of his health. The health slider UI was integrated with a dedicated player health script attached to Davey's game object. After testing that a simple, rectangular slider reacted to health loss as intended, the purple hearts were then applied to the slider in the form of a mask, framing the hearts into the shape of the slider. Currently, the heart UI diminishes gradually, though the intended effect is for the hearts to recede one at a time; this will hopefully be implemented in a future build.

Health loss, of course, would not be possible without some kind of collision interaction, and that is where our trusty damage collision and player health scripts comes in. Upon collision with any enemy, a gradual damage-dealing process is initiated, decrementing the player's health as collision continues. This damage effect ceases as soon as the player character stops colliding with the enemy object (or, he dies), ensuring that health reduction only occurs during contact with enemies. Upon loss of all health, the player character dies by being deleted from the current game instance.

Current implementation of the health UI and player-enemy collision.

As part of my enemy implementation, I made the decision to not use any kind of sophisticated program for navigating the world, for three reasons: time taken, simplicity's sake, and for the fact that zombies are "braindead" - it seems realistic (and hilarious) that they would not take notice of objects. The player may be able to use this oversight to their advantage. Instead, the zombies have a "wandering pursuit" script, wherein they periodically walk in a random direction, but will pursue the player if they are in range. The player can escape the zombie's chase, though this range is double the initial pursuit range.

The zombies also contain their own health script, a simplified version of the player health script: health points can be set, and upon complete loss, the zombie is deleted from the game instance. Currently, zombie health cannot be tested until player attacks are implemented.

Enemies returning to wandering if out of range.

Following this development log, I will begin to implement player attacks, item pickups, and a wave-based enemy spawner.


User Feedback / Improvements

User feedback for this week was obtained via casual face-to-face interactions, wherein I asked for general suggestions and feedback:

  • Incorporate a health-loss indicator: it would be ideal if there were some sort of visual to indicate contact with enemies, such as an explosion prefab, or even a sound effect; at the moment, players may not even notice their health depleting due to the lack of effects.
  • Colour variety: as I drastically changed the colours of the tilemaps, most of the background now appears to be a shade of dark slate blue. For better visual stimulation, variety, and clarity, it would be nice if there were more shades and colours within the tilemaps.
  • Improve colour values: the heart slider UI's colour currently blends with the background colours due to similar values; to ensure better clarity, the background colours will be adjusted, with more variety incorporated.

Alternative Approaches

  • A* enemy pathfinding: implementing A* enemy AI could have added complexity and intelligence to enemy behaviors. This pathfinding algorithm would allow enemies to navigate dynamically around obstacles, and choose the most efficient paths to reach the player character. While improving the game experience, it would also require more complex scripting, and potentially impact game performance.

Leave a comment

Log in with itch.io to leave a comment.