Skip to content

DanMat/Castle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Castle ๐Ÿฐ๐Ÿ•ฏ๏ธ

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.

Play the demo ย  Vanilla JS License: MIT

Castle gameplay โ€” a hero in a top-down stone maze with chasing mummies, gems, a friend to rescue and a minimap

What is it?

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).

How to play

  • ๐ŸŽฎ 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.

Features

  • ๐Ÿงฉ 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.

High scores

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.

Play locally

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

How it works

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.

Credits

Rebuilt in vanilla JavaScript from the original Akihabara-engine version.

License

MIT ยฉ DanMat

About

๐Ÿฐ A top-down maze chase & rescue โ€” dodge the mummies, grab the key, rescue your friend and escape across 8 torch-lit levels. Online leaderboard, dependency-free vanilla JavaScript.

Topics

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors