Пример #1
0
def demo(screen):
    effects = [
        RandomNoise(screen,
                    signal=Rainbow(screen,
                                   FigletText("DAN  IS  THE  MAN!")))
    ]
    screen.play([Scene(effects, -1)], stop_on_resize=True)
Пример #2
0
    def test_noise(self):
        """
        Check that RandomNoise works.
        """
        # Check that RandomNoise updates every frame.
        screen = MagicMock(spec=Screen, colours=8, unicode_aware=False)
        canvas = Canvas(screen, 10, 40, 0, 0)
        effect = RandomNoise(canvas)
        effect.reset()
        self.assert_blank(canvas)
        my_buffer = [[(32, 7, 0, 0) for _ in range(40)] for _ in range(10)]
        for i in range(20):
            effect.update(i)
            self.assertEqual(self.check_canvas(
                canvas,
                my_buffer,
                lambda value: self.assertLess(value[0], 129)),
                True)

        # Check there is no stop frame by default.
        self.assertEqual(effect.stop_frame, 0)

        # This effect should ignore events.
        event = object()
        self.assertEqual(event, effect.process_event(event))
Пример #3
0
def demo(screen):
    effects = [
        RandomNoise(screen,
                    signal=Rainbow(screen,
                                   FigletText("ASCIIMATICS")))
    ]
    screen.play([Scene(effects, -1)], stop_on_resize=True)
    # Draw a large with a smaller rectangle hole in the middle.
    screen.fill_polygon([[(60, 0), (70, 0), (70, 10), (60, 10)],
                     [(63, 2), (67, 2), (67, 8), (63, 8)]])
Пример #4
0
def panic_demo(screen):
    scenes = []

    effects = [
        RandomNoise(screen, signal=Rainbow(screen, FigletText("Help!"))),
        Print(screen,
              FigletText("Panic!", "banner3"), (screen.height - 4) // 2,
              colour=Screen.COLOUR_MAGENTA,
              speed=1,
              stop_frame=30),
    ]
    scenes.append(Scene(effects, -1))
    screen.play(scenes, stop_on_resize=True, repeat=False)
Пример #5
0
def suspense(screen):
    # Leer xlsx y seleccionar un estudiante
    student = get_student_from_xlsx(generation)
    student_split = student.split()
    text = "{} {} \n{} {}".format(
        student_split[0],
        student_split[1],
        student_split[2],
        student_split[3]
    )
    effects = [
        RandomNoise(screen,
                    signal=Rainbow(screen,
                                   FigletText(text)))
    ]
    screen.play([Scene(effects, -1)], stop_on_resize=True)
Пример #6
0
    def test_noise(self):
        """
        Check that RandomNoise works.
        """
        # Check that RandomNoise updates every frame.
        screen = MagicMock(spec=Screen, colours=8)
        canvas = Canvas(screen, 10, 40, 0, 0)
        effect = RandomNoise(canvas)
        effect.reset()
        self.assert_blank(canvas)
        buffer = [[(32, 7, 0, 0) for _ in range(40)] for _ in range(10)]
        for i in range(20):
            effect.update(i)
            self.assertEqual(
                self.check_canvas(
                    canvas, buffer,
                    lambda value: self.assertLess(value[0], 129)), True)

        # Check there is no stop frame by default.
        self.assertEqual(effect.stop_frame, 0)
 def demo(screen):
     effects = [
         RandomNoise(screen,
                     signal=Rainbow(screen, FigletText("TEAM DROP TABLES")))
     ]
     screen.play([Scene(effects, 0)], stop_on_resize=True, repeat=False)
def demo(screen):
    render = Rainbow(screen, SpeechBubble('Gaurav D. Sharma'))
    effects = [RandomNoise(screen, signal=render)]
    screen.play([Scene(effects, -1)], stop_on_resize=True)
Пример #9
0
def demo(screen):
    render = Rainbow(screen, SpeechBubble('D - C R Y P T O R'))
    effects = [RandomNoise(screen, signal=render)]
    screen.play([Scene(effects, 280)], stop_on_resize=True, repeat=False)
Пример #10
0
def demo(screen):
    scenes = []
    centre = (screen.width // 2, screen.height // 2)
    podium = (38, 20, 30, 20)
    podium2 = (30, 20)

    # Scene 1.
    path = Path()
    path.jump_to(-20, centre[1])
    path.move_straight_to(centre[0], centre[1], 10)
    path.wait(30)
    path.move_straight_to(podium[0], podium[1], 10)
    path.wait(100)

    effects = [
        Arrow(screen, path, colour=Screen.COLOUR_GREEN),
        _speak(screen, "BIENVENIDO A  ~~THE MINERS~~~ !!!", centre, 30),
        _speak(screen, "Tercera parte de Postdigital (Enrique Tomás).", podium,
               110),
        _speak(screen, "Quiero explicarte algo sobre la obra.", podium, 180),
    ]
    scenes.append(Scene(effects))

    # Scene 2.
    path = Path()
    path.jump_to(podium[0], podium[1])
    path.wait(1000)

    effects = [
        Arrow(screen, path, colour=Screen.COLOUR_GREEN),
        _speak(screen, "The Miners? ... ¿Los mineros?", podium, 10),
        _speak(screen, "Va sobre las criptomonedas y sus efectos...", podium,
               80),
        #Print(screen,
        #      Box(screen.width, screen.height, uni=screen.unicode_aware),
        #      0, 0, start_frame=90),
        _speak(screen, "Las criptomonedas son dinero electrónico.", podium,
               150),
        _speak(
            screen,
            "Sirven para transferir dinero sin intermediarios (como los bancos).",
            podium, 220),
        _speak2(
            screen,
            "Las transacciones necesitan ser verificadas por otros ordenadores de la red",
            podium, 300),
        _speak(screen, "que resuelven un complejo problema matemático.",
               podium, 400),
        _speak(screen, "...consumiendo mucha electricidad.", podium, 480),
        _speak2(screen, "Al año, tanta como un país como Irlanda o Suiza.",
                podium, 580),
        _speak(screen,
               "Por este motivo se recompensa económicamente a los nodos.",
               podium, 700),
        _speak2(
            screen,
            "El primero en resolverlo gana 12.5 bitcoins (1 bitcoin =~ 4200 euro) ",
            podium, 780),
        Stars(screen, (screen.width + screen.height) // 2, start_frame=360)
    ]
    scenes.append(Scene(effects, -1))

    # Scene 3.
    path = Path()
    path.move_straight_to(podium[2], podium[3], 10)
    path.wait(800)

    effects = [
        Arrow(screen, path, colour=Screen.COLOUR_GREEN),
        _speak(screen, "Durante esta obra, vamos a minar bitcoins...", podium2,
               10),
        _speak2(screen, "Cada nota que tocará el Emsemble Container...",
                podium2, 70),
        _speak2(
            screen,
            "verificará (minará) una transaccion de bitcoins en tiempo real",
            podium2, 160),
        _speak(screen, " y si tenemos suerte (1 elevado a menos 36)...",
               podium2, 260),
        _speak(screen, "¡¡¡ganaremos 12.5 bitcoins en este concierto!!!",
               podium2, 340),
        _speak(screen, "El minado (ejem... el concierto) va a empezar...",
               podium2, 420),
        RandomNoise(screen,
                    signal=Rainbow(
                        screen,
                        FigletText("El concierto... va a empezar...",
                                   font="term")),
                    start_frame=490)
    ]
    scenes.append(Scene(effects, -1))

    screen.play(scenes, stop_on_resize=True)
Пример #11
0
def demo(screen):
    render = Rainbow(screen, SpeechBubble('              \n              \n    This is   \n  a rainbow   \n              \n              '))
    effects = [RandomNoise(screen, signal=render)]
    screen.play([Scene(effects, -1)], stop_on_resize=True)
Пример #12
0
def demo(screen):
    scenes = []

    effects = [
            RandomNoise(screen,
                signal=Rainbow(screen,
                    FigletText("ASCIIMATICS"))),
                Print(screen,
                    Fire(screen.height, 80, "*" * 70, 0.8, 60, screen.colours,
                        bg=screen.colours >= 256),
                    0,
                    speed=1,
                    transparent=False),
                Print(screen,
                    FigletText("Help!", "banner3"),
                    (screen.height - 4) // 2,
                    colour=Screen.COLOUR_BLACK,
                    speed=1,
                    stop_frame=30),
                Print(screen,
                    FigletText("I'm", "banner3"),
                    (screen.height - 4) // 2,
                    colour=Screen.COLOUR_BLACK,
                    speed=1,
                    start_frame=30,
                    stop_frame=50),
                Print(screen,
                    FigletText("on", "banner3"),
                    (screen.height - 4) // 2,
                    colour=Screen.COLOUR_BLACK,
                    speed=1,
                    start_frame=50,
                    stop_frame=70),
                Print(screen,
                    FigletText("Fire!", "banner3"),
                    (screen.height - 4) // 2,
                    colour=Screen.COLOUR_BLACK,
                    speed=1,
                    start_frame=70),
                ]
    scenes.append(Scene(effects, 100))

    text = Figlet(font="banner", width=200).renderText("ASCIIMATICS")
    width = max([len(x) for x in text.split("\n")])

    effects = [
            Print(screen,
                Fire(screen.height, 80, text, 0.4, 40, screen.colours),
                0,
                speed=1,
                transparent=False),
            Print(screen,
                FigletText("ASCIIMATICS", "banner"),
                screen.height - 9, x=(screen.width - width) // 2 + 1,
                colour=Screen.COLOUR_BLACK,
                bg=Screen.COLOUR_BLACK,
                speed=1),
            Print(screen,
                FigletText("ASCIIMATICS", "banner"),
                screen.height - 9,
                colour=Screen.COLOUR_WHITE,
                bg=Screen.COLOUR_WHITE,
                speed=1),
            ]
    scenes.append(Scene(effects, -1))

    screen.play(scenes, stop_on_resize=True)