Collect dots in a 3D maze, avoid ghosts, and use a short dash to escape danger.
WASD or arrows to move. Space to dash. Enter to start or continue. P/Esc to pause. C for camera. M to mute.
After Hours brings Pac-Man's pellet collection and ghost pursuit into a 3D browser maze. I built it solo with AI assistance from ChatGPT, using HTML, CSS and Three.js. The yellow character, blue walls and four differently coloured ghosts remain easy to recognise. The main addition is a short dash that gives you another decision at a crowded junction.
The maze uses a 23 by 23 grid. Collect every pellet to finish the sector and earn a level-scaled completion bonus. Even-numbered sectors open several alternate routes, while the four sector themes repeat as levels continue. The run begins with three lives, and crossing 10,000 points awards one extra life.
Power pellets temporarily make ghosts vulnerable. Dash has a different purpose: it speeds the player up for 0.7 seconds and allows safe passage through ghosts, with a six-second cooldown. A purple energy core appears after 30 percent of a sector's pellets have been collected. Picking it up awards 500 points and eight seconds of collecting nearby ordinary pellets automatically.
Use arrows or WASD to steer, and Space to dash. Touch controls provide direction buttons, swipes and a Dash button. P or Esc pauses, C changes the camera and M toggles sound. A requested turn is buffered until the corridor allows it, so you can prepare for the next junction instead of pressing at one exact instant.
The technical challenge is combining smooth movement with legal grid routes. The simulation tracks movement between cells and uses breadth-first distance fields for ghost decisions. The ghosts use different targets: direct pursuit, a point ahead of the player, an offset target or a corner retreat. Their paths still follow the maze rather than cutting through its walls.
Three.js 0.180.0 supplies the renderer. RoundedBoxGeometry shapes the base, BufferGeometryUtils merges wall geometry, and EffectComposer combines RenderPass, UnrealBloomPass and OutputPass. GLTFLoader adds Kenney Space Kit props around the arena. Best score, the five highest run records and settings stay in this browser. After Hours is part of the free Solo Game Devs collection, with a standalone HTML download planned for browser play.
Follow on Gumroad to hear about new free releases and downloads.
Follow on Gumroad