# HG changeset patch # User Jeremy Thurgood # Date 1378244571 -7200 # Node ID 3d54fe7a29987c67c50b496816198aeb941770f2 # Parent 42e8993c31fd7022602189476fe3f1ab6459aa2e Fun with mass and friction. diff -r 42e8993c31fd -r 3d54fe7a2998 nagslang/enemies.py --- a/nagslang/enemies.py Tue Sep 03 23:33:44 2013 +0200 +++ b/nagslang/enemies.py Tue Sep 03 23:42:51 2013 +0200 @@ -42,12 +42,12 @@ self._direction = 'away' def _setup_physics(self, space, position): - self._body = make_body(5, pymunk.inf, position, 0.8) + self._body = make_body(10, pymunk.inf, position, 0.8) self._shape = pymunk.Circle(self._body, 30) self._shape.elasticity = 1.0 - self._shape.friction = 10.0 + self._shape.friction = 0.05 self._shape.collision_type = COLLISION_TYPE_ENEMY self._physicser = SingleShapePhysicser(space, self._shape) self.impulse_factor = 50 diff -r 42e8993c31fd -r 3d54fe7a2998 nagslang/game_object.py --- a/nagslang/game_object.py Tue Sep 03 23:33:44 2013 +0200 +++ b/nagslang/game_object.py Tue Sep 03 23:42:51 2013 +0200 @@ -216,6 +216,7 @@ body = make_body(10, 10000, position, damping=0.5) self.shape = pymunk.Poly( body, [(-20, -20), (20, -20), (20, 20), (-20, 20)]) + self.shape.friction = 0.5 self.shape.collision_type = COLLISION_TYPE_BOX super(Box, self).__init__( SingleShapePhysicser(space, self.shape), diff -r 42e8993c31fd -r 3d54fe7a2998 nagslang/protagonist.py --- a/nagslang/protagonist.py Tue Sep 03 23:33:44 2013 +0200 +++ b/nagslang/protagonist.py Tue Sep 03 23:42:51 2013 +0200 @@ -42,10 +42,11 @@ self._body, [(-15, -30), (15, -30), (15, 30), (-15, 30)]), self.WOLF_FORM: pymunk.Circle(self._body, 30), } + self._shapes[self.HUMAN_FORM].friction = 1.0 + self._shapes[self.WOLF_FORM].friction = 0.05 self._physicsers = {} for form, shape in self._shapes.iteritems(): shape.elasticity = 1.0 - shape.friction = 10.0 shape.collision_type = COLLISION_TYPE_PLAYER self._physicsers[form] = SingleShapePhysicser(space, shape) self.angle = 0