Ignore:
Timestamp:
09/02/13 16:05:03 (8 years ago)
Author:
Jeremy Thurgood <firxen@…>
Branch:
default
Phase:
public
Message:

A box.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/protagonist.py

    r123 r133  
    44from nagslang.constants import COLLISION_TYPE_PLAYER, ZORDER_MID
    55from nagslang.game_object import (
    6     GameObject, SingleShapePhysicser, FacingImageRenderer)
     6    GameObject, SingleShapePhysicser, FacingImageRenderer, make_body)
    77from nagslang.mutators import FLIP_H
    88from nagslang.resources import resources
     
    3131
    3232    def _setup_physics(self, space, position):
    33         self._body = pymunk.Body(10, pymunk.inf)
    34         self._body.position = position
    35         self._body.velocity_func = self.velocity_func
     33        self._body = make_body(10, pymunk.inf, position, 0.8)
    3634
    3735        self._shapes = {
     
    7169        return obj
    7270
    73     def velocity_func(self, body, gravity, damping, dt):
    74         return pymunk.Body.update_velocity(body, gravity, self.damping, dt)
    75 
    7671    def get_render_angle(self):
    7772        return self.angle
     
    8479        self._body.velocity_limit = 1000
    8580        self.impulse_factor = 4000
    86         self.damping = 0.9
     81        self._body.damping = 0.9
    8782        self.renderer = self._renderers[self.form]
    8883
     
    9489        self._body.velocity_limit = 1000
    9590        self.impulse_factor = 500
    96         self.damping = 0.8
     91        self._body.damping = 0.8
    9792        self.renderer = self._renderers[self.form]
    9893
Note: See TracChangeset for help on using the changeset viewer.