Skip to content

fix: snake must not move in opposite direction#31

Open
yp1plus wants to merge 1 commit intomainfrom
bugfix/30/snake-dying-opposite-direction
Open

fix: snake must not move in opposite direction#31
yp1plus wants to merge 1 commit intomainfrom
bugfix/30/snake-dying-opposite-direction

Conversation

@yp1plus
Copy link
Contributor

@yp1plus yp1plus commented Oct 13, 2023

For example, if a snake is looking up, it should not move down. So we should disconsider the event if the player presses the down arrow. The same is valid for the other directions.

For example, if a snake is looking up, it should not move down.
So we should disconsider the event if the player presses the down arrow.
The same is valid for the other directions.
Copy link
Contributor

@lucasgpulcinelli lucasgpulcinelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested the proposed change right now and it seems to be working perfectly, the implementation in the code is simple and effective, great job!.

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.

2 participants