Tiny and readable
One file, no install, no account, about 10 KB to download. Open the source and every feature is a few dozen lines you can follow.
No image files here: every picture is a coloured shape. The level is text, a tilemap where each letter is a tile.
Click the game, then ← → or A D to move, Space to jump. A gamepad works too.
Loading… A top-down game: four-way movement, enemies that bounce off walls, a Timer that spawns gems, collision layers so enemies only bite the player, and a saved high score.
Click the game, then arrows or WASD. Collect gold, avoid red.
Loading… Game Design & Development · Our engine
Rosetta 2D is our class's own 2D game engine. It is small enough to read in an afternoon, and it is shaped like the big engines on purpose: a scene tree of nodes, a fixed timestep for movement, named input actions and collision layers. Everything you learn here has a name in Godot, Unity, Unreal, GameMaker and Phaser, and the Tool Rosetta shows you which.
One file, no install, no account, about 10 KB to download. Open the source and every feature is a few dozen lines you can follow.
ready, update, fixedUpdate, bodies, areas, tilemaps, signals and cameras work the way they do in professional tools, so moving on later is a change of vocabulary, not a fresh start.
Levels save as plain JSON (serialization), tilemaps export to the free Tiled editor, and art is ordinary PNG. Nothing is locked inside our engine.
Every building block of Rosetta 2D, translated. Turn on the engine you plan to use next.
index.html file and paste this in.TileMap.fromRows level, and build from there. Copy pieces from the examples above.<canvas id="game"></canvas>
<script type="module">
import { Game, Scene, Body, Shape } from 'https://mrscandrett.github.io/assets/js/rosetta2d/rosetta2d.mjs';
class Player extends Body {
ready() { this.add(new Shape({ w: 16, h: 16, color: '#e4572e' })); }
fixedUpdate() {
const move = this.game.input.vector('left', 'right', 'up', 'down');
this.vx = move.x * 100;
this.vy = move.y * 100;
}
}
const game = new Game({ canvas: document.getElementById('game'), width: 320, height: 180 });
game.input
.bind('left', ['ArrowLeft', 'KeyA']).bind('right', ['ArrowRight', 'KeyD'])
.bind('up', ['ArrowUp', 'KeyW']).bind('down', ['ArrowDown', 'KeyS']);
game.start(new Scene({ children: [new Player({ x: 160, y: 90 })] }));
</script>