INNER CODE UNIT · Python

Paddle

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

class Paddle:
    VEL = 5

    def __init__(self, x, y, width, height, color):
        self.x = x
        self.y = y
        self.width = width
        self.height = height
        self.color = color

    def draw(self, win):
        pygame.draw.rect(
            win, self.color, (self.x, self.y, self.width, self.height))

    def move(self, direction=1):
        self.x = self.x + self.VEL * direction


View source record →

📰 Research Paper
Loading…
⏳ Fetching content…