Help with animation and code

I’m making a very basic game based on the “Over and Under #2” tutorial. The game works fine and I can finish the race no problem. But once I add animation to my player the player gets stuck on a loop and won’t advance the game. Problem is, in the original tutorial the animation works fine so idk what is different between the two games or what I did wrong. I don’t think the problem is with the tileset because without animation everything works fine.

I ran out of ideas, any help is welcomed, thank you.


1 Like

I think I know what’s happening, but to be sure I need to see all the animations frames or send me a link to the game by pressing the button in between the home and ? Buttons and then clicking share. This should give you a link.

Hi, here is the link https://makecode.com/_CpjRtWP2Wf73

thanks

1 Like

Yup, it was what I thought, the animation was uneven, and it was changing the hit box here is the updated link where it’s fixed —-> https://makecode.com/_W5cC0FeK9PAX

can you explain to me what do you mean by uneven and what changes did you make to do it? Thank you

Hi Ariram!
The distance to the ground was uneven so when it went from a distance of two to zero of the ground it would glitch into it. Here is a gif of me fixing it
IMG_4552

2 Likes

ohhhhhh I see, wonderful, thank you :pray: Do you know why it still gets stuck in random places sometimes?

Yes, the problem is the same but vertically. The stem will phase through the felling. If you make all the demotions the same in the animation or just add a hitbox. In this example—> https://arcade.makecode.com/S71681-26740-91179-34281 I added a hitbox, now you can make the sprite’s animation look like whatever you want without changing it’s hitbox. I also think the game would be better if it were randomly generated. In an unfinished game I made —> https://arcade.makecode.com/S09232-78140-21096-94337 It is similar to yours, feel free to copy or take inspiration from my code. Good pixel art in your game btw

This is wonderful! Can you explain to me what this line is for?

Also, I will have to check the randomly part slower bc that’s a lot of coding ^^U but I will, thanks <3

That line turns of collisions for the pumpkin sprite