From 882a9d5a8799016f98a34cba1deae11b3aad8c66 Mon Sep 17 00:00:00 2001 From: group1 Date: Sun, 9 Oct 2016 23:31:23 -0400 Subject: Choose a random hue when a fish is spawned --- bridge.py | 1 + fish_show.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) mode change 100644 => 100755 bridge.py diff --git a/bridge.py b/bridge.py old mode 100644 new mode 100755 index b7e4576..26beb24 --- a/bridge.py +++ b/bridge.py @@ -1,3 +1,4 @@ +#!/usr/bin/python2 from fish_show import FishShow from sunrise import SunriseShow from constants import * diff --git a/fish_show.py b/fish_show.py index 7cd8300..e4f24dd 100644 --- a/fish_show.py +++ b/fish_show.py @@ -147,7 +147,9 @@ class FishShow(Show): self.lights = [Light(x, y, self.bridge.get_light(x, y)) for y in xrange(self.bridge.HEIGHT) for x in xrange(self.bridge.WIDTH)] - self.fish = Fish(0, 0.5, 23, 1.5, color.black, 1) + random_hue = random.random() + fish_color = color.HSV(random_hue, 1, 20/100).to_RGB() + self.fish = Fish(0, 0.5, 23, 1.5, fish_color, 1) def update(self): -- cgit v1.3.1