Log In  

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

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!

P#132850 2023-08-08 01:13

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

P#132853 2023-08-08 01:34

@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.

P#132857 2023-08-08 02:37 ( Edited 2023-08-08 02:40)

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?

P#132856 2023-08-08 02:55

@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

P#132859 2023-08-08 04:59 ( Edited 2023-08-08 05:00)

THANK YOU!

P#132866 2023-08-08 13:20

[Please log in to post a comment]