Low-poly 3D flight simulator, made in HTML Canvas with TypeScript.
This project is a low-poly 3D flight simulator implemented using the HTML Canvas API and TypeScript. It demonstrates "3D" rendering techniques within a 2D canvas environment.
To create the illusion of 3D, the project implements a graphics pipeline, including optimizations such as frustum culling.
Terrain generation is achieved using a deterministic pseudo-random hasher to simulate Perlin noise, with multiple layers of noise sampled for added detail.
The game generally runs between 60 and 160 frames per second, depending on the browser and device.
-
Clone the repository:
git clone https://github.com/Kamix-08/canvas-flight-sim cd canvas-flight-sim -
Install dependencies:
npm install
-
Build the project:
npm run build
or, for a development loop with automatic recompilation:
npm run dev
-
Run the game by opening
index.htmlin your browser.
| Key | Action |
|---|---|
i |
Pitch up |
k |
Pitch down |
j |
Roll left |
l |
Roll right |
Special thanks to Krzysztof for his invaluable assistance with debugging the graphics pipeline and contributing to game design. This project would not have been possible without him.
If you would like to contribute to the project yourself, please submit a pull request.