-
Notifications
You must be signed in to change notification settings - Fork 6
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
Holding down a movement key makes player move too fast. #5
Comments
I just checked again and see you are right. Weird. Perhaps it is occurring in dark.c. |
Okay I found the problem. When you press and hold it goes though the SDL_PollEvent loop multiple times for the same key press and this will change player's position multiple times before the other creatures are told to move. This fragment fixes it for Day19 inside dark.c:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If I have an enemy (who has the same movement speed/frequency as the player) right next to me and move one square at a time, the enemy will keep pace and I'll never gain any space between us. This is working as intended.
If I hold the movement key down however, I start gaining space and eventually completely lose the monster. I'm not sure if this is because of my slow laptop; I tried seeing if it happens to you on stream, it doesn't look like it but I can't tell. I'm only on day 20 but I tested on your final build and it still happens.
The text was updated successfully, but these errors were encountered: