🕹️ Learn how to program with Code Arcade!
Play in your browser:
Or download for desktop:
Read the blog post.
Code Arcade is a puzzle game where you learn to program by writing and fixing JavaScript code to beat each level.
- Each level presents a play area (the game) and a code editor containing the level's script.
- Read the instructions in the play area and the comments in the code to figure out the objective.
- Write or fix the JavaScript code in the editor.
- Press Run to execute the code with the KAPLAY.js game engine.
- Use WASD or the arrow keys to move the player (the bean) to the exit door. In some levels you must spawn the exit, collect a key, or fight off enemies.
- Touch the door to advance to the next level.
Buttons:
- ► Run: run the code in the editor
- ⟳ Restart: restore the editor to the level's original code
- ⓘ Hint: display a hint in the game console
The console in the play area reports output from
console.log(), errors, and hints.
- 31 levels that teach JavaScript programming concepts:
- Outputting with
console.logand errors - Single-line and multi-line comments
- Data types: strings, numbers, booleans
- Data structures: arrays, objects
- Variables (
let/const), template literals - Functions: declarations, function expressions, hoisting
- Iteration:
forloops,forEach() - Timing:
setTimeout(),setInterval() - Object properties and methods
- JSON:
JSON.stringify(),JSON.parse() - DOM events:
addEventListener - Promises: fulfilled, rejected,
then/catch,async/await - Networking:
fetch()
- Outputting with
- Game built on the KAPLAY.js engine
- In-browser code editor powered by CodeMirror with JavaScript syntax highlighting
- Keyboard (WASD/arrow keys) and mouse controls
- Progress saved when level is cleared
- Assets from KAPLAY Crew
- Editor from CodeMirror
Clone the repository:
git clone https://github.com/remarkablegames/code-arcade.git
cd code-arcadeUse the Node.js version:
nvm useInstall the dependencies:
npm installIn the project directory, you can run:
Runs the game in the development mode.
Open http://localhost:5173 to view it in the browser.
The page will reload if you make edits.
You will also see any errors in the console.
Builds the game for production to the dist folder.
It correctly bundles in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your game is ready to be deployed!
Builds the game and packages it into a Zip file in the dist folder.
Your game can be uploaded to your server, Itch.io, etc.
Increments a level and renames the file:
npm run increment-levels -- --level=<number>Jump to a level by passing it as a query string (overrides the saved level in localStorage):
http://localhost:5173/?level=<number>
For example, to play level 10:
http://localhost:5173/?level=10
