Skip to content

Commit

Permalink
adjust formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
labuzm committed Sep 29, 2020
1 parent 4ac5dbd commit 4c0fc9b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions demos/physics4/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def __init__(self):
BodyNode(
shape=Circle(50),
body_type=BodyNodeType.static,
color = Color.from_int(196, 196, 196, 255)
color=Color.from_int(196, 196, 196, 255)
)
)
self.attractor.add_child(HitboxNode(shape=self.attractor.shape))
Expand All @@ -36,20 +36,19 @@ def __init__(self):
sprite=image,
angular_velocity=5,
velocity=Vector(30, 15),
position = Vector(-512, -384) + offset,
position=Vector(-512, -384) + offset,
shape=Polygon.from_box(Vector(10, 10)),
)
node.add_child(HitboxNode(shape=node.shape))
self.space.add_child(node)
self.nodes.append(node)


def update(self, dt):
for event in self.input.events():
if event.keyboard_key:
if event.keyboard_key.key_down == Keycode.q:
self.engine.quit()

for node in self.nodes:
distance_vector = self.attractor.position - node.position
distance = distance_vector.length()
Expand All @@ -62,3 +61,4 @@ def update(self, dt):
if __name__ == '__main__':
with Engine(virtual_resolution=Vector(1024, 768)) as engine:
engine.run(MainScene())

0 comments on commit 4c0fc9b

Please sign in to comment.