Mercurial > parpg-source
comparison behaviours/player.py @ 48:1bdadb768bcf
Added approach functionality to the BaseBehaviour
author | KarstenBock@gmx.net |
---|---|
date | Thu, 08 Sep 2011 14:20:31 +0200 |
parents | bf506f739322 |
children | 8b1ad2d342d8 |
comparison
equal
deleted
inserted
replaced
47:dd9bd93ec81c | 48:1bdadb768bcf |
---|---|
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 |