diff options
Diffstat (limited to 'fish_types.py')
| -rw-r--r-- | fish_types.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/fish_types.py b/fish_types.py index d37a259..ce15703 100644 --- a/fish_types.py +++ b/fish_types.py @@ -26,6 +26,7 @@ class Fish(object): self.y = 0.5 self.speed = C.Vector(0, 0) self.tailAcceleration = C.Vector(self.tailAccelMag, 0) + self.tailThresholdCurrent = self.tailThreshold self.tailMoving = False self.tailMoveCount = 0 if not hasattr(self, 'theta_scale'): @@ -58,9 +59,11 @@ class Fish(object): return False self.speed += self.drag * self.speed - if abs(self.speed) < self.tailThreshold: + if abs(self.speed) < self.tailThresholdCurrent: self.tailMoving = True - self.tailThreshold = rand_in_range(0.5, 1.4) + self.tailThresholdCurrent = max(rand_in_range( + self.tailThreshold - 0.1, self.tailThreshold + 0.1 + ), 0.0001) self.fix_direction() if self.tailMoveCount > self.tailDuration: self.tailMoveCount = 0 @@ -100,12 +103,12 @@ class Fish(object): class Jellyfish(Fish): color = C.HSV(298/360, 89/100, 53/100).to_RGB() - drag = -0.01 + drag = -0.1 width = 15 height = 1.5 - tailThreshold = 0.001 - tailDuration = 4 - tailAccelMag = 0.001 + tailThreshold = 0.2 + tailDuration = 6 + tailAccelMag = 0.25 class Dolphin(Fish): |
