A small WebGL2 game: drive a train around a spherical planet, collect coins to add carriages, and avoid the traffic cones. Built with raw WebGL2 and GLSL ES 3.00 for COMP4422 Computer Graphics.
Open the GitHub Pages version directly:
https://purplebeezx.github.io/Lab_COMP4422/
The game loads assets with fetch, so it needs an HTTP server (opening index.html as a file will not work):
python3 -m http.server 8000Then open http://localhost:8000 in a browser with WebGL2 support.
| Input | Action |
|---|---|
| Space | Start / restart |
| W / S | Accelerate / brake |
| Mouse | Steer (click the canvas first to lock the pointer) |
| Mouse wheel | Zoom |
| P | Pause gameplay |
| [ / ] | Decrease / increase time scale |
All models and textures are generated procedurally:
python3 tools/generate_assets.pyRequires Python with NumPy and Pillow.