The rigid-body physics engine for the unfinished game 'KFighter'.
It's written from scratch in C++ but it may as well be in C since it uses so few of C++ features. It's currently Windows only but it's designed to be extended to other platforms in the future. I started it by following a tutorial by the brilliant Casey Muratori. The physics engine is based off talks done by Erin Catto of Box2D fame and works by iteratively solving a set of constraints.
- Collision detection and resolution
- Rectangle collision
- Friction
- Collision islands (collections of objects typically connected by joints or other constraints that shouldn't collide with each other)
- Multiple collision points
- Stable stacking
- Joints
- Angle constraints
- Joint friction
- PID controlled motors
- Loop live code editing
- Pose matching
Arrow keys
: Adjust gravitySpace bar
: Cycle posesEscape
: Quit[
,]
: Increment/decrement random seedL
: Cycle key recording; cycle between the following three actions: begin recording, end recording and begin playback, and end playbackR
: Reset game (keeping the seed the same)
- Windows 7 or later (only tested on Windows 10, may work on older versions).
- Visual Studio build tools 2015 or later (may work on earlier versions)
- Download this repo as a zip (or clone it)
- Run
kfighter\build\win32_kfighter.exe
kfighter\build
- The directory for VC's outputkfighter\code
- The main code directory, all the compiled code is in herekfighter\media
- Images for marketingkfighter\misc
- Editor tools and config fileskfighter\reference
- Links to useful resources
- Windows 7 or later (only tested on Windows 10, may work on older versions).
- Visual Studio build tools 2015 or later (may work on earlier versions)
- Download this repo as a zip (or clone it)
- Open
kfighter\code\build.bat
in a text editor - Change the second line:
pushd "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\"
to be inside the directory of your version of Visual Studio cd kfighter\code
- Run
build.bat