changeset 208:3d54fe7a2998

Fun with mass and friction.
author Jeremy Thurgood <firxen@gmail.com>
date Tue, 03 Sep 2013 23:42:51 +0200
parents 42e8993c31fd
children ad1d3de210cd
files nagslang/enemies.py nagslang/game_object.py nagslang/protagonist.py
diffstat 3 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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),
--- 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