Skip to content

Instantly share code, notes, and snippets.

@stephengruppetta
Created November 17, 2023 22:55
Show Gist options
  • Save stephengruppetta/34fc252ffe12af556a6f88acf12bc99d to your computer and use it in GitHub Desktop.
Save stephengruppetta/34fc252ffe12af556a6f88acf12bc99d to your computer and use it in GitHub Desktop.
# dot.py
import turtle
import random
class Dot(turtle.Turtle):
DOT_COLOURS = "#fdb33b", "#6d227a", "#fff3e6"
def __init__(self, x, y):
super().__init__()
self.shape("circle")
self.color(random.choice(self.DOT_COLOURS))
self.penup()
self.setposition(x, y)
self.setheading(-90)
self.dot_speed = 1
def fall(self):
self.forward(self.dot_speed)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment