Esempio n. 1
0
 def test_block_args(self):
     s_mock = SerializerMock()
     w = World(s_mock, block_seed=0)
     blk = Block(0, 0, w)
     tiles = generate_map(w.seed_float, 0, 0)
     hidden_map = hidden_map_handler.generate_map(Game.map_size)
     obstacle_map = generate_obstacle_map(tiles, Game.map_size)
     blk2 = Block(0, 0, w, hidden_map=hidden_map,
                  obstacle_map=obstacle_map, tiles=tiles)
     self.assertEqual(blk, blk2)
Esempio n. 2
0
def write_obs_map(filepath):
    open(filepath).write(generate_obstacle_map(
        generate_block(0,0,0), len(generate_block(0,0,0))))
Esempio n. 3
0
 def test_generate_obs_map(self):
     self.assertEqual(obs_map, generate_obstacle_map(zero_map, map_size))
     for x in range(map_size):
         for y in range(map_size):
             self.assertEqual(obs_map[x][y], Tiles.tile_lookup[zero_map[x][y]].is_obstacle)