コード例 #1
0
 def __init__(self, number, center, radius, velocity, color):
     self.n = number
     self.position = center
     self.radius = radius
     self.velocity = velocity
     self.color = color
     self.edges = calculations.ball_edge_values(self.position, self.radius)
     self.last_hit = self
     self.number_hit = 0
     self.total_hits = 0
コード例 #2
0
 def move(self):
     x, y = self.position
     dx, dy = self.velocity
     self.position = (x + dx, y + dy)
     self.edges = calculations.ball_edge_values(self.position, self.radius)