示例#1
0
def startintro(player1, player2):
    ledmatrix.rotation(0)
    ledmatrix.clear()
    showmap(80, 80, 80)
    for x in range(6, -1, -1):
        ledmatrix.set_pixel(x, 6,
                            player1.getfarbe()[0],
                            player1.getfarbe()[1],
                            player1.getfarbe()[2])
        ledmatrix.show()
        time.sleep(0.1)
    for x in range(0, 7, 1):
        ledmatrix.set_pixel(x, 0,
                            player2.getfarbe()[0],
                            player2.getfarbe()[1],
                            player2.getfarbe()[2])
        ledmatrix.show()
        time.sleep(0.1)

    ledmatrix.set_pixel(0, 5,
                        player1.getfarbe()[0],
                        player1.getfarbe()[1],
                        player1.getfarbe()[2])
    ledmatrix.set_pixel(6, 1,
                        player2.getfarbe()[0],
                        player2.getfarbe()[1],
                        player2.getfarbe()[2])
    ledmatrix.show()
    time.sleep(0.1)
    ledmatrix.set_pixel(0, 4,
                        player1.getfarbe()[0],
                        player1.getfarbe()[1],
                        player1.getfarbe()[2])
    ledmatrix.set_pixel(6, 2,
                        player2.getfarbe()[0],
                        player2.getfarbe()[1],
                        player2.getfarbe()[2])
    ledmatrix.show()
    time.sleep(0.1)

    ledmatrix.set_pixel(0, 3,
                        player1.getfarbe()[0],
                        player1.getfarbe()[1],
                        player1.getfarbe()[2])
    ledmatrix.set_pixel(6, 3,
                        player2.getfarbe()[0],
                        player2.getfarbe()[1],
                        player2.getfarbe()[2])
    ledmatrix.show()
    time.sleep(0.1)

    ledmatrix.set_pixel(0, 5, 80, 80, 80)
    ledmatrix.set_pixel(6, 1, 80, 80, 80)
    ledmatrix.show()
    time.sleep(0.1)
    ledmatrix.set_pixel(0, 4, 80, 80, 80)
    ledmatrix.set_pixel(6, 2, 80, 80, 80)
    ledmatrix.show()
    time.sleep(0.1)
示例#2
0
def display(frame):
    ledmatrix.rotation(0)
    ledmatrix.clear()
    showmap(80, 80, 80)
    ac = frame.actcl
    hpbar(ac[0], ac[1])
    for i in range(0, len(ac)):
        showvar = ac[i].getshow()
        if showvar is True:
            showplayer(ac[i])
    ledmatrix.show()
        """

        ledmatrix.clear()
        ledmatrix.show()


###############################################################################
# MAIN                                                                        #
###############################################################################
if __name__ == '__main__':

    led = Show()
    val = START_DIGIT_VALUE
    val_letter = START_LETTER_VALUE

    ledmatrix.rotation(0)
    led.clean_display()

    while True:
        led.clean_display()
        if val <= 99:
            led.show_letters_digits(val, False)
            val += 1

        elif 99 < val < 126:
            led.show_letters_digits(val_letter, True)
            val_letter += 1
            val += 1

        else:
            val_letter = START_LETTER_VALUE