Pressing 'u' now selects random interactable entity
This commit is contained in:
parent
a40a598ffe
commit
492f37bda5
@ -106,7 +106,9 @@ class EventManager:
|
|||||||
if keys[pygame.K_u]:
|
if keys[pygame.K_u]:
|
||||||
while True:
|
while True:
|
||||||
try:
|
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
|
break
|
||||||
except IndexError:
|
except IndexError:
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user