| 21 | |
| 22 | |
| 23 | class Ball(): |
| 24 | def __init__(self, x, y, r, *args, **kwargs): |
| 25 | mass = 10 |
| 26 | # Create a Body with mass and moment |
| 27 | self.body = pymunk.Body( |
| 28 | mass, pymunk.moment_for_circle(mass, 0, r, (0, 0))) |
| 29 | self.body.position = x, y |
| 30 | # Create a box shape and attach to body |
| 31 | self.shape = pymunk.Circle(self.body, r, offset=(0, 0)) |
| 32 | self.shape.elasticity = 0.99999 |
| 33 | self.shape.friction = 0.8 |
| 34 | self.gui_circle_figure = None |
| 35 | |
| 36 | |
| 37 | class Playfield(): |