comparison src/parpg/behaviours/player.py @ 75:c3350fc9cd45

Added approach functionality to the BaseBehaviour
author KarstenBock@gmx.net
date Thu, 08 Sep 2011 14:20:31 +0200
parents 58661f5b2f6b
children 7cb53edfb95f
comparison
equal deleted inserted replaced
74:47e1345fbac2 75:c3350fc9cd45
22 self.parent = parent 22 self.parent = parent
23 self.idle_counter = 1 23 self.idle_counter = 1
24 self.speed = 0 24 self.speed = 0
25 self.nextAction = None 25 self.nextAction = None
26 self.agent = None 26 self.agent = None
27
28 def onInstanceActionFinished(self, instance, action):
29 """@type instance: ???
30 @param instance: ???
31 @type action: ???
32 @param action: ???
33 @return: None"""
34 # First we reset the next behavior
35 act = self.nextAction
36 self.nextAction = None
37 self.idle()
38
39 if act:
40 act.execute()
41
42 if(action.getId() != 'stand'):
43 self.idle_counter = 1
44 else:
45 self.idle_counter += 1