- select_range += [self.game.player.position + YX(-1, -1),
- self.game.player.position + YX(1, -1)]
- self.selectables = [t.id_ for t in self.game.things
- if t.portable and t.position in select_range]
+ directed_moves['UPLEFT'] = YX(-1, -1)
+ directed_moves['UPRIGHT'] = YX(-1, 0)
+ directed_moves['DOWNLEFT'] = YX(1, -1)
+ directed_moves['DOWNRIGHT'] = YX(1, 0)
+ select_range = {}
+ for direction in directed_moves:
+ move = directed_moves[direction]
+ select_range[direction] = self.game.player.position + move
+ self.selectables = []
+ directions = []
+ for direction in select_range:
+ for t in [t for t in self.game.things
+ if t.portable and t.position == select_range[direction]]:
+ self.selectables += [t.id_]
+ directions += [direction]