diff --git a/core/assets/spritesheets/platformSet.png b/core/assets/spritesheets/platformSet.png index 62cef18..c09d717 100644 Binary files a/core/assets/spritesheets/platformSet.png and b/core/assets/spritesheets/platformSet.png differ diff --git a/core/assets/textures/level1Intro.png b/core/assets/textures/level1Intro.png new file mode 100644 index 0000000..0ed2228 Binary files /dev/null and b/core/assets/textures/level1Intro.png differ diff --git a/core/assets/textures/level2Intro.png b/core/assets/textures/level2Intro.png new file mode 100644 index 0000000..c8e3b77 Binary files /dev/null and b/core/assets/textures/level2Intro.png differ diff --git a/core/src/com/game/Screens/Loading.java b/core/src/com/game/Screens/Loading.java index a4ad47c..56b1850 100644 --- a/core/src/com/game/Screens/Loading.java +++ b/core/src/com/game/Screens/Loading.java @@ -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); diff --git a/core/src/com/game/Screens/Play.java b/core/src/com/game/Screens/Play.java index 1ae951a..1446b98 100644 --- a/core/src/com/game/Screens/Play.java +++ b/core/src/com/game/Screens/Play.java @@ -61,6 +61,12 @@ public class Play extends AbstractScreen { private Player player; private ArrayList platforms = new ArrayList(); + // 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);