Flixel Power Tools FlxCollision
Collision in flixel is handled with bounding boxes. Which is basically two rectangles colliding, and if they intersect you get a collision back. This class takes it the necessary step further and adds pixel perfect collision testing. Only the intersecting area is tested for speed. And you have control over the alpha tolerance level (so you can exclude pixels with an alpha level less than what you need). It also works with scaled, rotated or animated FlxSprites! and is perfectly fast enough to use in real-time.
if (FlxCollision.pixelPerfectCheck(player, spikes))
// Player really did hit those spikes!
Recent Flixel Power Tool Posts
- Flixel Power Tools v1.9 Released
- Flixel Power Tools v1.8 Released - Let's get clicky
- Flixel Power Tools v1.7 - Kaboom!
- Flixel Power Tools v1.6 released including FlxControl
- Flixel Power Tools v1.5 - A monster of an update!
- FlxScreenGrab and FlxScrollZone added to Flixel Power Tools
- Flixel Power Tools v1.3 - Now Flixel 2.5 compatible!
- FlxHealthBar added to Flixel Power Tools
18 ResponsesLeave a comment
Make yourself heard
All about Photon Storm and our
HTML5 game development services
Filter our Content
- Cool Links
- Flash Game Dev Tips
- Game Development
- Geek Shopping
- In the Media
- Phaser 3