A retro, 2D platformer game inspired by Super Mario. Built entirely with HTML5 Canvas, Vanilla JavaScript (ES6 Modules), and SCSS!
To build and run this project locally, you will need to have Node.js and npm installed on your machine.
-
Install dependencies: First, install the required development dependencies (Sass).
npm install
-
Build the CSS: The game uses SCSS for styling. You need to compile it into regular CSS before playing.
npm run build:css
(Note: If you are actively modifying the styles, you can use
npm run watch:cssto automatically recompile on changes). -
Start the local server: Launch the game using the built-in server script.
npm run serve
-
Play: Open your browser and navigate to http://localhost:8645.
Objective: Navigate through the level, stomp on enemies, collect coins and mushrooms, and reach the Princess before time runs out!
Controls:
- Move Left/Right:
Left/Right Arrow KeysorA/D - Jump:
Spacebar,Up Arrow, orW - Start/Restart Game: Click the buttons on screen or press
Enter/Space
Game Mechanics:
- Mushrooms: Collect them to grow bigger. If you get hit while big, you will shrink instead of losing a life.
- Koopas (Turtles): Stomp them once to hide them in their shell. Stomp the shell again to send it sliding across the screen to take out other enemies!
- Question Blocks: Jump and hit them from below to reveal coins or mushrooms.
Feeling overwhelmed? There is a secret cheat code built into the game:
- During gameplay, simply type the word
cheatanywhere on your keyboard. - You'll hear a confirmation sound, and the game will enter "Bullet Time" (Slow Motion).
- Type
cheatagain to return to normal speed.
Enjoy saving the Princess!