Skip to content

Conversation

@nikhilsanjeev29
Copy link

What: This PR changes a major issue in the snake game in which you can do two inputs at once either resulting in game physics not functioning right or the snake killing itself without even hitting itself by setting a boolean at the top that whenever an input is done the boolean is true and when the game updates the boolean turns false so that another input can be placed.

Why: This matters because you could die in unexpected places resulting in good runs ending and confusing gameplay.

Verified: I verified this by testing the gameplay and confirming that I cannot go left while already going right and by showing that I can use left and up or right and up without dying.

Snake-Vid

I expected that the snake would correctly move. I observed that the snake didn't function incorrectly crashing into itself without cause.

Status: This PR is ready for review. Next step is merging it with the main, or just using the code from the snake issue as I also created another modal that allows for either a wrapped or walls mode (there is a slight css bug where the modal moves up).

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