use of com.b3dgs.lionengine.game.feature.tile.map.MapTileGame in project lionengine by b3dgs.
the class CollisionGroupConfigTest method prepare.
/**
* Prepare test.
*/
@BeforeEach
public void prepare() {
final MapTileGame map = new MapTileGame();
map.addFeature(new MapTileGroupModel());
mapCollision = new MapTileCollisionModel();
mapCollision.prepare(map);
}
use of com.b3dgs.lionengine.game.feature.tile.map.MapTileGame in project lionengine by b3dgs.
the class CollisionCategoryConfigTest method prepare.
/**
* Prepare test.
*/
@BeforeEach
public void prepare() {
final MapTileGame map = new MapTileGame();
map.addFeature(new MapTileGroupModel());
mapCollision = new MapTileCollisionModel();
mapCollision.prepare(map);
}
use of com.b3dgs.lionengine.game.feature.tile.map.MapTileGame in project lionengine by b3dgs.
the class UtilMapTilePersister method createMap.
/**
* Create a test map.
*
* @return The created test map.
*/
public static MapTile createMap() {
final MapTileGame map = new MapTileGame();
map.addFeature(new MapTilePersisterModel());
map.create(16, 32, 3, 3);
map.loadSheets(new ArrayList<SpriteTiled>());
for (int tx = 0; tx < map.getInTileWidth(); tx++) {
for (int ty = 1; ty < map.getInTileHeight(); ty++) {
map.setTile(tx, ty, tx * ty);
}
}
return map;
}
use of com.b3dgs.lionengine.game.feature.tile.map.MapTileGame in project lionengine by b3dgs.
the class UtilMapTilePersister method loadMap.
/**
* Load map from file.
*
* @param level The level media.
* @return The loaded map.
* @throws IOException If error.
*/
public static MapTileGame loadMap(Media level) throws IOException {
final MapTileGame map = new MapTileGame();
map.addFeature(new MapTilePersisterModel());
try (FileReading input = new FileReading(level)) {
map.getFeature(MapTilePersister.class).load(input);
}
return map;
}
use of com.b3dgs.lionengine.game.feature.tile.map.MapTileGame in project lionengine by b3dgs.
the class AstarTest method testCreatePathFinder.
/**
* Test the create path finder.
*/
@Test
void testCreatePathFinder() {
final MapTileGame map = new MapTileGame();
map.addFeature(new MapTileGroupModel());
map.addFeature(new MapTilePathModel());
assertNotNull(Astar.createPathFinder(map, 1, new HeuristicClosest()));
}
Aggregations