arena.module
README.md
sideScrollerKit.arena
The boss fight as a state machine, apart from the component that runs it, so a fake boss and a fake player can drive it in a test. Arena.new(id) makes one arena's state; Arena.step(a, env, dt, me, room) advances it a frame: the player walks in, the arena seals (env.seal(id, true)) and the boss wakes; the boss falls, the arena opens and the win is kept (env.progress.beatBoss(id)); the player is beaten (Arena.playerDown) and the arena opens, and once nobody alive is left in the room for resetAfter seconds the boss's owner resets it to full health. env.boss needs state, reset() and activate(); the BossArena component passes the pixelBosses Boss2D.