Ok Last question for today :P, Ignore Alpha for collision

Hey all just wondering if for a collision check its possible to ignore the alpha of an image, example a circle colliding with a box will still collide on the square box of the circle image so the corner hits long before the circle?.

again thanks for any input here.

For native games, there is a conditioon to test it (for sprites): “Sprite >> Collision >> Collision (Pixel perfect)” :slight_smile:

There is no pixel perfect test for HTML5 games yet (pixi.js, the render engine used by GD, doesn’t support it, event it doesn’t support simple collision masks I think), but you can use little “helpers” to check rectangle collisions of any size: I mean you have the object Player, and the object PlayerMask (with a smaller size for example, to fit the Player shape), then make the PlayerMask to follow the Player, and test collisions with PlayerMak.
Impractical, I know :frowning:

No, it supports collisions masks since 1 or 2 versions.

Great! :smiley:

Thanks guys got it colliding a lot closer with polygon hit box. Cheers