Skip to content
Snippets Groups Projects
Commit d222ea66 authored by Jakob Kirsch's avatar Jakob Kirsch
Browse files

fix

parent 202b1bcc
No related branches found
No related tags found
No related merge requests found
...@@ -87,10 +87,14 @@ class Snake(pygame.sprite.Sprite): ...@@ -87,10 +87,14 @@ class Snake(pygame.sprite.Sprite):
if not isrunning: if not isrunning:
return return
pos = self.list[0] pos = self.list[0]
if pos[0] > w or pos[0] < 0: if pos[0] > w // base:
self.loose() pos[0] = 0
elif pos[1] > h or pos[1] < 0: elif pos[1] > h // base:
self.loose() pos[1] = 0
elif pos[0] < 0:
pos[0] = w // base
elif pos[1] < 0:
pos[1] = h // base
if pos in self.list[1:]: if pos in self.list[1:]:
self.loose() self.loose()
for snake in snakeGroup.sprites(): for snake in snakeGroup.sprites():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment