diff --git a/game.py b/game.py index 7efc497..12ed342 100644 --- a/game.py +++ b/game.py @@ -166,6 +166,10 @@ class Player: if(game.test_collision(pygame.Rect(new_x-50, new_y-50, 100, 100), game.collisions) == False): self.x = new_x self.y = new_y + elif(game.test_collision(pygame.Rect(self.x-50, new_y-50, 100, 100), game.collisions) == False): + self.y = new_y + elif(game.test_collision(pygame.Rect(new_x-50, self.y-50, 100, 100), game.collisions) == False): + self.x = new_x class Game: def __init__(self):