Code Craft Spellbook is a level-based educational game that teaches the fundamentals of game development through interactive coding challenges. Players unlock spells—JavaScript-like commands—that manipulate the game world, solve puzzles, and defeat enemies.
⎛⎝ ≽ > ⩊ < ≼ ⎠⎞
Each level introduces a new spell and a unique challenge that requires using that spell (and sometimes combining it with previously learned ones). Players type code directly into the in-game spellbook to cast spells and progress.
Spell | Description |
---|---|
print() |
Display text in the game world |
move() |
Move the player in a given direction |
wait() |
Pause execution for a set time |
spawn() |
Create entities like enemies or coins |
destroyAll() |
Remove all entities of a given type |
changeColor() |
Modify the appearance of entities |
playSound() |
Trigger sound effects |
adjustScore() |
Modify the player's score |
adjustHealth() |
Modify the player's health |
random() |
Generate random numbers |
repeat() |
Loop a block of spells |
ifCollisionType() |
Run code when the player touches an entity type |
Each level includes:
- A new spell to learn
- A tutorial prompt explaining how it works
- A challenge that requires using the spell
- Visual feedback and sound effects
- Collision-based gameplay with real sprite art
All game sprites (player, enemies, coins, doors, etc.) are stored in the /assets
folder. Replace these with your own pixel art or animated sprites to customize the experience.
To run the game locally:
- Clone the repo
git clone https://github.com/sleepyprogrammer1012/codecraft-chronicles.git cd codecraft-chronicles
- Open in browser: Click Here!