Compare commits
3 Commits
1c6ac6e811
...
1790f13849
Author | SHA1 | Date |
---|---|---|
rhiannon morris | 1790f13849 | |
rhiannon morris | 97e989bd40 | |
rhiannon morris | 13ea04c3e1 |
19
__init__.py
19
__init__.py
|
@ -84,9 +84,10 @@ class Quox(Application):
|
|||
self.clear(ctx)
|
||||
# self.text(ctx)
|
||||
self.quox_sprite(ctx)
|
||||
self.update_leds()
|
||||
|
||||
def clear(self, ctx):
|
||||
ctx.rgb(0, 0, 0) \
|
||||
ctx.rgb(0, .1, .15) \
|
||||
.rectangle(-120, -120, 240, 240) \
|
||||
.fill()
|
||||
|
||||
|
@ -118,7 +119,6 @@ class Quox(Application):
|
|||
self.pick_direction()
|
||||
self.pick_step()
|
||||
self.maybe_move()
|
||||
self.update_leds()
|
||||
|
||||
def add_boxes(self, state):
|
||||
for i, button in enumerate(state.captouch.petals):
|
||||
|
@ -212,14 +212,13 @@ class Quox(Application):
|
|||
return self.towards(self.direction, self.target())
|
||||
|
||||
def update_leds(self):
|
||||
leds.set_all_rgb(0, 0, 0)
|
||||
for i in range(10):
|
||||
if i in self.boxes:
|
||||
center = i * 4
|
||||
left = (center - 1) % 40
|
||||
right = (center + 1) % 40
|
||||
for led in [left, right, center]:
|
||||
leds.set_hsv(led, ((i + 4) * 36) % 360, 1, 1)
|
||||
leds.set_all_hsv(0, 0, 1)
|
||||
for i in self.boxes:
|
||||
center = i * 4
|
||||
left = (center - 1) % 40
|
||||
right = (center + 1) % 40
|
||||
for led in [left, right, center]:
|
||||
leds.set_hsv(led, ((i + 4) * 36) % 360, 1, 1)
|
||||
leds.update()
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[app]
|
||||
name = "stompy quox"
|
||||
menu = "Badge"
|
||||
menu = "Apps"
|
||||
|
||||
[entry]
|
||||
class = "Quox"
|
||||
|
@ -9,3 +9,5 @@ class = "Quox"
|
|||
author = "niss"
|
||||
license = "just do whatever."
|
||||
url = "https://git.rhiannon.website/rhi/qflow3r"
|
||||
description = "a dragon wandering around your badge. press the petals to make it ollow"
|
||||
version = 1
|
||||
|
|
Loading…
Reference in New Issue