Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/punchcafe/punchengine
- Owner: punchcafe
- Created: 2019-08-24T13:31:49.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-02T00:03:45.000Z (over 4 years ago)
- Last Synced: 2024-10-27T23:38:42.495Z (2 months ago)
- Language: C++
- Size: 44.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
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.