INNER CODE UNIT · Python

set_vel

metafy-social/python-scripts · scripts/Brick-Breaker-Python/main.py:51

    def set_vel(self, x_vel, y_vel):
        self.x_vel = x_vel
        self.y_vel = y_vel

    def draw(self, win):
        pygame.draw.circle(win, self.color, (self.x, self.y), self.radius)


class Brick:
    def __init__(self, x, y, width, height, health, colors):
        self.x = x
        self.y = y
        self.width = width
        self.height = height
        self.health = health
        self.max_health = health
        self.colors = colors
        self.color = colors[0]

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…