forked from s434673/AI_Waiter
bugfix
Waiter out of matrix
This commit is contained in:
parent
8b2ff2527c
commit
2573d37d1a
@ -13,11 +13,9 @@ class Waiter(pygame.sprite.Sprite):
|
||||
|
||||
# Borders
|
||||
def move(self, x, y):
|
||||
if 0 <= self.X + x <= 13:
|
||||
if self.matrix.walk_through(self.X, self.Y) == 1:
|
||||
if 0 <= self.X + x <= 13 and 0 <= self.Y + y <= 14:
|
||||
if self.matrix.walk_through(self.X + x, self.Y + y) == 1:
|
||||
self.X += x
|
||||
if 0 <= self.Y + y <= 14:
|
||||
if self.matrix.walk_through(self.X, self.Y) == 1:
|
||||
self.Y += y
|
||||
|
||||
def update(self, event):
|
||||
|
Loading…
Reference in New Issue
Block a user