示例#1
0
    def __init__(self, number, color, center, radius, velocity):
        w_size                  = globals.window_size()
        self.number             = number
        self.color              = color
        self.start_color        = color

        self.position     = Coordinate(center)
        self.radius       = Coordinate((radius,radius))
        self.velocity     = Coordinate(velocity)
        self.edges        = calculate.edge_values(self.position.rel, self.radius.rel)
        self.walls_hit    = calculate.walls_hit(self.edges)
        self.text_position= calculate.ball_text_position(str(self.number), globals.font(), self.position.abs, w_size)
示例#2
0
 def _setup_font():
     return globals.font()
示例#3
0
 def _get_ball_text_position(self):
     for ball in self.balls:
         text = str(ball.number)
         ball.text_position = Coordinate(calculate.ball_text_position(text, globals.font(), ball.position.abs, globals.window_size()), globals.window_size())