Writing a game the hard way – from scratch using C – Part 2

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

https://youtu.be/xwzg1wYYKrU

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

It also makes use of fixed point maths since the eZ80 in the Agon Light that I am using does not have an FPU.

One response to “Writing a game the hard way – from scratch using C – Part 2”

  1. […] time I made a basic physics engine that could cope with collisions against different physics bodies. This time I’ve been adding […]

Leave a Reply

Your email address will not be published. Required fields are marked *