2015-04-10 13:57:40 +02:00
|
|
|
package de.samdev.cannonshooter;
|
|
|
|
|
2015-08-29 12:18:10 +02:00
|
|
|
import com.badlogic.gdx.Gdx;
|
2015-09-14 16:40:30 +02:00
|
|
|
import com.badlogic.gdx.Input.Keys;
|
2015-08-29 12:18:10 +02:00
|
|
|
import com.badlogic.gdx.graphics.g2d.BitmapFont;
|
|
|
|
|
2015-04-10 14:10:32 +02:00
|
|
|
import de.samdev.absgdx.framework.AgdxGame;
|
2015-09-25 14:59:20 +02:00
|
|
|
import de.samdev.absgdx.framework.util.exceptions.AgdxTexDefException;
|
2015-08-29 12:18:10 +02:00
|
|
|
import de.samdev.cannonshooter.level.StandardLevel;
|
2015-04-10 14:10:32 +02:00
|
|
|
|
|
|
|
public class CannonGame extends AgdxGame {
|
2015-04-10 13:57:40 +02:00
|
|
|
|
|
|
|
@Override
|
2015-04-10 14:10:32 +02:00
|
|
|
public void onCreate() {
|
2015-09-25 14:59:20 +02:00
|
|
|
try {
|
|
|
|
Textures.init();
|
|
|
|
} catch (AgdxTexDefException e) {
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
}
|
2015-08-29 12:18:10 +02:00
|
|
|
|
2015-09-14 16:40:30 +02:00
|
|
|
setLayer(new StandardLevel(this));
|
2015-04-10 14:10:32 +02:00
|
|
|
|
2015-08-29 12:18:10 +02:00
|
|
|
setDebugFont(new BitmapFont(Gdx.files.internal("consolefont.fnt")));
|
2015-09-14 16:40:30 +02:00
|
|
|
|
|
|
|
settings.debugVisualMenu.set(false);
|
2015-09-17 12:34:58 +02:00
|
|
|
settings.debugMenuLayerTextInfos.set(true);
|
|
|
|
settings.debugGameLayerMenuTextInfos.set(false);
|
2015-09-18 15:04:14 +02:00
|
|
|
|
|
|
|
settings.debugEnabled.set(false);
|
2015-04-10 13:57:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2015-09-14 16:40:30 +02:00
|
|
|
public void onUpdate(float delta) {
|
2015-09-20 17:40:22 +02:00
|
|
|
if (Gdx.input.isKeyJustPressed(Keys.F1) || Gdx.input.isKeyJustPressed(Keys.MENU)) settings.debugEnabled.doSwitch();
|
2015-09-14 16:40:30 +02:00
|
|
|
if (Gdx.input.isKeyJustPressed(Keys.F2)) settings.debugVisualEntities.doSwitch();
|
|
|
|
if (Gdx.input.isKeyJustPressed(Keys.F3)) settings.debugVisualMap.doSwitch();
|
|
|
|
if (Gdx.input.isKeyJustPressed(Keys.F4)) settings.debugVisualMenu.doSwitch();
|
|
|
|
if (Gdx.input.isKeyJustPressed(Keys.F5)) settings.debugTextInfos.doSwitch();
|
|
|
|
if (Gdx.input.isKeyJustPressed(Keys.F6)) settings.debugEntitiesPhysicVectors.doSwitch();
|
2015-04-10 13:57:40 +02:00
|
|
|
}
|
|
|
|
}
|