INNER CODE UNIT · Python
__init__
metafy-social/python-scripts · scripts/Brick-Breaker-Python/main.py:21
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
class Ball:
VEL = 5