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 test_pos in [t.position for t in self.thing.game.things
+ if t.blocking]:
+ raise PlayError('blocked by other thing')
elif self.thing.game.map[test_pos] != '.':
raise PlayError('would move into illegal territory')
class Thing(ThingBase):
+ blocking = False
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
class ThingAnimate(Thing):
+ blocking = True
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)