MCPcopy Index your code
hub / github.com/geekcomputers/Python / __init__

Method __init__

Snake Game Using Turtle/food.py:12–18  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

10class Food(Turtle):
11 """ This class generates food for the snake to eat. """
12 def __init__(self):
13 super().__init__()
14 self.shape("circle")
15 self.penup()
16 self.shapesize(stretch_len=0.7, stretch_wid=0.7)
17 self.color(colors.FOOD_COLOR)
18 self.speed("fastest")
19
20 def refresh(self, left_wall, right_wall, bottom_wall, top_wall):
21 """Moves the food to a new random position within the provided game boundaries."""

Callers

nothing calls this directly

Calls 2

colorMethod · 0.80
speedMethod · 0.80

Tested by

no test coverage detected