From 492f37bda55b12096f7d51f4452cffa30fc18618 Mon Sep 17 00:00:00 2001 From: Marcin Kostrzewski Date: Fri, 15 May 2020 08:54:49 +0200 Subject: [PATCH] Pressing 'u' now selects random interactable entity --- src/game/EventManager.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/game/EventManager.py b/src/game/EventManager.py index 7880882..0b5fe7a 100644 --- a/src/game/EventManager.py +++ b/src/game/EventManager.py @@ -106,7 +106,9 @@ class EventManager: if keys[pygame.K_u]: while True: try: - self.player.gotoToTarget(Random().choice(self.game.map.entities), self.game.map) + from src.entities.Interactable import Interactable + self.player.gotoToTarget(Random().choice(self.game.map.getEntitiesByType(Interactable)), + self.game.map) break except IndexError: pass