Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from turtle import Turtle
- import random
- class Food(Turtle):
- def __init__(self):
- super().__init__()
- self.shape("circle")
- self.penup()
- self.shapesize(stretch_wid=0.5, stretch_len=0.5)
- self.color("blue")
- self.speed(0)
- self.refresh()
- def refresh(self):
- random_x = random.randint(-275, 275)
- random_y = random.randint(-275, 275)
- self.goto(random_x, random_y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement