use of com.b3dgs.lionengine.game.feature.tile.map.MapTile in project lionengine by b3dgs.
the class UtilMapTransition method createTransitions.
/**
* Create map with transitive.
*
* @return The created configuration.
*/
public static Media createTransitions() {
final MapTile map1 = UtilMap.createMap(16);
UtilMap.fill(map1, TILE_GROUND);
UtilMap.fill(map1, TILE_GROUND, TILE_TRANSITION, 6);
UtilMap.fill(map1, TILE_WATER, TILE_TRANSITION, 3);
UtilMap.fill(map1, TILE_TREE, TILE_TRANSITION2, 9);
UtilMap.fill(map1, TILE_GROUND, TILE_TRANSITION, 13);
map1.setTile(13, 13, TILE_ROAD);
final MapTile map2 = UtilMap.createMap(10);
UtilMap.fill(map2, TILE_WATER);
UtilMap.fill(map2, TILE_GROUND, TILE_TRANSITION, 5);
final MapTile map3 = UtilMap.createMap(10);
UtilMap.fill(map3, TILE_TREE);
UtilMap.fill(map3, TILE_GROUND, TILE_TRANSITION2, 5);
final MapTile map4 = UtilMap.createMap(5);
UtilMap.fill(map4, TILE_ROAD);
map4.setTile(2, 2, TILE_GROUND);
final Media config = Medias.create("transitives.xml");
TransitionsConfig.exports(config, new TransitionsExtractorImpl().getTransitions(Arrays.asList(map1, map2, map3, map4)));
return config;
}
use of com.b3dgs.lionengine.game.feature.tile.map.MapTile in project lionengine by b3dgs.
the class MapCircuitExtractorTest method testT3JRight.
/**
* Check the three way junction right circuits.
*/
@Test
void testT3JRight() {
final MapTile map = UtilMap.createMap(7);
UtilMap.fill(map, TILE_GROUND);
map.setTile(3, 2, TILE_ROAD);
map.setTile(3, 3, TILE_ROAD);
map.setTile(3, 4, TILE_ROAD);
map.setTile(2, 3, TILE_ROAD);
assertEquals(new Circuit(CircuitType.T3J_RIGHT, ROAD, GROUND), get(map, 3, 3));
}
use of com.b3dgs.lionengine.game.feature.tile.map.MapTile in project lionengine by b3dgs.
the class MapCircuitExtractorTest method testAngles.
/**
* Check the angles circuits.
*/
@Test
void testAngles() {
final MapTile map = UtilMap.createMap(7);
UtilMap.fill(map, TILE_GROUND);
UtilMap.fill(map, TILE_ROAD, TILE_ROAD, 3);
map.setTile(3, 3, TILE_GROUND);
assertEquals(new Circuit(CircuitType.ANGLE_TOP_LEFT, ROAD, GROUND), get(map, 2, 4));
assertEquals(new Circuit(CircuitType.ANGLE_TOP_RIGHT, ROAD, GROUND), get(map, 4, 4));
assertEquals(new Circuit(CircuitType.ANGLE_BOTTOM_LEFT, ROAD, GROUND), get(map, 2, 2));
assertEquals(new Circuit(CircuitType.ANGLE_BOTTOM_RIGHT, ROAD, GROUND), get(map, 4, 2));
}
use of com.b3dgs.lionengine.game.feature.tile.map.MapTile in project lionengine by b3dgs.
the class MapCircuitExtractorTest method testT3JBottom.
/**
* Check the three way junction bottom circuits.
*/
@Test
void testT3JBottom() {
final MapTile map = UtilMap.createMap(7);
UtilMap.fill(map, TILE_GROUND);
map.setTile(2, 3, TILE_ROAD);
map.setTile(3, 3, TILE_ROAD);
map.setTile(4, 3, TILE_ROAD);
map.setTile(3, 4, TILE_ROAD);
assertEquals(new Circuit(CircuitType.T3J_BOTTOM, ROAD, GROUND), get(map, 3, 3));
}
use of com.b3dgs.lionengine.game.feature.tile.map.MapTile in project lionengine by b3dgs.
the class MapCircuitExtractorTest method testT3JLeft.
/**
* Check the three way junction left circuits.
*/
@Test
void testT3JLeft() {
final MapTile map = UtilMap.createMap(7);
UtilMap.fill(map, TILE_GROUND);
map.setTile(3, 2, TILE_ROAD);
map.setTile(3, 3, TILE_ROAD);
map.setTile(3, 4, TILE_ROAD);
map.setTile(4, 3, TILE_ROAD);
assertEquals(new Circuit(CircuitType.T3J_LEFT, ROAD, GROUND), get(map, 3, 3));
}
Aggregations