x:0, y:0
Foggy Dungeon
🏆 TREASURE FOUND!
solution.js
🎓 Learn JS
📖 API
🗺 Map
MOVEMENT (async — use await)
await player.right(3)
Move right 3 steps — replace 3 with any number
await player.left(3)
Move left 3 steps
await player.up(3)
Move up 3 steps
await player.down(3)
Move down 3 steps
await player.wait(500)
Pause for 500 milliseconds
SENSING (instant, no await)
player.see('right') → string
What's in that direction? dirs: up/down/left/right
player.pos() → {x, y}
Current tile position
player.has('key') → bool
Check inventory
player.inventory() → string[]
All items you're holding
player.look() → {up,down,left,right}
Check all 4 directions at once
TILE TYPES (returned by see/look)
🧱 'wall'
🟫 'floor'
🔑 'key'
🚪 'door'
📦 'chest'
💎 'crystal'
🔥 'trap'
🟢 'open-door'
TIPS
• Keys are auto-grabbed when you step on them• Doors auto-open when you walk into them (need key)
• Crystals = +50 pts, Chest = +1000 pts (you win!)
• Traps kill you instantly — avoid them!
• Use loops + player.see() to write smart paths
• Change seed → totally different world 🌍
⚡
180ms