From: Christian Heller Date: Sun, 8 Nov 2020 01:16:16 +0000 (+0100) Subject: Add thing collision detection on movement. X-Git-Url: https://plomlompom.com/repos/?p=plomrogue2-experiments;a=commitdiff_plain;h=6a42c14f0f393f8866689e3b19e950cdc299938b Add thing collision detection on movement. --- diff --git a/new2/plomrogue/tasks.py b/new2/plomrogue/tasks.py index bb78b98..99bb41f 100644 --- a/new2/plomrogue/tasks.py +++ b/new2/plomrogue/tasks.py @@ -36,6 +36,8 @@ class Task_MOVE(Task): test_pos = self.get_move_target() if test_pos is None: raise PlayError('would move out of map') + elif test_pos in [t.position for t in self.thing.game.things]: + raise PlayError('would collide with other things') elif self.thing.game.map[test_pos] != '.': raise PlayError('would move into illegal territory')