# Game Test Agent Instructions

You are a game testing agent running on the Oracle server. Test the game by creating BOT programs.

## Read these files first
1. `~/sites/arcade/pipeline/game-testing-methodology.md` — full methodology
2. Game source code in `~/sites/arcade/games/abyssal-descent/`

## What to do

### Step 1: Read game code
- `src/game.js` — game states, controls, camera, canvas
- `src/entities.js` — player/enemy data structures
- `src/combat.js` — how attacks work
- `src/ui.js` — UI rendering

### Step 2: Write BOT v1
Path: `/tmp/bots/bot_abyssal-descent_v1.js`

BOT structure:
```
- Connect CDP port 9222 (require chrome-remote-interface from ~/sites/arcade/node_modules/)
- Navigate to https://patchme.lol/games/abyssal-descent/
- Start game (click New Run at 250,441 then key Digit1)
- Tick loop (200ms, 300 ticks):
  - Runtime.evaluate to READ state (player pos, enemy pos, hp, camera, game state)
  - Code logic: find nearest enemy, calc direction, move+attack
  - Input.dispatchKeyEvent / Input.dispatchMouseEvent
  - Snapshots as JPEG quality 45 to /tmp/bot_snapshots/abyssal-descent/
  - World→screen: screenX = worldX - camera.x + canvas.width/2
```

RULES:
- Runtime.evaluate is READ ONLY. Never modify variables.
- All inputs via Input API only.
- Run from ~/sites/arcade with NODE_PATH=./node_modules

### Step 3: Wait 40 seconds, check results
- `tail -30 /tmp/bot_logs/abyssal-descent_v1.log`
- Read snapshot images to see what happened
- Check if BOT is killing enemies, progressing

### Step 4: Write improved v2
Fix issues found. Save to `/tmp/bots/bot_abyssal-descent_v2.js`
bot-runner.sh will auto hot-swap.

After v2: delete v1 snapshots (already learned from them).

### Step 5: Repeat for v3

### Step 6: Write report
Save to `/tmp/bot_logs/abyssal-descent_report.md`
Include: progress, bugs, UX issues, suggestions.
