This commit is contained in:
parent
024345a17d
commit
f407348d63
1 changed files with 3 additions and 8 deletions
|
@ -146,14 +146,9 @@ class BubaAnimator:
|
||||||
self.log.debug("No animations, sleeping...")
|
self.log.debug("No animations, sleeping...")
|
||||||
sleep(2)
|
sleep(2)
|
||||||
else:
|
else:
|
||||||
while True:
|
for a in random.sample(self.animations, len(self.animations)):
|
||||||
next = random.randint(0, len(self.animations) - 1)
|
self.log.debug(f"Starting animation: {a}")
|
||||||
if next != last:
|
a.run()
|
||||||
break
|
|
||||||
last = next
|
|
||||||
a = self.animations[next]
|
|
||||||
self.log.debug(f"Starting animation: {a}")
|
|
||||||
a.run()
|
|
||||||
|
|
||||||
def add(self, animation, *args, **kwargs):
|
def add(self, animation, *args, **kwargs):
|
||||||
self.animations.append(animation(self.buba, *args, **kwargs))
|
self.animations.append(animation(self.buba, *args, **kwargs))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue