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

Fix unchangeable direction when button is hold #311

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

Tyago-Teoi
Copy link
Contributor

Fixes #298 .

This PR proposes the following changes:

  • Create a int variable called 'last_c' that keeps the last directional key pressed.
  • If the last key is equal the current key, is called 'continue' on the while loop.
  • So the 'nanosleep' function is not called and the CPU process keys until a new directional key different to the 'last_c' key is pressed.

@Tyago-Teoi Tyago-Teoi changed the title Feature/#154 Fix unchangeable direction when button is hold Jan 13, 2022
@Tyago-Teoi
Copy link
Contributor Author

This can solve #272 too.
Sorry, i forgot to separate in another branch. The first and second commits remove the .mp3 file containing the copyrighted song and replace it with a generic one.

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.

Snake doesn't change directions
2 participants