From d6cf76f6bc44d1ee2d1f708145990256b7c476a0 Mon Sep 17 00:00:00 2001 From: Marcin Kostrzewski Date: Wed, 13 May 2020 19:34:16 +0200 Subject: [PATCH] Updated A* function calls --- src/game/EventManager.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/game/EventManager.py b/src/game/EventManager.py index d16030f..43b5852 100644 --- a/src/game/EventManager.py +++ b/src/game/EventManager.py @@ -5,7 +5,7 @@ import pygame from src.entities.Interactable import Interactable from src.entities.Pickupable import Pickupable -from src.entities.Player import Movement +from entities.Enums import Movement class EventManager: @@ -57,7 +57,7 @@ class EventManager: clicked_collidables = [s for s in self.game.map.collidables if s.rect.collidepoint(pos)] if len(clicked_collidables) > 0: - self.game.movement.gotoToTarget(Random().choice(clicked_collidables)) + self.player.gotoToTarget(Random().choice(clicked_collidables), self.game.map) else: # get a list of all terrains that are under the mouse cursor clicked_terrains = [tile for tile in self.game.map.terrainTilesList if tile.rect.collidepoint(pos)] @@ -96,9 +96,7 @@ class EventManager: if keys[pygame.K_u]: while True: try: - self.game.movement.gotoToTarget(Random().choice(self.game.map.entities)) + self.player.gotoToTarget(Random().choice(self.game.map.entities), self.game.map) break except IndexError: pass - -