Jan Ehehalt 6 years ago
parent 582f8c6533
commit 7456a0afb6

@ -86,12 +86,17 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
@Override @Override
public void create(){ public void create(){
GAME_WORLD_HEIGHT = 900;
GAME_WORLD_WIDTH = 1600; GAME_WORLD_WIDTH = 1600;
GAME_WORLD_HEIGHT = 900;
camera = null;
viewport = null;
camera = new OrthographicCamera(); camera = new OrthographicCamera();
camera.update();
viewport = new StretchViewport(GAME_WORLD_WIDTH, GAME_WORLD_HEIGHT, camera); viewport = new StretchViewport(GAME_WORLD_WIDTH, GAME_WORLD_HEIGHT, camera);
viewport.update(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
viewport.apply(); viewport.apply();
camera.position.set(GAME_WORLD_WIDTH / 2, GAME_WORLD_HEIGHT / 2, 0); camera.position.set(GAME_WORLD_WIDTH / 2, GAME_WORLD_HEIGHT / 2, 0);
camera.update();
checkDoor = true; checkDoor = true;
checkDie = true; checkDie = true;
@ -297,7 +302,9 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
if(delete || d.getCurrentEntities()[i].isToDelete()){ if(delete || d.getCurrentEntities()[i].isToDelete()){
if(d.getCurrentEntities()[i].getType()== 2){ if(d.getCurrentEntities()[i].getType()== 2){
d.getPlayer().addExp(d.getCurrentEntities()[i].getExp()); d.getPlayer().addExp(d.getCurrentEntities()[i].getExp());
System.out.println(d.getCurrentEntities()[i].getExp());
d.getCurrentEntities()[i] = null; d.getCurrentEntities()[i] = null;
gs.deleteEntitySprite(i); gs.deleteEntitySprite(i);
} }
else{ else{
@ -335,7 +342,7 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
Gdx.gl.glClearColor(0, 0, 0, 1); Gdx.gl.glClearColor(0, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
if(end == true){ if(end){
if(es == null){ if(es == null){
isPaused = true; isPaused = true;
entityMovement.stop(); entityMovement.stop();
@ -974,12 +981,36 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
case 1: case 1:
mm.cleanUp(); mm.cleanUp();
mm = null; mm = null;
GAME_WORLD_WIDTH = 700;
GAME_WORLD_HEIGHT = 394;
camera = null;
viewport = null;
camera = new OrthographicCamera();
camera.update();
viewport = new StretchViewport(GAME_WORLD_WIDTH, GAME_WORLD_HEIGHT, camera);
viewport.update(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
viewport.apply();
camera.position.set(GAME_WORLD_WIDTH / 2 - 170, GAME_WORLD_HEIGHT / 2 + 20, 0);
camera.update();
batch.setProjectionMatrix(camera.combined);
gs = new GameScreen(d, volume); gs = new GameScreen(d, volume);
break; break;
case 2: case 2:
mm.hide(); mm.hide();
cs = null; cs = null;
GAME_WORLD_WIDTH = 1600;
GAME_WORLD_HEIGHT = 900;
camera = null;
viewport = null;
camera = new OrthographicCamera();
camera.update();
viewport = new StretchViewport(GAME_WORLD_WIDTH, GAME_WORLD_HEIGHT, camera);
viewport.update(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
viewport.apply();
camera.position.set(GAME_WORLD_WIDTH / 2, GAME_WORLD_HEIGHT / 2, 0);
camera.update();
batch.setProjectionMatrix(camera.combined);
ss = new SettingsScreen(); ss = new SettingsScreen();
break; break;
@ -1031,6 +1062,7 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
} }
break; break;
case 11: case 11:
create(); create();
break; break;

@ -544,9 +544,11 @@ public class GameScreen {
} }
public void deleteEntitySprite(int i){ public void deleteEntitySprite(int i){
entitySprites[i].getSprites()[0].getTexture().dispose();
entitySprites[i] = null; entitySprites[i] = null;
} }
public void updateDamageContainer(){ public void updateDamageContainer(){
for(int x = 0; x < dmgContainer.length; x++){ for(int x = 0; x < dmgContainer.length; x++){
if(dmgContainer[x] != null){ if(dmgContainer[x] != null){

Loading…
Cancel
Save