def clearLives(): client.publish('status/lives', '') if lifeDisplay: sev.clear() led.solid(led.CODE_Display_Fade) time.sleep(1.1) led.solid(led.CODE_Display_On)
def showLives(): if lifeDisplay: lives = playerstats["game"]["lives"] print "Lives remaining: " + str(lives) if 0 <= lives <= 9: sev.displayDigit(lives) if lives == 0: led.solid(led.CODE_Col_White) elif lives == 1: led.flash(led.CODE_Col_Red, led.CODE_Col_Red1, 120) elif lives == 2: led.solid(led.CODE_Col_Red1) elif lives == 3: led.solid(led.CODE_Col_Red2) elif lives == 4: led.solid(led.CODE_Col_Yellow) elif lives == 5: led.solid(led.CODE_Col_Green)
def showLives(): client.publish('status/lives', str(playerstats['game']['lives'])) if lifeDisplay: lives = playerstats['game']['lives'] print "Lives remaining: " + str(lives) if 0 <= lives <= 9: sev.displayDigit(lives) if lives == 0: led.solid(led.CODE_Col_White) elif lives == 1: led.flash(led.CODE_Col_Red, led.CODE_Col_Red1, 120) elif lives == 2: led.solid(led.CODE_Col_Red1) elif lives == 3: led.solid(led.CODE_Col_Red2) elif lives == 4: led.solid(led.CODE_Col_Yellow) elif lives == 5: led.solid(led.CODE_Col_Green)
def clearLives(): if lifeDisplay: sev.clear() led.solid(led.CODE_Display_Fade) time.sleep(1.1) led.solid(led.CODE_Display_On)