Skip to content

fix backwards direction keypress bug#11

Open
alwilson wants to merge 1 commit into7WebPages:masterfrom
alwilson:quick_direction_fix
Open

fix backwards direction keypress bug#11
alwilson wants to merge 1 commit into7WebPages:masterfrom
alwilson:quick_direction_fix

Conversation

@alwilson
Copy link

Pressing a key to turn the snake left or right and then immediately pressing
the key to turn backwards kills the snake by moving it backwards.
There is a conditional to prevent this from happening once, but it fails
in the case mentioned before.
This fixes that by saving the direction the player intends to turn, but only
actually taking the direction once we're ready to render the move.

Pressing a key to turn the snake left or right and then immediately pressing
the key to turn backwards kills the snake by moving it backwards.
There is a conditional to prevent this from happening once, but it fails
in the case mentioned before.
This fixes that by saving the direction the player intends to turn, but only
actually taking the direction once we're ready to render the move.
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

Successfully merging this pull request may close these issues.

1 participant