Made an epic showcase website and API!
This commit is contained in:
parent
9e21e4dbdd
commit
1907fad7c5
89 changed files with 36444 additions and 3 deletions
18
projects/Day 21/food.py
Normal file
18
projects/Day 21/food.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
from turtle import Turtle
|
||||
import random
|
||||
|
||||
|
||||
class Food(Turtle):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.shape("circle")
|
||||
self.penup()
|
||||
self.shapesize(stretch_len=0.5, stretch_wid=0.5)
|
||||
self.color("red")
|
||||
self.speed("fastest")
|
||||
self.refresh()
|
||||
|
||||
def refresh(self):
|
||||
random_x = random.randint(-280, 280)
|
||||
random_y = random.randint(-280, 255)
|
||||
self.goto(random_x, random_y)
|
||||
Loading…
Add table
Add a link
Reference in a new issue