Page 1 of 1

Collision Detection with 128 Sprites

Posted: Fri Feb 03, 2023 10:47 am
by pastblast
This is the 2nd part of a demo showing 128 sprites. This application adds collision detection. The details are in the README file in the repository, but the collision detection involves combining several techniques, including pre-computing many numbers needed to make the demo happen. Specifically, the X/Y coordinates of the sprites, their corresponding spatial maps, and the decisions of whether sprites collide, based on their relative (not absolute) coordinates, are all pre-computed.

This program uses 3 collision detection techniques, in a nested (general to specific) fashion:

* Quadrant-level detection (4 parts of the screen)
* Spatial-level detection (256 parts of the screen)
* Pixel-level detection

Note that the program uses the VERA hardware collision detection for the quadrant-level detection. It does not use hardware to detect which kinds of sprites collide, only the general screen area where they collide.

https://github.com/TurboVega/128_collision_detection
demo128c.png
demo128c.png (15.4 KiB) Viewed 3046 times