Every enemy in this game used to walk up to you and swing. Goblin,
skeleton, slime, harpy, imp — all melee, all the time. Player has
had a bow and a fireball forever; enemies have had nothing. This
week the imps spit fire, the harpies fan three feathers at once,
the necromancers lob shadow bolts, and the cultists hurl blood
spikes that knock you back two tiles.
Every ranged attack telegraphs. A red ! icon pulses over the
enemy's head for 350-600ms before the shot fires — long enough to
dash, sidestep, or break line-of-sight by ducking behind a wall.
Walls and closed doors block projectiles so cover plays the way
it should: walk into the doorway, the boulder hits stone, you
walk out and finish them.
Each ranged enemy has its own glass-cannon balance. -30% HP vs
the same-tier melee mob, +50% damage per shot, kite-back AI when
you close in. Some types are hybrid (imp, harpy) — kite at range
but bite if you corner them. The pure-ranged types (necromancer,
cultist, plaguebearer) actively run from melee instead of
swapping. Mixed encounters force flanking; ranged-only rooms
become little puzzle boxes where you have to read the room and
pick angles.
The boss-fight pipeline from last week (telegraphs, projectiles,
line-of-sight) carried over cleanly — the same raycast util that
stops a death beam now also stops a fireball spit, the same
projectile spawner serves boss boulders and imp fireballs.
Cast
- Imp (Forest, Hellpit): fast small fireballs, 1.5s cadence,
hybrid — bite if cornered.
- Harpy (Forest, Hellpit): 3-feather fan in a 30° spread,
2.0s cadence, hybrid.
- Necromancer (Crypt, Void): heavy slow shadow bolt,
2.5s cadence, pure-ranged. Runs from melee.
- Cultist (Crypt, Void): blood spike with 80px knockback,
1.8s cadence, pure-ranged.
- Plaguebearer (Crypt, Hellpit): pus glob, 3.0s cadence,
pure-ranged.
Achievements
- Sniper Supreme (target 5) — kill 5 ranged enemies on a
single floor before any of them fires.
- Out of Range — clear a floor without taking damage from any
projectile.
- Glass Hunter (target 25) — defeat 25 ranged enemies
cumulative.
- Flank Attack — kill a ranged enemy from behind, breaking
its line-of-sight on the way in.
Plus the per-dungeon clear achievements (Forest Cleared, Ruined
Cleared, Crypt Master, Survived the Void, Hellpit Conqueror) now
actually unlock when you complete a themed dungeon — they were
defined but never wired to a fire.
What landed
lib/phaser/combat/los.ts — shared Bresenham raycast util.
Walls + closed doors block. Boss specials (Sprint 38) and
enemy ranged paths (this sprint) both call this.
lib/phaser/enemies/RangedAI.ts — state machine
(idle / chasing / kiting / aiming / shooting / recovering)
with mobile windup ×1.3 multiplier and hybrid melee fallback.
- Per-enemy ranged config — 5 entries (imp, harpy,
necromancer, cultist, plaguebearer) wired via
resolveRangedAttackForType. Glass-cannon HP scale (-30%) at
spawn time.
- Aim alert sprite — 16×16
! icon over enemy head during
the aim state, 200ms-on/200ms-off frame swap (cheap, no tween).
- Pack A — Ranged Projectile VFX (6 sprite sheets):
fireball / feather / shadow bolt / blood spike / pus glob /
alert. Animated at intended fps via existing texture-swap path.
- 17 Suno SFX — per-enemy charge + release pairs, per-impact
flesh hit variants, projectile-on-stone bounce, aim alert ping.
- Per-dungeon clear achievements wired — Forest Cleared,
Ruined Cleared, Crypt Master, Survived the Void, Hellpit
Conqueror trigger off the boss-defeated event with the
active dungeon snapshot.
Bugs killed
- Dungeon BGM bled into the overworld — GameScene's SHUTDOWN
handler dropped the i18n bridge but never stopped the active
BGM Sound instance. After a successful run, the boss theme
kept playing into OverworldScene's forest theme — two tracks
at once. Now the SHUTDOWN handler explicitly
.stop()s the
current bgm.
- Per-dungeon clear achievements never unlocked — the five
cleared_* entries were defined in the achievements module
but no caller ever called unlock(). Wired into the
boss-defeated handler in GameHUD, snapshotting the active
dungeon from the store before endActiveRun() clears it.