Mercurial > parpg-core
comparison src/parpg/behaviours/npc.py @ 75:c3350fc9cd45
Added approach functionality to the BaseBehaviour
author | KarstenBock@gmx.net |
---|---|
date | Thu, 08 Sep 2011 14:20:31 +0200 |
parents | 47e1345fbac2 |
children | 7cb53edfb95f |
comparison
equal
deleted
inserted
replaced
74:47e1345fbac2 | 75:c3350fc9cd45 |
---|---|
64 | 64 |
65 def onInstanceActionFinished(self, instance, action): | 65 def onInstanceActionFinished(self, instance, action): |
66 """What the NPC does when it has finished an action. | 66 """What the NPC does when it has finished an action. |
67 Called by the engine and required for InstanceActionListeners. | 67 Called by the engine and required for InstanceActionListeners. |
68 @type instance: fife.Instance | 68 @type instance: fife.Instance |
69 @param instance: self.agent (the NPC listener is listening for this | 69 @param instance: self.agent |
70 instance) | |
71 @type action: ??? | 70 @type action: ??? |
72 @param action: ??? | 71 @param action: ??? |
73 @return: None""" | 72 @return: None""" |
74 if self.state == base._AGENT_STATE_WANDER: | 73 if self.state == base._AGENT_STATE_WANDER: |
75 self.target_loc = self.getTargetLocation() | 74 self.target_loc = self.getTargetLocation() |
76 self.idle() | 75 BaseBehaviour.onInstanceActionFinished(self, instance, action) |
77 | 76 |
78 | 77 |
79 def idle(self): | 78 def idle(self): |
80 """Controls the NPC when it is idling. Different actions | 79 """Controls the NPC when it is idling. Different actions |
81 based on the NPC's state. | 80 based on the NPC's state. |