Log In  


Cart #kudojowipa-0 | 2023-08-08 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
4

I'm new to PICO-8 here folks but absolutely hooked! I'm having a problem with my player shaking during movement as well as getting caught on my flagged sprites that the player collides with. I know some basics and have compiled this code by watching tutorials and scanning forums for code snippets but I think I am mixing some things that don't play well. I am really going for a smooth player movement vibe so I just added some acceleration rather than an abrupt "p.x+=1" movement style. It doesn't appear to show in my GIF but the player shakes violently during gameplay. Any ideas as to what could be causing this would be greatly appreciated!

4


Are you setting the camera's position to where the player was before adding velocity? it seems the camera is always lagging behind by 1 pixel? Just a hunch


@SmellyFishstiks is correct, putting your cam() funciton last in your game_update() function removes the jitter.
but it looks nice so far!

as a bonus, if you check the x and y collisions at separately, you can have your character slide along the wall instead of getting stuck.


Cart #stuck_on_flagged_sprites-0 | 2023-08-08 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA


You are right THANK YOU! I have no more player jitter but I am still having a collision issue that causes the player to get stuck on flagged sprites if they are walking next to them. Any ideas?


@rupees if the player checks x collisions and movement separately from the y collisions and movement, it allows the character to slide smoothly along walls, as well as not getting stuck.

Cart #yonimojiro-1 | 2023-08-08 | Code ▽ | Embed ▽ | No License


you can see that here


THANK YOU!



[Please log in to post a comment]