summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sunrise.py9
-rwxr-xr-xtwinkle.py6
2 files changed, 6 insertions, 9 deletions
diff --git a/sunrise.py b/sunrise.py
index 4956342..ebdabde 100644
--- a/sunrise.py
+++ b/sunrise.py
@@ -21,7 +21,7 @@ class Sun(object):
def update(self):
"""Swim gently to the other side of the bridge."""
- self.y += 0.005
+ self.y += 0.003
if self.y + self.height >= 3:
self.y = 3 - self.height
elif self.y + self.height > 1:
@@ -104,9 +104,9 @@ class SunriseShow(Show):
def update(self):
- if self.tick_count > 1000:
+ if self.tick_count > FRAME_RATE * 90:
fade_time = 3 # sec
- if self.tick_count > 1000 + fade_time * FRAME_RATE:
+ if self.tick_count > FRAME_RATE * 90 + fade_time * FRAME_RATE:
self.stop()
return
for light in self.lights:
@@ -118,10 +118,9 @@ class SunriseShow(Show):
light.update(self.sky_brightness, self.sun)
if self.sky_brightness < 1:
- self.sky_brightness += 0.05 / FRAME_RATE
+ self.sky_brightness += 0.03 / FRAME_RATE
self.tick_count += 1
- print self.tick_count
def compute_coverage(fish, x, y):
diff --git a/twinkle.py b/twinkle.py
index 6c788e9..3668b3c 100755
--- a/twinkle.py
+++ b/twinkle.py
@@ -95,9 +95,9 @@ class TwinkleShow(Show):
def update(self):
- if self.tick_count > 1000:
+ if self.tick_count > FRAME_RATE * 90:
fade_time = 3 # sec
- if self.tick_count > 1000 + fade_time * FRAME_RATE:
+ if self.tick_count > FRAME_RATE * 90 + fade_time * FRAME_RATE:
self.stop()
return
for col in self.lights:
@@ -105,7 +105,6 @@ class TwinkleShow(Show):
light.fade_to_black(fade_time * FRAME_RATE)
else:
if random.random() < 0.01:
- print "Adding star"
self.stars.add(ShootingStar())
for col in self.lights:
for light in col:
@@ -125,7 +124,6 @@ class TwinkleShow(Show):
light.blit()
self.tick_count += 1
- print self.tick_count
def compute_coverage(fish, x, y):