def entry_actions(self, old_state_name): if old_state_name=='hunting': # I passed from hunting to exploring; may be that the enemy is gone outside the sight: keep max speed for now! self.character.speed = self.character.maxSpeed else: # "Relaxed" enemy never run... ;-) self.character.speed = self.character.maxSpeed * cbrandom.uniform(0.3, 0.6) if not self.character.navPoint: self._chooseRandomDestination()
def _nextRandomWaveTime(self): """Return a time value. After this the wave image will be changed""" return cbrandom.uniform(0.7, 1.5)
def randomTime(): return cbrandom.uniform(.2, .4)