Extending the Adventure Game
In Chapter 7, we added polish to the game by applying some simple VFX using post-processing effects (mainly Bloom) with the Universal RP, Shader Graph for a custom 2D shader to make specific parts of a sprite glow, 2D lights to highlight the player, and the Trail Renderer component for a quick VFX win on our bullet sprite.
We then moved away from the player to give some much-needed attention to the enemy NPCs in the game by creating configurable enemies using a ScriptableObject architecture and introducing changing behaviors based on the state pattern as implemented via a simple FSM.
With the base functionality in place for the playable character and enemies with behaviors (mostly) set up, we can now move on to spawning enemies that attack the player and vice versa with a reusable health and damage system.
In this chapter, we’re going to cover the following main topics:
- Health and inflicting damage
- Updating the player and enemy...