summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ShowRunner.py4
-rw-r--r--fish_show.py4
-rw-r--r--fish_types.py6
-rw-r--r--sunrise.py14
4 files changed, 14 insertions, 14 deletions
diff --git a/ShowRunner.py b/ShowRunner.py
index 5fa46e7..61c0cf6 100644
--- a/ShowRunner.py
+++ b/ShowRunner.py
@@ -11,9 +11,9 @@ from run import server_thread, send_queue, recv_queue
def run_show():
server_thread.start()
bridge = Bridge()
- #SunriseShow(bridge, send_queue=recv_queue, recv_queue=send_queue).run(framerate=FRAME_RATE)
- #FishShow(bridge, send_queue=recv_queue, recv_queue=send_queue).run(framerate=FRAME_RATE)
TwinkleShow(bridge, send_queue=recv_queue, recv_queue=send_queue).run(framerate=FRAME_RATE)
+ SunriseShow(bridge, send_queue=recv_queue, recv_queue=send_queue).run(framerate=FRAME_RATE)
+ FishShow(bridge, send_queue=recv_queue, recv_queue=send_queue).run(framerate=FRAME_RATE)
print "done!"
run_show()
diff --git a/fish_show.py b/fish_show.py
index 6abf3bc..2894863 100644
--- a/fish_show.py
+++ b/fish_show.py
@@ -58,7 +58,9 @@ def compute_coverage(fish, x, y):
min_y = min(max(y, fish.y), y + 1)
max_y = max(min(y+1, fish.y + fish.height), y)
coverage = (max_x - min_x) * (max_y - min_y)
- return coverage * scale * fish.alpha_at(x, y)
+ if fish.is_diamond:
+ return coverage * scale
+ return coverage * fish.alpha_at(x, y)
def pick_HSV(depth):
diff --git a/fish_types.py b/fish_types.py
index 6d24675..1f50104 100644
--- a/fish_types.py
+++ b/fish_types.py
@@ -117,7 +117,7 @@ class Dolphin(Fish):
width = 35
height = 1.5
tailThreshold = 0.7
- tailDuration = 2
+ tailDuration = 4
tailAccelMag = 0.4
gravity = C.Vector(0, -0.01)
@@ -128,11 +128,11 @@ class Dolphin(Fish):
return False
if not self.direction_fixed:
- self.tailAcceleration = self.tailAcceleration.rot2d(math.pi / 32)
+ self.tailAcceleration = self.tailAcceleration.rot2d(math.pi / 30)
self.direction_fixed = True
self.speed += self.drag * self.speed + self.gravity
- if self.y <= 0.25:
+ if self.y <= 0.4:
self.tailMoving = True
if self.tailMoveCount > self.tailDuration:
self.tailMoveCount = 0
diff --git a/sunrise.py b/sunrise.py
index 4956342..fc235ed 100644
--- a/sunrise.py
+++ b/sunrise.py
@@ -140,12 +140,10 @@ def compute_coverage(fish, x, y):
def pick_ocean_HSV(sky_brightness):
"""Return a random color in an appropriate interval."""
- min_hue = 236 / 360
- max_hue = 250 / 360
- min_sat = 0.25
- max_sat = 0.6
- hue = random.random() * (max_hue - min_hue) + min_hue
- saturation = random.random() * (max_sat - min_sat) + min_sat
+ min_hue = constants.MIN_HUE
+ min_saturation = constants.MIN_SATURATION
+ hue = random.random() * (constants.MAX_HUE - min_hue) + min_hue
+ saturation = random.random() * (MAX_SATURATION - min_saturation) + min_saturation
return color.HSV(hue, saturation, sky_brightness)
@@ -161,8 +159,8 @@ def transition(start, end, step):
def random_change():
"""Return a random amount that a light should change each frame."""
- min_time = int(2 * FRAME_RATE)
- max_time = int(6 * FRAME_RATE)
+ min_time = int(constants.MIN_TIME * FRAME_RATE)
+ max_time = int(MAX_TIME * FRAME_RATE)
return 1 / random.randint(min_time, max_time)