Join me on a journey as I attempt to write a game for my Agon Light using nothing but raw C programming. In this second episode I figure out how to make a very basic 2D rigid body physics system work.
It doesn’t matter if you don’t have an Agon Light, I’m bringing you along for the ride. We’ll be looking at how games deal with the objects they manipulate, and how to detect and resolve collisions in 2D.
The code for my game library that I’m building is available on Github
https://github.com/ncot-tech/agon-template
This video contains an example of how I implemented a very basic 2D rigid body physics system with collision detection and resolution.
The 2D physics uses basic Euler Integration and Newton’s laws of motion, as explained in many places online. Here are a few resources I came across
- https://www.reddit.com/r/gamedev/comments/1gl2vi/how_to_create_a_custom_2d_physics_engine_fourpart/
- https://gafferongames.com/post/integration_basics/
It also makes use of fixed point maths since the eZ80 in the Agon Light that I am using does not have an FPU.
Leave a Reply