Skip to content

fix: create a verification for reverse movement#8

Open
fernandovtorres wants to merge 1 commit intomonacofj:mainfrom
fernandovtorres:feat/6/MovimentoReverso
Open

fix: create a verification for reverse movement#8
fernandovtorres wants to merge 1 commit intomonacofj:mainfrom
fernandovtorres:feat/6/MovimentoReverso

Conversation

@fernandovtorres
Copy link
Copy Markdown

Create a logic to prevent the snake from reversing direction directly, which would otherwise cause it to collide with itself.
The changes track the previous movement direction and use this information to disallow moves that would make the snake instantly reverse.

#6

@trqt
Copy link
Copy Markdown

trqt commented Sep 24, 2025

Hi! Could you coalesce the two commits? Thanks!

Copy link
Copy Markdown

@agathaicmc agathaicmc left a comment

Choose a reason for hiding this comment

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

this PR fixes the reverse movement issue that used to cause self-biting

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.

3 participants