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