Exemple #1
0
 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
Exemple #2
0
 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()
Exemple #3
0
 def __init__(self, ctx):
     self.ctx = ctx
     self.c = Color.white()
     self.dt = 0
     self.speed = 1
     self.reset()