def loop(): kit.setBackground(colors[0]) renderMainShipBullets() if t % 200 == 0: enemies.append(Ship([random(0, 15), random(0, 7)], random(0, 8))) renderMainShip() renderEnemies()
def start(): global t global level while True: t = t + level kit.checkControls() kit.setBackground(colors[0]) loop() kit.render() sleep(0.01)
def start(): global t reset() while True: t += 1 kit.setBackground(colors[0]) if gameOver and kit.buttonA.value() == 0: reset() loop() kit.render() sleep(0.01)
def loop(): global t t = t + 1 kit.checkControls() if not gameOver: if t % int(level) == 0: updateBall() kit.clear() renderFrame() kit.render() else: kit.setBackground([10, 10, 0]) for i in range(0, score): kit.setPixel(i % 16, int(i / 16), [10, 0, 0]) kit.render()