Hides the old snake and creates a new one for restarting the game.
(self)
| 44 | self.head.forward(MOVE_DISTANCE) |
| 45 | |
| 46 | def reset(self): |
| 47 | """Hides the old snake and creates a new one for restarting the game.""" |
| 48 | for segment in self.segments: |
| 49 | segment.hideturtle() |
| 50 | self.segments.clear() |
| 51 | self.create_snake() |
| 52 | self.head = self.segments[0] |
| 53 | |
| 54 | def up(self): |
| 55 | """Turns the snake's head upwards, preventing it from reversing.""" |
no test coverage detected