Skip to content

AlxHnr/2d-platformer-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

screenshot

Vector-based 2D platformer demo. Physics is running at a fixed tickrate. Linear interpolation is used to render in-between states. The speed of the physics simulation can be slowed down or sped up by an arbitrary factor at runtime. Collision detection uses the separating axis theorem. Objects with a high velocity are processed in substeps (multisampling) to prevent clipping/tunneling trough walls.

Building and running the demo

CMake and a C++17 compiler is required. Most dependencies will be downloaded and compiled during the build process.

mkdir build/
cd build/
cmake ..
cmake --build . --parallel "$(nproc)"
cmake --build . --target run

Controls

  • left/right arrow keys - Move
  • up - Jump
  • r - Reset game
  • mouse wheel - Zoom
  • ctrl + mouse wheel - Rotate camera
  • left mouse button - Place solid block
  • right mouse button - Place dynamic block