Summary
Keywords
Full Transcript
In this episode of our Enemy AI & Combat mini-series, we tackle the inevitable: death — for both enemies and the player. We extend our existing state machine architecture with dedicated EnemyDeathState and PlayerDeathState, keeping death handling just as clean, isolated, and extensible as movement, damage, and combat logic. Rather than treating death as a one-off special case, we wire it in as a first-class state. This lets us control animations, physics reactions, timing, and post-death behavior without cluttering our controllers or breaking combat flow. To show how flexible this approach can be, we implement two very different visual death styles: Enemies explode into a burst of physics-driven death parts for immediate, readable feedback The player plays a full death animation, reinforced with a brief slow-motion effect to give the moment weight and drama The result is a death system that feels intentional, expressive, and easy to expand — whether you’re adding respawns, checkpoints, game-over screens, or cinematic polish later on. In this video, we: Add a DeathState to both the enemy and player state machines Cleanly disable movement, input, and combat on death Implement physics-based enemy death explosions Play a dedicated player death animation Add a time-slow effect on player death for dramatic emphasis Ensure death integrates cleanly with existing damage and combat systems Lay groundwork for respawn and game-over flow By the end of this episode, death is no longer a hacked-in endpoint — it’s a readable, polished system that fits naturally into the combat language of the game. 👀 Coming Up 🔄 Respawn flow and checkpoint handling 🧠 Post-death cleanup and state recovery 🎮 Game-over logic and further combat polish 🎟️ Early Access Early access episodes are available for YouTube Members and Patreon supporters. 👉 patreon.com/NightRunStudio 🔗 Assets Used in PROJECT (Free for Commercial Use!) → Mattz Art’s Kobold Warrior Pack https://xzany.itch.io/kobold-warrior-2d-pixel-art → Minimal Fantasy GUI by Eta https://etahoshi.itch.io/minimal-fantasy-gui-by-eta → Unique Free Spell Icons by Marvyra https://marvyra.itch.io/unique-free-spell-icons/devlog/859741/my-free-8-bit-spells-is-now-available → Frostwindz Priest Animations https://frostwindz.itch.io/pixel-art-vfx-priest → Frostwindz Lightning Animations https://frostwindz.itch.io/pixel-art-skill-animations-lightning → Otsoga’s Training Dummy https://otsoga.itch.io/training-dummy → Brullov’s Generic Character v.0.2 https://brullov.itch.io/generic-char-asset → Brullov’s Castle of Despair https://brullov.itch.io/2d-platformer-asset-pack-castle-of-despair → Szadi’s Pixel Fantasy Caves https://szadiart.itch.io/pixel-fantasy-caves
