Search in sources :

Example 6 with Camera

use of com.b3dgs.lionengine.game.feature.Camera in project lionengine by b3dgs.

the class MapTilePathModelTest method prepare.

/**
 * Prepare test.
 */
@BeforeEach
public void prepare() {
    services.add(new Camera());
    map.addFeature(new MapTileGroupModel());
    map.create(1, 1, 7, 7);
    UtilMap.setGroups(map);
    UtilMap.fill(map, UtilMap.TILE_GROUND);
    mapPath = map.addFeatureAndGet(new MapTilePathModel());
    mapPath.prepare(map);
    mapPath.loadPathfinding(Medias.create("pathfinding.xml"));
}
Also used : MapTileGroupModel(com.b3dgs.lionengine.game.feature.tile.map.MapTileGroupModel) Camera(com.b3dgs.lionengine.game.feature.Camera) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 7 with Camera

use of com.b3dgs.lionengine.game.feature.Camera in project lionengine by b3dgs.

the class UtilAssignable method createServices.

/**
 * Create the services.
 *
 * @param clicked The click flag.
 * @param clickNumber The click number recorded.
 * @return The services.
 */
public static Services createServices(final AtomicBoolean clicked, final AtomicInteger clickNumber) {
    final Services services = new Services();
    final Camera camera = services.create(Camera.class);
    camera.setView(0, 0, 32, 32, 32);
    final Cursor cursor = services.add(new Cursor() {

        @Override
        public boolean hasClickedOnce(int click) {
            clickNumber.set(click);
            return clicked.get();
        }
    });
    cursor.setArea(0, 0, 64, 64);
    cursor.setLocation(0, 1);
    return services;
}
Also used : Services(com.b3dgs.lionengine.game.feature.Services) Camera(com.b3dgs.lionengine.game.feature.Camera) Cursor(com.b3dgs.lionengine.game.Cursor)

Example 8 with Camera

use of com.b3dgs.lionengine.game.feature.Camera in project lionengine by b3dgs.

the class MapTileRasteredModelTest method prepare.

/**
 * Prepare test.
 */
@BeforeEach
public void prepare() {
    services.add(new Camera());
    viewer = services.add(new ViewerMock());
    viewer.set(-20, -20);
    map = services.add(new MapTileGame());
    mapViewer = new MapTileViewerModel(services);
    mapViewer.prepare(map);
    mapRastered = new MapTileRasteredModel();
    mapRastered.prepare(map);
}
Also used : ViewerMock(com.b3dgs.lionengine.ViewerMock) MapTileGame(com.b3dgs.lionengine.game.feature.tile.map.MapTileGame) Camera(com.b3dgs.lionengine.game.feature.Camera) MapTileViewerModel(com.b3dgs.lionengine.game.feature.tile.map.viewer.MapTileViewerModel) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 9 with Camera

use of com.b3dgs.lionengine.game.feature.Camera in project lionengine by b3dgs.

the class MapTileViewerModelTest method prepare.

/**
 * Prepare test.
 */
@BeforeEach
public void prepare() {
    services.add(new Camera());
    viewer = services.add(new ViewerMock());
    viewer.set(-20, -20);
    map = services.add(new MapTileGame());
    mapViewer = new MapTileViewerModel(services);
    mapViewer.prepare(map);
}
Also used : ViewerMock(com.b3dgs.lionengine.ViewerMock) MapTileGame(com.b3dgs.lionengine.game.feature.tile.map.MapTileGame) Camera(com.b3dgs.lionengine.game.feature.Camera) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 10 with Camera

use of com.b3dgs.lionengine.game.feature.Camera in project lionengine by b3dgs.

the class SelectorRefresherTest method prepare.

/**
 * Prepare test.
 */
@BeforeEach
public void prepare() {
    services.add(new ContextMock());
    services.add(new Camera());
    services.add(new ViewerMock());
    cursor = services.create(Cursor.class);
    cursor.setSync(mouse);
    final Featurable featurable = new FeaturableModel(services, setup);
    featurable.addFeature(new LayerableModel(services, setup));
    featurable.addFeature(new TransformableModel(services, setup));
    featurable.addFeature(new CollidableModel(services, setup));
    refresher = new SelectorRefresher(services, model);
    refresher.addListener(listener);
    refresher.prepare(featurable);
}
Also used : CollidableModel(com.b3dgs.lionengine.game.feature.collidable.CollidableModel) ViewerMock(com.b3dgs.lionengine.ViewerMock) TransformableModel(com.b3dgs.lionengine.game.feature.TransformableModel) FeaturableModel(com.b3dgs.lionengine.game.feature.FeaturableModel) Camera(com.b3dgs.lionengine.game.feature.Camera) ContextMock(com.b3dgs.lionengine.ContextMock) Cursor(com.b3dgs.lionengine.game.Cursor) Featurable(com.b3dgs.lionengine.game.feature.Featurable) SelectorRefresher(com.b3dgs.lionengine.game.feature.collidable.selector.SelectorRefresher) LayerableModel(com.b3dgs.lionengine.game.feature.LayerableModel) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

Camera (com.b3dgs.lionengine.game.feature.Camera)10 BeforeEach (org.junit.jupiter.api.BeforeEach)6 Services (com.b3dgs.lionengine.game.feature.Services)4 ViewerMock (com.b3dgs.lionengine.ViewerMock)3 Cursor (com.b3dgs.lionengine.game.Cursor)3 Featurable (com.b3dgs.lionengine.game.feature.Featurable)3 FeaturableModel (com.b3dgs.lionengine.game.feature.FeaturableModel)3 Transformable (com.b3dgs.lionengine.game.feature.Transformable)3 TransformableModel (com.b3dgs.lionengine.game.feature.TransformableModel)3 MapTileGame (com.b3dgs.lionengine.game.feature.tile.map.MapTileGame)3 MapTileGroupModel (com.b3dgs.lionengine.game.feature.tile.map.MapTileGroupModel)3 ContextMock (com.b3dgs.lionengine.ContextMock)2 Medias (com.b3dgs.lionengine.Medias)2 Handler (com.b3dgs.lionengine.game.feature.Handler)2 MirrorableModel (com.b3dgs.lionengine.game.feature.MirrorableModel)2 Context (com.b3dgs.lionengine.Context)1 Engine (com.b3dgs.lionengine.Engine)1 Media (com.b3dgs.lionengine.Media)1 Origin (com.b3dgs.lionengine.Origin)1 Resolution (com.b3dgs.lionengine.Resolution)1