summaryrefslogtreecommitdiff
path: root/Game.py
diff options
context:
space:
mode:
Diffstat (limited to 'Game.py')
-rw-r--r--Game.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Game.py b/Game.py
index 6f6a063..662ce8b 100644
--- a/Game.py
+++ b/Game.py
@@ -47,7 +47,7 @@ class Game:
walls = None
def __init__(self):
- self.snake = Snake([Vec2(6, 6), Vec2(6, 7), Vec2(6,8), Vec2(7,8)], self)
+ self.snake = Snake([Vec2(6, 6), Vec2(6, 7), Vec2(6,8), Vec2(7,8), Vec2(8, 8), Vec2(9, 8)], self)
_box1 = Box(Vec2(11, 4))
_box2 = Box(Vec2(3, 10))
self.boxes = [_box1, _box2]
@@ -59,7 +59,7 @@ class Game:
# #
# h #
# t #
-# tt #
+# tttt #
# #
# b #
# ### #
@@ -79,6 +79,8 @@ class Game:
boxAt = next(filter(lambda box: box.pos == pos, self.boxes), None)
if self.walls.wallAt(pos):
return False
+ elif pos in self.snake.cells:
+ return False
elif boxAt != None:
if self.enter(pos + inDir, inDir):
boxAt.pos = pos + inDir