Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Player Jitter #3

Open
evoxalien opened this issue Mar 4, 2018 · 1 comment
Open

Player Jitter #3

evoxalien opened this issue Mar 4, 2018 · 1 comment

Comments

@evoxalien
Copy link

Firstly Physics is hard..

I think the player jitter is coming from your grounded logic, and the subsequent corrections to player pos in the collision loops.

I tinkered with it for a while, if you stop applying gravity once you're rested on a surface you can keep the player jitter free, however you have to find the right place in your game loop to change the grounded to false if the player steps off a surface or jumps. (Jump is the easy one out of the two)

I'm happy to help!

I found your game listed on https://www.pygame.org/news and popped in to check it out earlier.

@FergusGriggs
Copy link
Owner

Thanks for the comment! The reason I was re-enabling movement after 7 ticks was so that if you were up against say a 1 block high wall, you could jump whilst holding left or right to pass it. Subsequently it allows you to occasionally stick to walls. Despite it's flaws, personally I prefer the current system. If you have any ideas on how to incorporate both mechanics, I would love to hear about them!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants