INNER CODE UNIT · Python
move
metafy-social/python-scripts · scripts/Brick-Breaker-Python/main.py:32
def move(self, direction=1):
self.x = self.x + self.VEL * direction
class Ball:
VEL = 5
def __init__(self, x, y, radius, color):
self.x = x
self.y = y
self.radius = radius
self.color = color
self.x_vel = 0
self.y_vel = -self.VEL
def move(self):
self.x += self.x_vel
self.y += self.y_vel