Microsoft MakeCode

My Cat Hops and pow

Hello guys, I would like to ask someone for help with a small error that I have in a game. I was creating the game of the cat that jumps on platforms and when I put the sprite to show the animation falling it doesn’t work The cat kind of locks up and jumps is weird, I have everything exactly as explained https://makecode.com/_KcpRc3RD3bVL

1 Like

I’ve once had that exact problem. I fixed the glitch but now it won’t do the jumping pictures of the CAT


Here’s the link

I made the whole math remainder part into its own if statement. That fixed the glitch-ness but the jumping images will be the problem

hi, @PitSalas good to see you made it to the forum! @jwunderl figured out what was wrong and made a fix here https://makecode.com/_KLwEtm2cc1Fv thanks, Joey!!

basically, the image for the standing cat was high up, and it would fall a bit when you made it stand. Joey’s change brought the image down to the bottom:
before:


after:

1 Like

Yup, just a quick note on why this matters – we count collisions / overlaps based on the filled in (non-transparent) pixels in the sprite, so when the image was changed from falling to standing, the cat would now be floating a few pixels in the air; this would no longer be hitting the wall, so acceleration would change the velocity, and the on game update saw that and change the image to the falling version – which would hit the wall, switch back to normal, and float – causing the image to switch between the two every other frame.

2 Likes