Created
October 5, 2023 10:08
-
-
Save cgawron/07cad639db0444db74f8864e81a2a9da to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# goes through right boundary | |
if self.head.x > self.w - BLOCK_SIZE: | |
self.head = Point(0, self.head.y) | |
# goes through left boundary | |
elif self.head.x < 0: | |
self.head = Point(self.w - BLOCK_SIZE, self.head.y) | |
# goes through bottom boundary | |
elif self.head.y > self.h - BLOCK_SIZE: | |
self.head = Point(self.head.x, 0) | |
# goes through top boundary | |
elif self.head.y < 0: | |
self.head = Point(self.head.x, self.h - BLOCK_SIZE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment