Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/punchcafe/punchengine

A 2-D physics engine for the Arduboy.
https://github.com/punchcafe/punchengine

Last synced: 19 days ago
JSON representation

A 2-D physics engine for the Arduboy.

Awesome Lists containing this project

README

        

## Units

units of position, speed, time and acceleration are designed to be as low-level as possible.

**position**: centipixels (cpx) 10 cpx = 1px on screen.
**velocity**: centipixels per frame (cpx/fm). To avoid bodies passing through each other without colliding, this has a natural limit of `v = 10` (or one pixel per frame). This isn't as limiting as it seems, as the frame rate of the arduboy loops may be set so that v = 1 appears to be arbitrarily fast. To achieve the effect of v appearing to be some speed, v' where v' has units `px/s`:

>v' = (fps/10) * v

**acceleration**: centipixels per frame per frame (cpx/fm^2)

>a' = (fps^2/10) * a

**time**: "time" is measured by frames. game time and human time are mapped by the fps of the arduino game.

## Collision Resolution
collision resolution is based on two bodies existing in the same space, or touching, on a single frame. Since it isn't based on projecting movement vectors, it means that a limiting factor is that no one body be able to move faster than 10cpx/fm. Manipulating the fps is how you would achieve "faster" and "slower" real time play.