MCPcopy Index your code
hub / github.com/PySimpleGUI/PySimpleGUI / Ball

Class Ball

DemoPrograms/Demo_Graph_pymunk_2D_Graphics.py:23–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21
22
23class 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
37class Playfield():

Callers 1

add_ballsMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected