This commit is contained in:
Rumps 2016-02-14 15:25:27 +00:00
parent fdae895cf9
commit a7ee3d7de7
5 changed files with 39 additions and 1 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

View File

@ -103,6 +103,8 @@ public class Loading extends AbstractScreen {
app.assets.load("textures/pauseBackground.png", Texture.class);
app.assets.load("textures/failureBackground.png", Texture.class);
app.assets.load("textures/successBackground.png", Texture.class);
app.assets.load("textures/level1Intro.png", Texture.class);
app.assets.load("textures/level2Intro.png", Texture.class);
app.assets.load("textures/pauseGlow.png", Texture.class);
app.assets.load("textures/position0.png", Texture.class);
app.assets.load("textures/position1.png", Texture.class);

View File

@ -61,6 +61,12 @@ public class Play extends AbstractScreen {
private Player player;
private ArrayList<Platform> platforms = new ArrayList<Platform>();
// Intro window
private boolean isIntro;
private Window introWindow;
private Image introBackground;
private TextButton butProceed;
// Pause window
private boolean isPaused;
private Window pauseWindow;
@ -96,7 +102,9 @@ public class Play extends AbstractScreen {
b2dCam = new OrthographicCamera();
b2dCam.setToOrtho(false, Vars.SCREEN_WIDTH / PPM, Vars.SCREEN_HEIGHT / PPM);
isIntro = true;
isPaused = false;
buttonSize = new Vector2(50, 50);
isEnd = false;
@ -112,13 +120,14 @@ public class Play extends AbstractScreen {
skin.load(Gdx.files.internal("spritesheets/uiskin.json"));
initLevel();
initIntroWindow();
initPauseWindow();
initEndgameWindow(false);
}
@Override
public void update(float dt) {
if(!isPaused && !isEnd)
if(!isPaused && !isEnd && !isIntro)
{
world.step(dt, 6, 2);
@ -185,6 +194,7 @@ public class Play extends AbstractScreen {
if(Gdx.input.isKeyJustPressed(Input.Keys.ESCAPE))
{
isPaused = !isPaused;
isPaused = !isPaused;
System.out.println("isPaused: " + isPaused);
}
@ -285,6 +295,32 @@ public class Play extends AbstractScreen {
Box2dUtils.makeChain(body, finalV, userData, isSensor, Vars.BIT_MISC, Vars.BIT_PLAYER);
}
private void initIntroWindow()
{
introWindow = new Window("Level "+levelNumber, skin);
introWindow.getTitleLabel().setPosition(350, 500);
introBackground = new Image(app.assets.get("textures/level"+levelNumber+"Intro.png", Texture.class));
introWindow.setBackground(introBackground.getDrawable());
introWindow.setSize(700, 500);
introWindow.setPosition(280, 50);
introWindow.setVisible(true);
butProceed = new TextButton("PROCEED", skin, "default");
butProceed.setPosition((introWindow.getWidth() / 4) * 3, buttonSize.y + 360);
butProceed.setSize(buttonSize.x, buttonSize.y);
butProceed.addListener(new ClickListener() {
@Override
public void clicked(com.badlogic.gdx.scenes.scene2d.InputEvent event, float x, float y) {
introWindow.setVisible(false);
isIntro = false;
}
});
introWindow.addActor(butProceed);
stage.addActor(introWindow);
}
private void initPauseWindow()
{
pauseWindow = new Window("Paused", skin);