Загрузка данных


def spawn_asteroid(self):
    x = random.randint(20, WIDTH - 20)
    size = ASTEROID_SIZE
    colors = ['red', 'orange', 'yellow', 'green', 'blue', 'purple', 'pink', 'cyan']
    color = random.choice(colors)
    asteroid = self.canvas.create_polygon(
        x + size//2, -size,
        x + size//3, -size//3,
        x, 0,
        x + size//2, -size//4,
        x + size, 0,
        x + size*2//3, -size//3,
        fill=color
    )
    self.asteroids.append(asteroid)