Пример #1
0
 def draw_collisions(self):
     x1, y1 = self.body.local_to_world(self.segment.a)
     x2, y2 = self.body.local_to_world(self.segment.b)
     draw.line(x1, y1, x2, y2)
     r = self.circle.radius
     x, y = self.body.local_to_world(self.circle.center)
     draw.ellipse_outline(x-r, y-r, x+r, y+r)
Пример #2
0
 def draw_collisions(self):
     if self.line_length != 0:
         x1, y1 = self.gluebody.body.local_to_world(self.segment.a)
         x2, y2 = self.gluebody.body.local_to_world(self.segment.b)
         draw.line(x1, y1, x2, y2)
     if self.circle2_rad > 0:
         r = self.circle2.radius
         x, y = self.gluebody.body.local_to_world(self.circle2.center)
         draw.ellipse_outline(x-r, y-r, x+r, y+r)
     r = self.circle.radius
     x, y = self.gluebody.body.local_to_world(self.circle.center)
     draw.ellipse_outline(x-r, y-r, x+r, y+r)
Пример #3
0
 def draw_collisions(self):
     if self.physically_closed:
         draw.line(self.x, self.y, self.x2, self.y2)
Пример #4
0
 def draw_collisions(self):
     for line in self.lines:
         draw.line(line.a.x, line.a.y, line.b.x, line.b.y)