Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PySnake
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Kirsch
PySnake
Commits
d222ea66
Commit
d222ea66
authored
5 years ago
by
Jakob Kirsch
Browse files
Options
Downloads
Patches
Plain Diff
fix
parent
202b1bcc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
__main__.py
+8
-4
8 additions, 4 deletions
__main__.py
with
8 additions
and
4 deletions
__main__.py
+
8
−
4
View file @
d222ea66
...
@@ -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
():
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment