Skip to content

Instantly share code, notes, and snippets.

@mukeshsolanki
Created May 27, 2022 05:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mukeshsolanki/ff7ae4083057bcca216d322d23b55e3e to your computer and use it in GitHub Desktop.
Save mukeshsolanki/ff7ae4083057bcca216d322d23b55e3e to your computer and use it in GitHub Desktop.
if (move.first == 0 && move.second == -1) {
currentDirection.value = SnakeDirection.Up
} else if (move.first == -1 && move.second == 0) {
currentDirection.value = SnakeDirection.Left
} else if (move.first == 1 && move.second == 0) {
currentDirection.value = SnakeDirection.Right
} else if (move.first == 0 && move.second == 1) {
currentDirection.value = SnakeDirection.Down
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment