Ejemplo n.º 1
0
 def __init__(self):
     SceneBase.__init__(self)
     mimo.reset()
     self.percentage = 0
     mimo.set_led_brightness(120)
     mimo.set_independent_lights(True, True)
     # check ring and bulbs leds
     self.AddTrigger(1, self, 'LoadRing')
Ejemplo n.º 2
0
    def __init__(self):
        SceneBase.__init__(self)
        mimo.reset()

        mimo.set_led_brightness(120)
        mimo.set_independent_lights(True, True)
        # check ring and bulbs leds
        factor = 0.2
        loops = 50
        n_leds = 28
        leds = list(range(0, 28))
        for index in range(0, n_leds * loops):
            led_i = leds[index % n_leds]
            self.AddTrigger((1.5 + index) * factor, mimo,
                            'set_material_leds_color', [
                                led_i,
                                int(random.random() * 255),
                                int(random.random() * 255),
                                int(random.random() * 255)
                            ])
            self.AddTrigger((1.5 + index + 0.9) * factor, mimo,
                            'set_material_leds_color', [led_i, 0, 0, 0])

        n_leds = 69
        leds = list(range(0, 69))
        for index in range(0, n_leds * loops):
            led_i = leds[index % n_leds]
            self.AddTrigger((1.5 + index) * factor, mimo,
                            'set_optimization_leds_color', [
                                led_i,
                                int(random.random() * 255),
                                int(random.random() * 255),
                                int(random.random() * 255)
                            ])
            self.AddTrigger((1.5 + index + 0.9) * factor, mimo,
                            'set_optimization_leds_color', [led_i, 0, 0, 0])
Ejemplo n.º 3
0
    def __init__(self):
        SceneBase.__init__(self)
        mimo.reset()

        self.logo = utils.Sprite('assets/sprites/logo_MCorp.png', 1280 / 2,
                                 720 / 2)
        self.logo.opacity = 0

        self.sfx_mimo_logo = utils.get_sound(
            'assets/audio/SFX/M_OS/UI_Booth.ogg')

        self.AddTween("easeInOutSine", 2, self.logo, "opacity", 0, 255, 1)
        self.AddTrigger(1, self.sfx_mimo_logo, 'play')

        # check ring and bulbs leds
        factor = 0.1
        loops = 50
        n_leds = 20
        leds = list(range(8, 28))
        for index in range(0, n_leds * loops):
            led_i = leds[index % n_leds]
            self.AddTrigger((1.5 + index) * factor, mimo,
                            'set_material_leds_color', [
                                led_i,
                                int(random.random() * 255),
                                int(random.random() * 255),
                                int(random.random() * 255)
                            ])
            self.AddTrigger((1.5 + index + 0.9) * factor, mimo,
                            'set_material_leds_color', [led_i, 0, 0, 0])

        # check buttons and backlight buttons.
        mimo.set_buttons_enable_status(True, True)
        mimo.set_independent_lights(False, False)
        mimo.set_led_brightness(120)
        mimo.set_material_buttons_lock_status(
            [0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0])
        mimo.set_material_buttons_mode(
            [0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0])
        mimo.set_optimization_buttons_lock_status(
            [0, 0, 1, 0, 2, 0, 3, 0, 4, 0])
        mimo.set_optimization_buttons_mode([0, 0, 1, 0, 2, 0, 3, 0, 4, 0])

        # activate knobs
        mimo.set_tunners_enable_status(True)

        # create matrix sprite
        self.testSprite = AnimatedNeoSprite('assets/palomita.png')

        self.label = TextNeoSprite("people")
        self.label.y = 2

        font = pygame.font.Font("assets/fonts/VCR_OSD_MONO_1.001.ttf", 36)
        self.title = utils.Text("Hello Machinaria!", font)
        self.title.opacity = 0
        self.title.SetPosition(400, 200)
        self.AddTween("easeInOutSine", 2, self.title, "opacity", 0, 255, 1)

        # check lcd screens
        for index in range(0, 6):
            mimo.lcd_display_at(index, 'id' + str(index) + '- line 1', 1)
            mimo.lcd_display_at(index, 'id' + str(index) + '- line 2', 2)
Ejemplo n.º 4
0
 def time_up(self):
     self.timeoutends_popup_active = True
     self.UI_EndGame.play()
     utils.stop_music()
     mimo.printer_interface('agar3s.json')
     mimo.reset()
Ejemplo n.º 5
0
    def __init__(self):
        SceneBase.__init__(self)
        mimo.reset()

        self.logo = utils.Sprite('assets/sprites/logo_MCorp.png', 1280 / 2,
                                 720 / 2)
        self.logo.opacity = 0

        self.sfx_mimo_logo = utils.get_sound('assets/audio/SFX/MimoLogo.ogg')

        self.AddTween("easeInOutSine", 2, self.logo, "opacity", 0, 255, 1)
        self.AddTrigger(1, self.sfx_mimo_logo, 'play')

        #self.comm.opt.set_led_brightness(50)
        #mimo.set_led_brightness(250)
        #self.comm.opt.lock_buttons([3, 0, 4, 0])
        #mimo.set_optimization_leds_color([0, 255, 0, 0])
        #mimo.set_optimization_leds_color([1, 0, 255, 0])
        #mimo.set_optimization_leds_color([2, 0, 0, 255])
        #mimo.set_optimization_leds_color([3, 255, 0, 0])
        #mimo.set_optimization_leds_color([4, 255, 255, 255])
        #mimo.set_independent_lights(False, True)
        #mimo.set_independent_lights(True, True)
        #mimo.set_buttons_enable_status(True, True)
        #mimo.set_optimization_buttons_lock_status([0,0,1,0,2,0,3,0,4,0])
        #mimo.set_material_buttons_lock_status([0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0])
        #mimo.set_tunners_enable_status(False)
        #mimo.set_optimization_leds_color([2, 255,0,255])
        #mimo.set_optimization_leds_color([5, 255,0,255])
        #mimo.set_optimization_leds_color([19, 255,0,255])
        #mimo.set_optimization_leds_color([27, 255,0,0])
        #mimo.set_optimization_leds_color([28, 255,255])
        #mimo.set_optimization_leds_color([29, 255,0,255])
        #mimo.set_optimization_leds_color([30, 255,0,255])
        factor = 0.05
        loops = 100
        n_leds = 64 + 5
        #for index in range(0, n_leds*loops):
        #    self.AddTrigger((1+index)*factor, mimo, 'set_optimization_leds_color', [index%n_leds, int(random.random()*255), int(random.random()*255), int(random.random()*255)])
        #    self.AddTrigger((1+index+0.9)*factor, mimo, 'set_optimization_leds_color', [index%n_leds, 0, 0, 0])

        n_leds = 64
        leds = list(range(0, 64))
        #for index in range(0, n_leds*loops):
        #    led_i = leds[index%n_leds] + 5
        #    self.AddTrigger((1.5+index)*factor, mimo, 'set_optimization_leds_color', [led_i, int(random.random()*255), int(random.random()*255), int(random.random()*255)])
        #    self.AddTrigger((1.5+index+0.9)*factor, mimo, 'set_optimization_leds_color', [led_i, 0, 0, 0])
        #self.comm.opt.activate_buttons(True)
        mimo.set_buttons_enable_status(True, True)
        mimo.set_independent_lights(False, False)
        mimo.set_led_brightness(250)
        mimo.set_material_buttons_lock_status(
            [0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0])
        mimo.set_material_buttons_mode(
            [0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0])
        mimo.set_optimization_buttons_lock_status(
            [0, 0, 1, 0, 2, 0, 3, 0, 4, 0])
        mimo.set_optimization_buttons_mode([0, 0, 1, 0, 2, 0, 3, 0, 4, 0])
        #self.comm.opt.activate_tunners(False)
        #mimo.set_tunners_enable_status(False)
        #self.comm.opt.set_independent_lights(False)
        #self.comm.opt.clean_matrix()
        #graphics.clear()

        #self.AddTrigger(0, self.comm.mat, 'set_led_light', [1, 125, 125, 0, 1, 255, 255, 0])
        #self.AddTrigger(1, mimo, 'set_material_leds_color', [0, 125, 125, 0, 1, 255, 255, 0])
        #self.AddTrigger(2, self.comm.mat, 'set_led_light', [7, 0, 255, 0])
        #self.AddTrigger(2, mimo, 'set_material_leds_color', [7, 0, 255, 0])
        #self.AddTrigger(3, self.comm.opt, 'set_led_light', [0, 255, 0, 0])
        # debe prender el led del boton de  optimizacion 0
        #self.AddTrigger(3, mimo, 'set_optimization_leds_color', [10, 255, 0, 0])

        mimo.set_tunners_enable_status(True)
        #self.testSprite = AnimatedNeoSprite('assets/tilesprite.png')
        self.testSprite = AnimatedNeoSprite('assets/palomita.png')
        #self.testSprite.setFrameRate(8)
        #self.testSprite.playing = True
        self.label = TextNeoSprite("people")
        #
        self.label.y = 2
        #
        font = pygame.font.Font("assets/fonts/VCR_OSD_MONO_1.001.ttf", 36)
        self.title = utils.Text("Hello Machinaria!", font)
        self.title.opacity = 0
        self.title.SetPosition(400, 200)
        self.AddTween("easeInOutSine", 2, self.title, "opacity", 0, 255, 1)