melonjs / melonJS

a fresh, modern & lightweight HTML5 game engine
https://melonjs.org
MIT License
5.92k stars 643 forks source link

Animation created from atlas: misaligned hitbox #1201

Open CodeAndWeb opened 1 year ago

CodeAndWeb commented 1 year ago

When an animated sprite is created with createAnimationFromName(), the hitboxes of the animation frames are misaligned:

animation-hitbox

When a sprite is created with atlas.createSpriteFromName() the alignment of the hitbox is OK.

To Reproduce

  1. git clone https://github.com/CodeAndWeb/melonjs-sprite-sheet-example.git
  2. npm run dev
  3. Press 's' to display debug panel
  4. Check 'hitbox' to display hitboxes
obiot commented 1 year ago

that's weird ! Thank you for reporting this, I'll look into it as soon as possible 👍