Ignore:
Timestamp:
09/04/13 12:53:37 (8 years ago)
Author:
Jeremy Thurgood <firxen@…>
Branch:
default
Phase:
public
Message:

Composition-based renderers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/game_object.py

    r216 r217  
    4343    def get_angle(self):
    4444        return self.get_shape().body.angle
     45
     46    def get_velocity(self):
     47        return self.get_shape().body.velocity
    4548
    4649    def _get_position(self):
     
    147150        self.renderer.animate()
    148151
     152    def is_moving(self):
     153        """Returns `True` if this object is moving.
     154
     155        This is mostly for movement-based animation renderers to look at.
     156        """
     157        return self.physicser.get_velocity().length > 0
     158
    149159    def collide_with_protagonist(self):
    150160        """Called as a `pre_solve` collision callback with the protagonist.
Note: See TracChangeset for help on using the changeset viewer.