Collision Detection with 128 Sprites

For Scene Demos that display animations, graphics, and music. Also for tech demos of graphics capability of VERA or the audio capabilities of the PSG, FM, or PCM audio channels.
Post Reply
pastblast
Posts: 20
Joined: Tue Sep 01, 2020 8:00 pm

General - CX16 Collision Detection with 128 Sprites

Post 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 3031 times
Post Reply