Web Game Engine
A 3D game engine for the browser, written in TypeScript: Three.js for rendering, Rapier for physics.

- Type
- 3D game engine
- Platform
- Browser
- Rendering
- Three.js
- Physics
- Rapier
About the project
I built a browser game engine in TypeScript, on an object-oriented architecture combined with an ECS (Entity-Component-System) model. The goal: a modular, extensible and fast base.
Three.js handles real-time 3D rendering and Rapier the physics simulation. The two stay in sync, so movements and collisions remain consistent on screen.
Features
-
OOP and ECS architecture
Each entity is made of specialised components (physics, rendering, controller) run by dedicated systems. You can add, change or remove a behaviour without touching the rest.
-
Physics and graphics sync
Physical entities (RigidBody, Collider) are created from Hitbox components. Their state is copied to the matching Three.js objects every frame.
-
Mouse and keyboard input
Mouse movements and key presses become events the systems can read. You can control a character or a camera without tying entities to input devices.
-
Dynamic cameras
Three modes you can switch on the fly: first-person (FPS), third-person (TPS), and a free aerial camera. Each mode adapts the mouse and the physics.
-
Service Locator and modular architecture
A central Service Locator decouples the critical dependencies (physics, graphics, input). You can swap a service without rewriting the logic of the systems.
Built with
- TypeScript
- Three.js
- Rapier