Jittery movement - Ollie and Auto clone

Hi,

I’m trying to make the Ollie & Auto game from the live streams following it step by step, but I have a problem. The character movement is super jittery when I added the jump function. I think it has to do with the y acceleration. Without it the characters move smooth from left to right. The blocks for movement are identical to the original so I don’t know where to look.

Here is the original: https://arcade.makecode.com/S05674-85544-39804-31460
And here is my version: https://arcade.makecode.com/S59886-36058-52515-43529

Please note I haven’t added B button function, and unlock doors etc. But this has no influence on the movement.

Thanks

7 Likes

Ok I found the cause of the jittery movement, apparently you can’t leave a blank pixel line at the bottom of one of your frames. It messes up the collision detection at the bottom.

So if there is gravity on you character it uses the bottom pixels for collision. Is there maybe a solution for this? Like using one block or shape for collision detection for all frames and not every frame of you animated character?

2 Likes

make sure the size of the sprite is even pixels (not 15x15, like 16x16)
and welcome!

2 Likes

@tyzr there’s a simple trick to fixing this, check out my comment on this post:

3 Likes

I guess the problem has been found but anyway welcome to our forum and if you need any further help we’re always here.

1 Like

Thank you for tips and welcoming.

@richard that is exactly what I needed, thank you!

4 Likes

Welcome to the forums @tyzr!