Okay, so if I have a non-animated entity with a pixelmask, then the collision detection is dandy, but if I have an animated entity with a pixelmask, then the hitbox is bigger than the entity (if I pause the game with the console, then I can see the other spritemap index animations to the right of the entity). How and why is it like this? How do I fix it?
Animated pixelmask has a huge hitbox?
Copying
(Martí Angelats i Ribera)
#5
OK that’s not the way to do it. You are making a Pixelmask of ALL the tiles together.
Do you want a square hitbox? Just use this (obviously you’ll probably have to change the values)
originX = 0;
originY = 0;
width = 16;
height = 16;
Do you want a static Pixelmask? You’ll have to create another image, embed it and create the pixelmask with it
[embed(etc.)]
public const MASK:Class;
//and then
mask = new Pixelmask(MASK);
Do you want an animated Pixelmask? Have a look at this thread.
PD: The last soluction requieres some conditions and you may have to create a second spritemap for the collision.