Changeset 179:1ee8756888e4 for nagslang


Ignore:
Timestamp:
09/03/13 14:57:09 (8 years ago)
Author:
Neil Muller <drnlmuller@…>
Branch:
default
Phase:
public
Rebase:
31333637623334646666353561373431656332626435383934353261373365303239656436633835
Message:

Add some state manipulation helper methods

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/protagonist.py

    r156 r179  
    188188        self.renderer.start()
    189189
     190    def set_position(self, position):
     191        self._body.position = position
     192
     193    def copy_state(self, old_protagonist):
     194        self._physicsers[self.form].remove_from_space()
     195        self._body.position = old_protagonist._body.position
     196        self.form = old_protagonist.form
     197        self.angle = old_protagonist.angle
     198        self.render_form = old_protagonist.render_form
     199        self.inventory = old_protagonist.inventory
     200        self.renderer = self._renderers[self.render_form]
     201        self._physicsers[self.form].add_to_space()
     202
    190203    def toggle_form(self):
    191204        if self.form == self.WOLF_FORM:
Note: See TracChangeset for help on using the changeset viewer.