Ejemplo n.º 1
0
    def __init__(self, bead_set, color=_color.Color(), direction=1, **kwargs):
        super().__init__(name="cop_lights",
                         bead_set=bead_set,
                         color=color,
                         **kwargs)

        self.bin = bin.Bin(bead_set, rosary=self.rosary)
        self.bin.add_effect_object(
            looper.Looper(bead_set, color=_color.Color(1, 0, 0), length=6))
        self.bin.add_effect_object(
            looper.Looper(bead_set,
                          color=_color.Color(1, 0, 0),
                          length=6,
                          speed=-0.5))
        self.bin.add_effect_object(
            looper.Looper(bead_set,
                          color=_color.Color(0, 0, 1),
                          length=6,
                          speed=-0.5,
                          start_offset=20))
        self.bin.add_effect_object(
            looper.Looper(bead_set,
                          color=_color.Color(0, 0, 1),
                          length=6,
                          start_offset=20))
        self.bin.add_effect_object(
            strobe.Strobe(bead_set, color=_color.Color(1, 1, 1)))
Ejemplo n.º 2
0
    def __init__(self, bead_set, color=_color.Color(), **kwargs):
        super().__init__(name="bin_demo", bead_set=bead_set, color=color, **kwargs)

        self.count = 0
        self.bin = bin.Bin(bead_set, rosary=self.rosary)
        #self.bin = bin.Bin(bead_set)
        self.looper1 = looper.Looper(bead_set, color=_color.Color(1, 0, 0), length=5, speed=0)
        self.bin.add_effect_object(self.looper1)
        self.bin.add_effect_object(looper.Looper(bead_set, color=_color.Color(0, 1, 0), length=4, speed=-.5))
        self.bin.add_effect_object(sparkle.Sparkle(bead_set, color=_color.Color(1, 1, 1)))
        self.speed_increment = .02
    def __init__(self, bead_set, color=_color.Color(), **kwargs):
        bead_set = kwargs.get('rosary').set_registry['ring']
        super().__init__(name="trigger_hijack_demo",
                         bead_set=bead_set,
                         color=color,
                         **kwargs)

        # This effect uses 2 separate effects, so let's copy bin_demo.py
        self.bin = bin.Bin(bead_set, rosary=self.rosary)

        # If this were a game, this would be "the ball"
        self.red_looper = looper.Looper(bead_set=bead_set,
                                        color=_color.Color(1, 0, 0),
                                        **kwargs)
        self.bin.add_effect_object(self.red_looper)

        # Specifically, if this were pong, these might be the "paddles"
        self.hijacked_beads = set_color.SetColor(bead_set=frozenset(
            [self.rosary.beads[11], self.rosary.beads[25]]),
                                                 color=_color.Color(1, 1, 1),
                                                 **kwargs)
        self.bin.add_effect_object(self.hijacked_beads)

        # NOTE: THIS IS THE MAIN ATTRACTION HERE!!!
        self.trigger_hijacks = {
            'left_nail': self.left_hijack,
            'right_nail': self.right_hijack
        }
        # The base Effect class will check self.trigger_hijacks and
        # modify the rosary's behavior
        self.hijack_triggers()
Ejemplo n.º 4
0
    def __init__(self, bead_set, color=_color.Color(), direction=1, **kwargs):
        super().__init__(name="roulette",
                         bead_set=bead_set,
                         color=color,
                         **kwargs)

        #ring_set = self.rosary.set_registry('ring') & bead_set
        length = 2

        self.bin = bin.Bin(bead_set, rosary=self.rosary)
        self.wheel = wheel.Wheel(
            bead_set,
            colors=[_color.Color(1, 0, 0),
                    _color.Color(0, 0, 0)],
            length=length,
            speed=0)
        self.looper = looper.Looper(bead_set,
                                    color=_color.Color(0, 1, 0),
                                    length=length,
                                    speed=0,
                                    start_offset=1)
        self.bin.add_effect_object(self.wheel)
        self.bin.add_effect_object(self.looper)

        self.set_speed(0.5)
Ejemplo n.º 5
0
    def __init__(self,
                 bead_set,
                 color=color.Color(),
                 speed=1,
                 length=1,
                 start_offset=0,
                 **kwargs):
        super().__init__(name="launcher",
                         bead_set=bead_set,
                         color=color,
                         **kwargs)

        self.my_bead_set = bead_set
        self.looper = looper.Looper(bead_set,
                                    color=color,
                                    speed=speed,
                                    length=length,
                                    **kwargs)
        self.in_stem = True