Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
Enemy AI | Ep. 05 | Player Damage
Play lesson

Metroidvania Tutorial Series - Enemy AI | Ep. 05 | Player Damage

5.0 (3)
46 learners

What you'll learn

This course includes

  • 10 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

In this episode of our Enemy AI & Combat mini-series, we turn the camera inward and focus on the player’s side of the damage equation. We introduce a dedicated PlayerDamagedState that mirrors the enemy damage architecture — handling knockback, hit animations, and a flashing damage effect — so player combat feedback feels just as responsive and readable as enemy reactions. Rather than hacking damage responses directly into the player controller, we extend the same clean, modular state machine approach used for enemies. This keeps player damage logic isolated, reusable, and easy to expand later with death states, invulnerability windows, and advanced combat interactions. As a bonus polish pass, we also revisit the enemy attack system and tweak it to allow slide evasion during attacks, giving players more expressive defensive options and improving overall combat flow. In this video, we: - Add a PlayerDamagedState to the player state machine - Implement directional knockback for the player - Play damaged animations and a flashing hit effect - Reuse and adapt the existing enemy damage architecture - Cleanly separate player damage logic from movement and input - Adjust enemy attacks to allow slide evasion during combat - Improve combat readability and moment-to-moment feel By the end of this episode, damage feels consistent across enemies and the player — not just mechanically, but visually and emotionally — reinforcing a shared combat language throughout the game. This sets the stage for player death handling, invulnerability frames, and more advanced combat systems without needing to rework the foundation. 👀 Coming Up ☠️ Player death states and respawn flow 🛡️ Invulnerability frames and damage immunity windows ⚔️ Further combat tuning and feel 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

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere