Exemplo n.º 1
0
 def new_rectangular_obstacle (self):
     o = RectangularObstacle ((float (self.new_obstacle_dim0.get ()),
         float (self.new_obstacle_dim1.get ())))
     o.pos = (5, -5)
     o.angle = 0
     self.area_view.area.table.obstacles.append (o)
     self.update ()
Exemplo n.º 2
0
 def add_plate (pos, color):
     plate = RectangularObstacle ((170, 170), 0)
     plate.pos = pos
     plate.angle = 0
     plate.cherries = [ ]
     self.plates.append (plate)
     cpos = ((-42, -42), (-42, 0), (-42, +42), (0, -21), (0, 21),
             (42, -42), (42, 0), (42, +42))
     ccol = [ color ] + 7 * [ None ]
     random.shuffle (ccol)
     for p, c in zip (cpos, ccol):
         cherry = RoundObstacle (20, 0)
         cherry.pos = p
         cherry.color = c
         plate.cherries.append (cherry)
Exemplo n.º 3
0
 def add_gold_bar (pos, angle, level = 1):
     gold_bar = RectangularObstacle ((150, 70), level)
     gold_bar.pos = pos
     gold_bar.angle = angle
     gold_bar.value = 3
     self.gold_bars.append (gold_bar)