Open ACrazyTown opened 1 year ago
I tried to do this a long time ago, but I lack in knowledge on how to transform mathematically a rectangle with a matrix (Not to mention that you would need to increase the width or height depending on the position of the sprites that are currently in), Not like FlxSprites, which I believe that the only thing they need to check is the rendering width and height of the FlxFrame
I can't promise because I would need to check a lot of vids and math stuff to make the hitbox be decent but I'll see what I can do
Currently, FlxAnimate does not have an accurate hitbox (in fact, it does not have a hitbox at all I believe). This can lead to issues with positioning and other stuff dependant on the hitbox.
Describe the solution you are proposing
In theory it should be simple to fix this, although in practice it may not be as simple, depending on how FlxAnimate handles rendering and stuff.
When a frame change happens in an animation, FlxAnimate should get the lowest and highest x and y positions of the currently rendered sprites. From there we have the size of the hitbox and we just need to position it.
I have already attempted to prototype this but tbh I have no idea how FlxSprites hitboxes are created and positioned so my attempt, while working, started dropping FPS because of the goofy method I used to position them.