1
0
forked from s434673/AI_Waiter
This commit is contained in:
s444427 2020-04-03 20:24:05 +02:00
parent d2114e1ba6
commit 8b2ff2527c

View File

@ -13,10 +13,11 @@ class Waiter(pygame.sprite.Sprite):
# Borders
def move(self, x, y):
if self.matrix.walk_through(self.X + x, self.Y + y) == 1:
if 0 <= self.X + x < 14:
if 0 <= self.X + x <= 13:
if self.matrix.walk_through(self.X, self.Y) == 1:
self.X += x
if 0 <= self.Y + y < 15:
if 0 <= self.Y + y <= 14:
if self.matrix.walk_through(self.X, self.Y) == 1:
self.Y += y
def update(self, event):