A lightweight 2D game engine built with TypeScript and HTML5 Canvas.
Designed for arcade-style games like Pong, platformers, and simple simulations.
- Game loop using requestAnimationFrame
- Scene system (menus, levels, game states)
- 2D renderer (shapes, sprites, text)
- Camera system (follow + zoom)
- Basic physics (rigidbody, gravity, collisions)
- Sprite sheets + animations
- Texture loading system
- Delta time + FPS tracking
npm install
npm run dev
npm run build
Create a scene by extending Scene.
Use render(renderer) to draw objects.
Create a Game instance with width, height, and title.
Load scenes using engine.loadScene().
Start game with game.start().
start() → runs once when scene loads
update() → runs every frame for logic
render(renderer) → runs every frame for drawing
canvas.addEventListener("mousemove", (e) => { console.log(e.clientX, e.clientY); });
- Store paddle Y position
- Update it using mouse movement or input
- Draw using renderer.fillRect
- Paddle is a vertical rectangle
- Engine is still in development
- Physics system is simple but extendable
- Built for learning and experimentation
MIT