/* Original Forge arena adapter; Genre Lab1.0 bounded-wave/contact pattern. MIT. */ export function arenaStep(state,dt){ const events=[];state.invulnerable=Math.max(0,state.invulnerable-dt);state.spawnClock-=dt; if(state.spawnClock<=0){state.spawnClock+=3;if(state.hazards.length<8){const id=state.nextHazard++;state.hazards.push({id:'hazard-'+id,x:id%2?625:15,y:30+(id*67)%300});}} for(const hazard of state.hazards){const d=Math.hypot(hazard.x-state.player.x,hazard.y-state.player.y)||1;hazard.x+=(state.player.x-hazard.x)/d*45*dt;hazard.y+=(state.player.y-hazard.y)/d*45*dt;} if(state.invulnerable===0&&state.hazards.some(h=>Math.hypot(h.x-state.player.x,h.y-state.player.y)<24)){events.push({type:'damage',amount:1});state.invulnerable=0.8;} return events; } export function pulse(state){ if(state.charges===0)return []; state.charges--;const before=state.hazards.length; state.hazards=state.hazards.filter(h=>Math.hypot(h.x-state.player.x,h.y-state.player.y)>100); return [{type:'pulse',removed:before-state.hazards.length}]; }