Jan Ehehalt 6 years ago
parent 2124035fa2
commit 4c24bb0308

@ -152,7 +152,7 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
else{ else{
ls.dispose(); ls.dispose();
ls = null; ls = null;
gs = new Gamescreen(level, GAME_WORLD_WIDTH, GAME_WORLD_HEIGHT); gs = new Gamescreen(level, GAME_WORLD_WIDTH, GAME_WORLD_HEIGHT, camera);
stepTimer.start(); stepTimer.start();
} }
} }
@ -166,10 +166,10 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
ls = new Levelscreen(levelAmount, GAME_WORLD_WIDTH, GAME_WORLD_HEIGHT); ls = new Levelscreen(levelAmount, GAME_WORLD_WIDTH, GAME_WORLD_HEIGHT);
} }
else if(x < Gdx.graphics.getWidth() * 0.66){ else if(x < Gdx.graphics.getWidth() * 0.66){
gs = new Gamescreen(level, GAME_WORLD_WIDTH, GAME_WORLD_HEIGHT); gs = new Gamescreen(level, GAME_WORLD_WIDTH, GAME_WORLD_HEIGHT, camera);
} }
else{ else{
gs = new Gamescreen(level, GAME_WORLD_WIDTH, GAME_WORLD_HEIGHT); gs = new Gamescreen(level, GAME_WORLD_WIDTH, GAME_WORLD_HEIGHT, camera);
} }
ws = null; ws = null;
} }

@ -35,7 +35,7 @@ public class Gamescreen{
float GAME_WORLD_WIDTH; float GAME_WORLD_WIDTH;
float GAME_WORLD_HEIGHT; float GAME_WORLD_HEIGHT;
public Gamescreen(Level level, float width, float height){ public Gamescreen(Level level, float width, float height, OrthographicCamera camera){
GAME_WORLD_WIDTH = width; GAME_WORLD_WIDTH = width;
GAME_WORLD_HEIGHT = height; GAME_WORLD_HEIGHT = height;
pivotX = level.getPivotX(); pivotX = level.getPivotX();
@ -48,7 +48,7 @@ public class Gamescreen{
//goalRight = new Rectangle(g.getxPos() + 0.1f * g.getSizeX() + 0.8f * g.getSizeX(), g.getyPos(), 0.1f * g.getSizeX(),g.getSizeY()); //goalRight = new Rectangle(g.getxPos() + 0.1f * g.getSizeX() + 0.8f * g.getSizeX(), g.getyPos(), 0.1f * g.getSizeX(),g.getSizeY());
shapeRenderer = new ShapeRenderer(); shapeRenderer = new ShapeRenderer();
shapeRenderer.setProjectionMatrix(camera.combined);
} }

Loading…
Cancel
Save