comparison behaviours/npc.py @ 55:8b1ad2d342d8

Renamed BaseBehaviour to MovingAgentBehaviour
author KarstenBock@gmx.net
date Fri, 09 Sep 2011 15:05:23 +0200
parents 1bdadb768bcf
children 3f6299f975fe
comparison
equal deleted inserted replaced
54:de09adb7a736 55:8b1ad2d342d8
15 15
16 from random import randrange 16 from random import randrange
17 17
18 from fife import fife 18 from fife import fife
19 19
20 import base 20 import moving
21 from base import BaseBehaviour 21 from moving import MovingAgentBehaviour
22 22
23 class NPCBehaviour(BaseBehaviour): 23 class NPCBehaviour(MovingAgentBehaviour):
24 """This is a basic NPC behaviour""" 24 """This is a basic NPC behaviour"""
25 def __init__(self, parent=None): 25 def __init__(self, parent=None):
26 super(NPCBehaviour, self).__init__() 26 super(NPCBehaviour, self).__init__()
27 27
28 self.parent = parent 28 self.parent = parent
70 @type action: ??? 70 @type action: ???
71 @param action: ??? 71 @param action: ???
72 @return: None""" 72 @return: None"""
73 if self.state == base._AGENT_STATE_WANDER: 73 if self.state == base._AGENT_STATE_WANDER:
74 self.target_loc = self.getTargetLocation() 74 self.target_loc = self.getTargetLocation()
75 BaseBehaviour.onInstanceActionFinished(self, instance, action) 75 MovingAgentBehaviour.onInstanceActionFinished(self, instance, action)
76 76
77 77
78 def idle(self): 78 def idle(self):
79 """Controls the NPC when it is idling. Different actions 79 """Controls the NPC when it is idling. Different actions
80 based on the NPC's state. 80 based on the NPC's state.