Collision Mask Module - Pixel Perfect Collisions

Monkey Forums/User Modules/Collision Mask Module - Pixel Perfect Collisions

Powelly(Posted 2014) [#1]
The Collision Mask Module is a module to perform pixel perfect collision detection.
All the code is open source. The Collision Mask Utilities programs are licenced under the MIT licence and the Monkey-X module is public domain.

The Collision Mask Module consists of:
* Two applications written in Qt (C++) that run on Windows/Linux/MacOS and allow you to create and view “collision masks” from the alpha data in PNG images.
* A Monkey-X module (a single file) that contains the scaling, rotation and collision detection code.
* Four example applications.
* An API reference and the custom mask file format specification.

The Monkey-X module is written in 100% standard Monkey-X code and does not require any changes to Mojo. In fact, apart from the Debug display feature, it doesn't even require Mojo. It works on all Monkey-X targets.

Features include:
* Synchronous and Asynchronous loading of mask files.
* Rotation and scaling of masks.
* Pre-allocation of empty masks for use as targets for rotation and scaling, avoiding allocation of memory in the main game loop.
* Mask to mask collision detection.
* Point to mask collision detection.
* Rectangle to mask collision detection.
* Circle to mask collision detection.
* On-screen display of masks for debugging purposes.

You can find the downloads on my website:
http://www.loadcode.co.uk/software/monkey-x-software/collision-mask-module/


ziggy(Posted 2014) [#2]
Looks nice


DruggedBunny(Posted 2014) [#3]
This is brilliant! Works really well even on HTML5 in all the demos... many thanks for making this available!