Created
June 12, 2020 13:38
-
-
Save ProgDan/05cea1e0e8d0d7cf16e85f203854f113 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Verifica se houve colisão com a cabeça | |
for segment in segments: | |
if segment.distance(head) < 20: | |
time.sleep(1) | |
head.goto(0, 0) | |
head.direction = "stop" | |
# Oculta os segmentos | |
for segment in segments: | |
segment.goto(1000, 1000) | |
# Limpa a lista de segmentos | |
segment.clear() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment