diff --git a/core/src/com/trs/main/Main.java b/core/src/com/trs/main/Main.java index 1f59d38..9a134ec 100644 --- a/core/src/com/trs/main/Main.java +++ b/core/src/com/trs/main/Main.java @@ -4,6 +4,8 @@ import com.badlogic.gdx.Game; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.GL20; import com.trs.main.view.screens.GameScreen; +import com.trs.main.view.screens.InventoryScreen; +import com.trs.main.view.screens.MenuScreen; public class Main extends Game{ @@ -15,6 +17,12 @@ public class Main extends Game{ public static int gamestate = 0; public static float CAMERA_WIDTH = 1280; public static float CAMERA_HEIGHT = 720; + + MenuScreen menuScreen; + GameScreen gameScreen; + InventoryScreen inventoryScreen; + + @Override public void create () { diff --git a/core/src/com/trs/main/MapContainer.java b/core/src/com/trs/main/MapContainer.java index 0b404ef..ec17c3f 100644 --- a/core/src/com/trs/main/MapContainer.java +++ b/core/src/com/trs/main/MapContainer.java @@ -99,7 +99,6 @@ public class MapContainer { doors = new Door[tempDoors.size()]; for(int i = 0; i < doors.length; i++) { doors[i] = tempDoors.get(i); - if(i == inDoor) { int facing = doors[i].exit; diff --git a/core/src/com/trs/main/view/screens/AbstractScreen.java b/core/src/com/trs/main/view/screens/AbstractScreen.java index 1949ea4..bb709dd 100644 --- a/core/src/com/trs/main/view/screens/AbstractScreen.java +++ b/core/src/com/trs/main/view/screens/AbstractScreen.java @@ -16,10 +16,12 @@ public abstract class AbstractScreen implements Screen{ protected Game game; + protected boolean paused; public AbstractScreen(Game game, float CAMERA_WIDTH, float CAMERA_HEIGHT) { this.game = game; + this.paused = true; } @Override diff --git a/core/src/com/trs/main/view/screens/GameScreen.java b/core/src/com/trs/main/view/screens/GameScreen.java index 918f1b3..35e1432 100644 --- a/core/src/com/trs/main/view/screens/GameScreen.java +++ b/core/src/com/trs/main/view/screens/GameScreen.java @@ -57,10 +57,12 @@ public class GameScreen extends AbstractScreen{ @Override public void pause() { + paused = true; } @Override public void resume() { + paused = false; } @Override diff --git a/core/src/com/trs/main/view/screens/InventoryScreen.java b/core/src/com/trs/main/view/screens/InventoryScreen.java new file mode 100644 index 0000000..e6f02ac --- /dev/null +++ b/core/src/com/trs/main/view/screens/InventoryScreen.java @@ -0,0 +1,56 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.trs.main.view.screens; + +import com.badlogic.gdx.Game; + +/** + * + * @author Jan + */ +public class InventoryScreen extends AbstractScreen{ + + /** + * TODO: Inventorydata? | Playerdata in constructor? own function? resume? + * @param game + * @param CAMERA_WIDTH + * @param CAMERA_HEIGHT + */ + public InventoryScreen(Game game, float CAMERA_WIDTH, float CAMERA_HEIGHT) { + super(game, CAMERA_WIDTH, CAMERA_HEIGHT); + } + + @Override + public void show() { + } + + @Override + public void render(float f) { + } + + @Override + public void resize(int i, int i1) { + } + + @Override + public void pause() { + } + + @Override + public void resume() { + paused = false; + } + + @Override + public void hide() { + paused = true; + } + + @Override + public void dispose() { + } + +} diff --git a/core/src/com/trs/main/view/screens/MenuScreen.java b/core/src/com/trs/main/view/screens/MenuScreen.java new file mode 100644 index 0000000..ace233e --- /dev/null +++ b/core/src/com/trs/main/view/screens/MenuScreen.java @@ -0,0 +1,62 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.trs.main.view.screens; + +import com.badlogic.gdx.Game; +import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.scenes.scene2d.Stage; +import com.badlogic.gdx.utils.viewport.FitViewport; + +/** + * + * @author Jan + */ +public class MenuScreen extends AbstractScreen{ + + Stage stage; + OrthographicCamera camera; + + public MenuScreen(Game game, float CAMERA_WIDTH, float CAMERA_HEIGHT) { + super(game, CAMERA_WIDTH, CAMERA_HEIGHT); + camera = new OrthographicCamera(); + camera.setToOrtho(false, CAMERA_WIDTH, CAMERA_HEIGHT); + camera.update(); + stage = new Stage(new FitViewport(CAMERA_WIDTH, CAMERA_HEIGHT, camera)); + Gdx.input.setInputProcessor(stage); + } + + @Override + public void show() { + } + + @Override + public void render(float f) { + } + + @Override + public void resize(int i, int i1) { + } + + @Override + public void pause() { + paused = true; + } + + @Override + public void resume() { + paused = false; + } + + @Override + public void hide() { + } + + @Override + public void dispose() { + } + +}