+ def make_new(self, geometry, yx, seed):
+ import random
+ random.seed(seed)
+ self.turn = 0
+ self.new_map(geometry, yx)
+ for pos in self.map_:
+ if 0 in pos or (yx[0] - 1) == pos[0] or (yx[1] - 1) == pos[1]:
+ self.map_[pos] = '#'
+ continue
+ self.map_[pos] = random.choice(('.', '.', '.', '.', 'x'))
+ player = self.Thing(self, 0)
+ player.type_ = 'human'
+ player.position = [random.randint(0, yx[0] -1),
+ random.randint(0, yx[1] - 1)]
+ npc = self.Thing(self, 1)
+ npc.type_ = 'monster'
+ npc.position = [random.randint(0, yx[0] -1),
+ random.randint(0, yx[1] -1)]
+ self.things = [player, npc]
+