Search in sources :

Example 1 with MapTileTransitionModel

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();
}
Also used : PrefMapSize(com.b3dgs.lionengine.game.feature.tile.map.transition.circuit.generator.PrefMapSize) TileArea(com.b3dgs.lionengine.game.feature.tile.map.transition.circuit.generator.TileArea) PrefMapRegion(com.b3dgs.lionengine.game.feature.tile.map.transition.circuit.generator.PrefMapRegion) PrefMapFill(com.b3dgs.lionengine.game.feature.tile.map.transition.circuit.generator.PrefMapFill) MapTileGroupModel(com.b3dgs.lionengine.game.feature.tile.map.MapTileGroupModel) MapTileTransitionModel(com.b3dgs.lionengine.game.feature.tile.map.transition.MapTileTransitionModel) TileRef(com.b3dgs.lionengine.game.feature.tile.TileRef) MapTileCircuitModel(com.b3dgs.lionengine.game.feature.tile.map.transition.circuit.MapTileCircuitModel)

Example 2 with MapTileTransitionModel

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;
}
Also used : Services(com.b3dgs.lionengine.game.feature.Services) MapTileTransitionModel(com.b3dgs.lionengine.game.feature.tile.map.transition.MapTileTransitionModel) MapTileCircuitModel(com.b3dgs.lionengine.game.feature.tile.map.transition.circuit.MapTileCircuitModel)

Example 3 with MapTileTransitionModel

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);
}
Also used : Services(com.b3dgs.lionengine.game.feature.Services) MapTileGroup(com.b3dgs.lionengine.game.feature.tile.map.MapTileGroup) MapTileTransition(com.b3dgs.lionengine.game.feature.tile.map.transition.MapTileTransition) Media(com.b3dgs.lionengine.Media) MapTileGroupModel(com.b3dgs.lionengine.game.feature.tile.map.MapTileGroupModel) MapTileTransitionModel(com.b3dgs.lionengine.game.feature.tile.map.transition.MapTileTransitionModel) MapTile(com.b3dgs.lionengine.game.feature.tile.map.MapTile) HashSet(java.util.HashSet)

Example 4 with MapTileTransitionModel

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;
}
Also used : Services(com.b3dgs.lionengine.game.feature.Services) MapTileGroup(com.b3dgs.lionengine.game.feature.tile.map.MapTileGroup) MapTileTransition(com.b3dgs.lionengine.game.feature.tile.map.transition.MapTileTransition) MapTileCircuit(com.b3dgs.lionengine.game.feature.tile.map.transition.circuit.MapTileCircuit) MapTileGroupModel(com.b3dgs.lionengine.game.feature.tile.map.MapTileGroupModel) MapTileTransitionModel(com.b3dgs.lionengine.game.feature.tile.map.transition.MapTileTransitionModel) MapTile(com.b3dgs.lionengine.game.feature.tile.map.MapTile) MapTileCircuitModel(com.b3dgs.lionengine.game.feature.tile.map.transition.circuit.MapTileCircuitModel)

Aggregations

MapTileTransitionModel (com.b3dgs.lionengine.game.feature.tile.map.transition.MapTileTransitionModel)4 Services (com.b3dgs.lionengine.game.feature.Services)3 MapTileGroupModel (com.b3dgs.lionengine.game.feature.tile.map.MapTileGroupModel)3 MapTileCircuitModel (com.b3dgs.lionengine.game.feature.tile.map.transition.circuit.MapTileCircuitModel)3 MapTile (com.b3dgs.lionengine.game.feature.tile.map.MapTile)2 MapTileGroup (com.b3dgs.lionengine.game.feature.tile.map.MapTileGroup)2 MapTileTransition (com.b3dgs.lionengine.game.feature.tile.map.transition.MapTileTransition)2 Media (com.b3dgs.lionengine.Media)1 TileRef (com.b3dgs.lionengine.game.feature.tile.TileRef)1 MapTileCircuit (com.b3dgs.lionengine.game.feature.tile.map.transition.circuit.MapTileCircuit)1 PrefMapFill (com.b3dgs.lionengine.game.feature.tile.map.transition.circuit.generator.PrefMapFill)1 PrefMapRegion (com.b3dgs.lionengine.game.feature.tile.map.transition.circuit.generator.PrefMapRegion)1 PrefMapSize (com.b3dgs.lionengine.game.feature.tile.map.transition.circuit.generator.PrefMapSize)1 TileArea (com.b3dgs.lionengine.game.feature.tile.map.transition.circuit.generator.TileArea)1 HashSet (java.util.HashSet)1