CannonShooter/core/src/de/samdev/cannonshooter/level/StandardLevel.java

38 lines
1.0 KiB
Java
Raw Normal View History

2015-08-29 12:18:10 +02:00
package de.samdev.cannonshooter.level;
2015-09-14 16:40:30 +02:00
import com.badlogic.gdx.math.Vector2;
2015-08-29 12:18:10 +02:00
import de.samdev.absgdx.framework.AgdxGame;
import de.samdev.absgdx.framework.layer.GameLayer;
import de.samdev.absgdx.framework.map.TileMap;
2015-09-17 15:35:24 +02:00
import de.samdev.absgdx.framework.map.background.RepeatingBackground;
2015-09-14 16:40:30 +02:00
import de.samdev.absgdx.framework.map.mapscaleresolver.ShowCompleteMapScaleResolver;
2015-08-29 12:18:10 +02:00
import de.samdev.cannonshooter.Textures;
2015-09-14 16:40:30 +02:00
import de.samdev.cannonshooter.entities.Cannon;
2015-08-29 12:18:10 +02:00
public class StandardLevel extends GameLayer {
public StandardLevel(AgdxGame owner) {
super(owner, TileMap.createEmptyMap(32, 20));
2015-09-14 16:40:30 +02:00
2015-09-17 15:35:24 +02:00
addBackground(new RepeatingBackground(Textures.texbackground, 1/32f));
2015-09-14 16:40:30 +02:00
setMapScaleResolver(new ShowCompleteMapScaleResolver());
addEntity(new Cannon(10, 10));
2015-09-14 16:40:30 +02:00
}
@Override
public void onResize() {
super.onResize();
// Center Map
2015-09-14 16:40:30 +02:00
setRawOffset(new Vector2(-(getVisibleMapBox().width - getMap().width)/2, -(getVisibleMapBox().height - getMap().height)/2));
2015-08-29 12:18:10 +02:00
}
@Override
public void onUpdate(float arg0) {
//
2015-08-29 12:18:10 +02:00
}
}