예제 #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)