I need some help with some glitchy animations

I’m making an NES version of ssb (probably illegal on a Microsoft website) but I’m having issues with the animation. In the animation previews, they work exactly how they should, but when I play it in the game, the animation starts glitching out.
Here’s a link to the game: https://makecode.com/_6FiUqceuLWyT

2 Likes

By the way, I have not gotten the animations for excitebike and samus, and the stage selection hasn’t been programmed yet.

Your problem is due to these animation frames that are smaller than the normal size of the sprite:


In Makecode, when a sprite’s image changes, its hitbox updates to be a square around all filled in pixels. Because the bottom row has no pixels, the hitbox is momentarily updated to be one pixel shorter than normal. Then, when the next frame of the animation happens, the hitbox resizes and clips into the ground, causing the visual stutter effect.

For this reason, some people decide to make a separate “hitbox sprite” that is invisible and does all the collisions, and they make the “animation sprite” move to the location of the hitbox sprite every game update and have no collision, so it doesn’t affect anything.

You could also just add the tip of his boot touching the ground in those wrong frames and that would fix the issue.

1 Like

Thanks for the help. Sorry it took so long to get back with you.

1 Like