use of com.b3dgs.lionengine.game.feature.tile.map.transition.circuit.MapTileCircuitModel in project lionengine by b3dgs.
the class Scene method load.
@Override
public void load() {
map.create(Medias.create("forest.png"));
mapViewer.prepare(map);
final Media media = Medias.create("transitions.xml");
TransitionsConfig.exports(media, Arrays.asList(Medias.create("forest.png")), Medias.create("sheets.xml"), Medias.create("groups.xml"));
map.addFeatureAndGet(new MapTileGroupModel()).loadGroups(Medias.create("groups.xml"));
map.addFeatureAndGet(new MapTileTransitionModel()).loadTransitions(Medias.create("transitions.xml"));
map.addFeatureAndGet(new MapTileCircuitModel()).loadCircuits(Medias.create("circuits.xml"));
UtilFile.deleteFile(media.getFile());
camera.setView(0, 0, 1024, 768, getHeight());
camera.setLimits(map);
parameters.add(new PrefMapSize(16, 16, 64, 48)).add(new PrefMapFill(0)).add(new PrefMapRegion(12, new TileArea(0, 0, 8, 48), 4, 60)).add(new PrefMapRegion(12, new TileArea(56, 0, 64, 48), 4, 60)).add(new PrefMapRegion(12, new TileArea(0, 0, 64, 8), 4, 60)).add(new PrefMapRegion(12, new TileArea(0, 40, 64, 48), 4, 60)).add(new PrefMapRegion(29, new TileArea(12, 12, 56, 42), 2, 250)).add(new PrefMapRegion(12, new TileArea(24, 24, 40, 40), 2, 80)).add(new PrefMapRegion(0, new TileArea(4, 4, 60, 40), 1, 100));
tickGen.start();
tick.start();
}
use of com.b3dgs.lionengine.game.feature.tile.map.transition.circuit.MapTileCircuitModel in project lionengine by b3dgs.
the class UtilMap method createMap.
/**
* Create the raw test map without transition.
*
* @param size The map size in tile.
* @return The created map.
*/
public static MapTileGame createMap(int size) {
final MapTileGame map = new MapTileGame();
final MapTileGroup mapGroup = new MapTileGroupModel();
map.addFeature(mapGroup);
map.addFeature(new MapTileTransitionModel());
map.addFeature(new MapTileCircuitModel());
map.create(1, 1, size, size);
setGroups(map);
return map;
}
use of com.b3dgs.lionengine.game.feature.tile.map.transition.circuit.MapTileCircuitModel in project lionengine by b3dgs.
the class MapGeneratorTest method prepare.
/**
* Prepare test.
*/
@BeforeEach
public void prepare() {
map.create(Medias.create("forest.png"));
mapViewer.prepare(map);
final Media media = Medias.create("transitions.xml");
TransitionsConfig.exports(media, Arrays.asList(Medias.create("forest.png")), Medias.create("sheets.xml"), Medias.create("groups.xml"));
map.addFeatureAndGet(new MapTileGroupModel()).loadGroups(Medias.create("groups.xml"));
map.addFeatureAndGet(new MapTileTransitionModel()).loadTransitions(Medias.create("transitions.xml"));
map.addFeatureAndGet(new MapTileCircuitModel()).loadCircuits(Medias.create("circuits.xml"));
camera.setView(0, 0, 640, 480, 480);
camera.setLimits(map);
parameters.add(new PrefMapSize(16, 16, 64, 48)).add(new PrefMapFill(0)).add(new PrefMapRegion(12, new TileArea(0, 0, 8, 48), 4, 60)).add(new PrefMapRegion(12, new TileArea(56, 0, 64, 48), 4, 60)).add(new PrefMapRegion(12, new TileArea(0, 0, 64, 8), 4, 60)).add(new PrefMapRegion(12, new TileArea(0, 40, 64, 48), 4, 60)).add(new PrefMapRegion(29, new TileArea(12, 12, 56, 42), 2, 250)).add(new PrefMapRegion(12, new TileArea(24, 24, 40, 40), 2, 80)).add(new PrefMapRegion(0, new TileArea(4, 4, 60, 40), 1, 100));
assertTrue(media.getFile().delete());
}
use of com.b3dgs.lionengine.game.feature.tile.map.transition.circuit.MapTileCircuitModel in project lionengine by b3dgs.
the class MapGeneratorImpl method generateMap.
/*
* MapGenerator
*/
@Override
public MapTile generateMap(GeneratorParameter parameters, Collection<Media> levels, Media sheetsConfig, Media groupsConfig) {
final MapTileGame map = new MapTileGame();
map.loadSheets(sheetsConfig);
final MapTileGroup mapGroup = map.addFeatureAndGet(new MapTileGroupModel());
final MapTileTransition mapTransition = map.addFeatureAndGet(new MapTileTransitionModel());
final MapTileCircuit mapCircuit = map.addFeatureAndGet(new MapTileCircuitModel());
mapGroup.loadGroups(groupsConfig);
mapTransition.loadTransitions(levels, sheetsConfig, groupsConfig);
mapCircuit.loadCircuits(levels, sheetsConfig, groupsConfig);
parameters.apply(map);
return map;
}
Aggregations