summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgroup1 <f16_group1@pbridge.adm.cs.cmu.edu>2016-10-17 00:06:48 -0400
committergroup1 <f16_group1@pbridge.adm.cs.cmu.edu>2016-10-17 00:06:48 -0400
commit841c7607ffab66d208771c220f2e6a9193112234 (patch)
tree8972cee340515fdd81db0c0e86c6f271dc6f1ade
parentDolphin attempt 2, it almost looks good (diff)
downloadbridge-841c7607ffab66d208771c220f2e6a9193112234.tar.zst
Sunrise changes
-rw-r--r--ShowRunner.py2
-rw-r--r--fish_show.py4
-rw-r--r--sunrise.py14
3 files changed, 10 insertions, 10 deletions
diff --git a/ShowRunner.py b/ShowRunner.py
index 0357efd..1ec1c87 100644
--- a/ShowRunner.py
+++ b/ShowRunner.py
@@ -10,7 +10,7 @@ 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)
+ 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!"
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/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)