示例#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()
示例#2
0
文件: water.py 项目: keul/Cheese-Boys
 def _nextRandomWaveTime(self):
     """Return a time value. After this the wave image will be changed"""
     return cbrandom.uniform(0.7, 1.5)
示例#3
0
文件: storm.py 项目: keul/Cheese-Boys
def randomTime():
    return cbrandom.uniform(.2, .4)