projects
/
tabakrolletjie.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Ensure color_pos is always -1 when the lights go out, so behaviour is always consistent
[tabakrolletjie.git]
/
tabakrolletjie
/
lights.py
diff --git
a/tabakrolletjie/lights.py
b/tabakrolletjie/lights.py
index cda60022a5d5aa227d7a9401ad119ca31ff2ba67..22da021bdbe015e156e1b1b2c03118290fe47290 100644
(file)
--- a/
tabakrolletjie/lights.py
+++ b/
tabakrolletjie/lights.py
@@
-159,7
+159,7
@@
class BaseLight(object):
self.colour_pos = colours.index(start_colour)
self.colour = start_colour
self.on = on
self.colour_pos = colours.index(start_colour)
self.colour = start_colour
self.on = on
- if not on
and len(colours) > 1
:
+ if not on:
self.colour_pos = -1
self.intensity = intensity
self.body = pymunk.Body(0, 0, pymunk.body.Body.STATIC)
self.colour_pos = -1
self.intensity = intensity
self.body = pymunk.Body(0, 0, pymunk.body.Body.STATIC)
@@
-294,6
+294,7
@@
class BaseLight(object):
def off(self):
self.on = False
def off(self):
self.on = False
+ self.colour_pos = -1
def toggle(self):
self.colour_pos += 1
def toggle(self):
self.colour_pos += 1