def handle_collisions_paddles(self, display): c1 = display.safe_get(self.x + self.dx * self.dt, self.y) if c1 != Color.black() and c1 != Color.white(): self.dx *= -1 c2 = display.safe_get(self.x, self.y + self.dy * self.dt) if c2 != Color.black() and c2 != Color.white(): self.dy *= -1
def __init__(self, bor): self.set_defaults() self.bor = bor self.palette = [Color.white(), Color.red(), Color.green(), Color.blue(), Color(255,255,0), Color(0,255,255), Color(255,0,255), Color(255,121,0), Color.black()] self.current = Color.blue()
def __init__(self, ctx): self.ctx = ctx self.c = Color.white() self.dt = 0 self.speed = 1 self.reset()