use of com.b3dgs.lionengine.game.feature.tile.map.transition.MapTileTransitionModel in project lionengine by b3dgs.
the class Scene method load.
@Override
public void load() {
map.create(Medias.create("forest.png"));
mapViewer.prepare(map);
map.addFeatureAndGet(new MapTileGroupModel()).loadGroups(Medias.create("groups.xml"));
map.addFeatureAndGet(new MapTileTransitionModel(services)).loadTransitions(Medias.create("transitions.xml"));
map.addFeatureAndGet(new MapTileCircuitModel(services)).loadCircuits(Medias.create("circuits.xml"));
camera.setView(0, 0, 1024, 768, getHeight());
camera.setLimits(map);
parameters.add(new PrefMapSize(16, 16, 64, 48)).add(new PrefMapFill(new TileRef(0, 0))).add(new PrefMapRegion(new TileRef(0, 12), new TileArea(0, 0, 8, 48), 4, 60)).add(new PrefMapRegion(new TileRef(0, 12), new TileArea(56, 0, 64, 48), 4, 60)).add(new PrefMapRegion(new TileRef(0, 12), new TileArea(0, 0, 64, 8), 4, 60)).add(new PrefMapRegion(new TileRef(0, 12), new TileArea(0, 40, 64, 48), 4, 60)).add(new PrefMapRegion(new TileRef(0, 29), new TileArea(12, 12, 56, 42), 2, 250)).add(new PrefMapRegion(new TileRef(0, 12), new TileArea(24, 24, 40, 40), 2, 80)).add(new PrefMapRegion(new TileRef(0, 0), new TileArea(4, 4, 60, 40), 1, 100));
timingGen.start();
timing.start();
}
use of com.b3dgs.lionengine.game.feature.tile.map.transition.MapTileTransitionModel 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 MapTile createMap(int size) {
final Services services = new Services();
final MapTileGame map = services.add(new MapTileGame());
final MapTileGroup mapGroup = new MapTileGroupModel();
map.addFeature(mapGroup);
map.addFeature(new MapTileTransitionModel(services));
map.addFeature(new MapTileCircuitModel(services));
map.create(1, 1, size, size);
setGroups(map);
return map;
}
use of com.b3dgs.lionengine.game.feature.tile.map.transition.MapTileTransitionModel in project lionengine by b3dgs.
the class CircuitsExtractorImpl method getCircuits.
/*
* CircuitsExtractor
*/
@Override
public Map<Circuit, Collection<TileRef>> getCircuits(Collection<Media> levels, Media sheetsConfig, Media groupsConfig) {
final Collection<MapTile> mapsSet = new HashSet<>(levels.size());
for (final Media level : levels) {
final Services services = new Services();
final MapTile map = services.create(MapTileGame.class);
map.create(level, sheetsConfig);
final MapTileGroup mapGroup = map.addFeatureAndGet(new MapTileGroupModel());
final MapTileTransition mapTransition = map.addFeatureAndGet(new MapTileTransitionModel(services));
mapGroup.loadGroups(groupsConfig);
mapTransition.loadTransitions(levels, sheetsConfig, groupsConfig);
mapsSet.add(map);
}
return getCircuits(mapsSet);
}
use of com.b3dgs.lionengine.game.feature.tile.map.transition.MapTileTransitionModel 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 Services services = new Services();
final MapTile map = services.create(MapTileGame.class);
map.loadSheets(sheetsConfig);
final MapTileGroup mapGroup = map.addFeatureAndGet(new MapTileGroupModel());
final MapTileTransition mapTransition = map.addFeatureAndGet(new MapTileTransitionModel(services));
final MapTileCircuit mapCircuit = map.addFeatureAndGet(new MapTileCircuitModel(services));
mapGroup.loadGroups(groupsConfig);
mapTransition.loadTransitions(levels, sheetsConfig, groupsConfig);
mapCircuit.loadCircuits(levels, sheetsConfig, groupsConfig);
parameters.apply(map);
return map;
}
Aggregations