Raspberry Pi Guia Del Usuario página 163

Ocultar thumbs Ver también para Pi:
Tabla de contenido

Publicidad

playSurface.fill(blackColour)
for position in snakeSegments:
pygame.draw.rect(playSurface,whiteColour,Rect(position[0], position[1], 20, 20))
pygame.draw.rect(playSurface,redColour,Rect(raspberryPosition[0], raspberryPosition[1], 20, 20))
pygame.display.flip()
pygame.display.flip()
pygame.display.flip()
if snakePosition[0] > 620 or snakePosition[0] < 0:
gameOver()
if snakePosition[1] > 460 or snakePosition[1] < 0:
gameOver()
if
for snakeBody in snakeSegments[1:]:
if snakePosition[0] == snakeBody[0] and snakePosition[1] == snakeBody[1]:
gameOver()
for
fpsClock
fpsClock.tick(20)
raspberrySpawned
if
snakeSegments[1:]
1
gameOver

Publicidad

Tabla de contenido
loading

Tabla de contenido