Closed Nennstiel closed 7 years ago
Instead of:
device.clear()
for i in snake:
with canvas(device) as draw:
dither=True
draw.point(apfel, fill ="white")
draw.point(i, fill ="white")
I think the code in the main while loop should be along the lines of:
with canvas(device) as draw:
for i in snake:
draw.point(apfel, fill ="white")
draw.point(i, fill ="white")
There's no need to clear the device (the canvas will manage this for you).
Also the endOfGame
can just be:
def endOfGame():
show_message(device, "GAME OVER", fill="white", scroll_delay=0.04)
punkte = len(snake)-1
show_message(device,"EREICHTE PUNKTE: "+ str(punkte), fill="white", scroll_delay=0.04)
I have programmed the game snake for the pi and i'm using 3 of the max7219 to display it. My problem is that from the point where the snake collects the first member all of the following members start to flash but the base element lights up permanently. I can not find the error, why the lightning happens. The rest of the game works just fine. The game runs on a pi 3 with all libraries up to date and spi enabled