A top-down maze chase & rescue โ you're lost in a haunted castle. Dodge the mummies, grab the key, rescue your friend and escort them to the exit before the timer runs out.
The original Castle was a little Akihabara-engine maze game. This is a ground-up rebuild in dependency-free vanilla JavaScript on a plain canvas that keeps the heart of it โ run through a castle, dodge the mummies, find your friend โ and layers on a full arcade loop: 8 generated levels, torchlight fog, keys, power-ups, spike traps, a rescue-and-escort objective and an online leaderboard. All art is drawn procedurally (no image assets).
- ๐ฎ Move with WASD / arrow keys (or drag on touch). The camera follows you.
- ๐ป Mummies, bats and guards chase you โ one touch costs a life (you have 3).
- ๐๏ธ Grab the key, find and rescue your friend, then escort them to the glowing exit before time runs out.
- ๐ Collect gems for score (chain them for a combo) and โณ hourglasses for more time.
- โก Power-ups: Freeze stops the mummies, Sprint speeds you up, Torch widens your view.
- โ๏ธ Dodge spike traps, and lean on the minimap to navigate.
- ๐งฉ 8 escalating levels โ each a freshly generated maze (endlessly replayable).
- ๐ฏ๏ธ Torchlight / fog-of-war on the darker levels for real "lost in a castle" tension.
- ๐ฅ Enemy variety โ shambling mummies (chasers), fast bats, patrolling guards.
- ๐ค Rescue & escort โ your friend follows your trail once found.
- ๐ Online leaderboard (time + treasure + no-hit bonuses) with retro initials entry.
- ๐น๏ธ Keyboard + touch, fully responsive.
The leaderboard uses your browser's localStorage out of the box and shares
an online board across all of these games via a free Supabase project. See
docs/supabase.sql for the schema and
js/config.js for where the project URL + public key go โ the
board is namespaced by gameId, so Castle's scores are separate.
It's a static site โ no build step:
git clone https://github.com/DanMat/Castle.git
cd Castle
python3 -m http.server 8000 # then visit http://localhost:8000| File | Responsibility |
|---|---|
js/game.js |
Canvas engine: maze generation, camera, movement/collision, chasing-enemy pathfinding (BFS), fog, items, escort, HUD, state machine. |
js/levels.js |
Pure-data level parameters (size, enemies, timer, torch radius, theme). |
js/leaderboard.js |
Reusable high-score store (Supabase REST + localStorage fallback). |
js/config.js |
Supabase URL/key and game id. |
Rebuilt in vanilla JavaScript from the original Akihabara-engine version.
MIT ยฉ DanMat
