Beispiel #1
0
def roman_candle_fountain(start_col=16,
                          width=8,
                          color=(255, 0, 0),
                          border_color=(0, 255, 0),
                          border_thickness=4,
                          height=30):
    forward_cols = map(lambda col: col % STATE.layout.columns,
                       range(start_col, start_col + width))
    backward_cols = forward_cols[::-1]  # reverse

    sequence = forward_cols + backward_cols

    #+ forward_cols + backward_cols

    # print "forward_cols", forward_cols
    # print "backward_cols", backward_cols
    # print "sequence", sequence

    def make_line((i, col)):
        return RisingLine(height=height,
                          start_col=col,
                          delay=i * 100,
                          color=color,
                          border_color=border_color,
                          border_thickness=border_thickness)

    effects = map(make_line, enumerate(sequence))

    return MultiEffect(*effects)
Beispiel #2
0
def fzero_fountain(start_col=16,
                   color=(0, 255, 255),
                   border_color=(255, 0, 0),
                   border_thickness=10,
                   height=50):
    """
        F-Zero Launcher - make a f-zero speed boost arrow around the start_col
        """
    # get 5 pixels to either side to select the 11 columns in this section
    cols = map(lambda c: c % STATE.layout.columns,
               range(start_col - 5, start_col + 5 + 1))

    # group them by levels to make an f-zero speed boost arrow
    levels = [[cols[5]], [cols[4], cols[6]], [cols[3], cols[7]],
              [cols[2], cols[8]], [cols[1], cols[9]], [cols[0], cols[10]]]

    def make_line((i, col)):
        # fade the colors on the edges
        def get_color():
            hsv = colorsys.rgb_to_hsv(color[0] // 255, color[1] // 255,
                                      color[2] // 255)
            rgb = colorsys.hsv_to_rgb(hsv[0], hsv[1], hsv[2] - (i * 0.12))
            return (rgb[0] * 255, rgb[1] * 255, rgb[2] * 255)

        return RisingLine(height=height,
                          start_col=col,
                          delay=i * 80,
                          color=get_color(),
                          border_color=border_color,
                          border_thickness=border_thickness)

    effects = map(make_line, enumerate(levels))

    return MultiEffect(*effects)
Beispiel #3
0
def around_the_world_fountain(start_col=16,
                              color=(0, 255, 0),
                              border_color=(255, 0, 0),
                              border_thickness=6,
                              height=18,
                              reverse=True):
    """
    Arround the world launcher - shoot small lines all the way around the gazebo

    Define border_color and border_thickness to add a border.
    The border will be drawn *inside* the height, so make sure
    2*border_thickness < height
    """

    # [0, ..., 65]
    all_cols = range(0, STATE.layout.columns)
    # [start_col, ..., 65, 0, ..., start_col - 1]
    shifted = np.roll(all_cols, -start_col)

    if reverse:
        shifted = shifted[::-1]  # reverse

    # print "start_col", start_col
    # print "shifted", shifted

    def make_line((i, col)):
        return RisingLine(height=height,
                          start_col=col,
                          delay=i * 30,
                          color=color,
                          border_color=border_color,
                          border_thickness=border_thickness,
                          ceil=50)

    effects = map(make_line, enumerate(shifted))

    return MultiEffect(*effects)