enigma-dev/enigma-dev — pull request #18 by forthevin (2012-09-28 21:34:09+00:00)
Title: Precise collision system

A simple implementation of a precise collision system.

The system is not fully implemented. The system is based off the BBox system, and the code is mostly the same, except for modifications for precise collisions.

The basic collision structure is a char array, with 1 for something and 0 for nothing. The structure is constructed by concatenating the rows of the given image together and using alpha==0 to 0 and alpha!=0 to 1. The structure uses 8 bits for each collision bit, and has fast access times.

Some parts of the system treats all collisions as precise vs. precise. Changing it to support other cases such as bbox vs. bbox should be relatively easy once sprites support different types of collision shapes/methods.

Some parts of the implementation has been tested, including the parts that are used for the collision event, as well as rotation and scaling.