merge
master
Jonathan Hager 5 years ago
commit 8ffad9c22c

@ -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 () {

@ -111,7 +111,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;

@ -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

@ -57,10 +57,12 @@ public class GameScreen extends AbstractScreen{
@Override
public void pause() {
paused = true;
}
@Override
public void resume() {
paused = false;
}
@Override

@ -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() {
}
}

@ -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() {
}
}
Loading…
Cancel
Save