Esempio n. 1
0
 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()
Esempio n. 2
0
 def _nextRandomWaveTime(self):
     """Return a time value. After this the wave image will be changed"""
     return cbrandom.uniform(0.7, 1.5)
Esempio n. 3
0
def randomTime():
    return cbrandom.uniform(.2, .4)