diff --git a/source/core/src/main/com/csse3200/game/components/maingame/MainGameDisplay.java b/source/core/src/main/com/csse3200/game/components/maingame/MainGameDisplay.java index 221a316cd..a96d09a7f 100644 --- a/source/core/src/main/com/csse3200/game/components/maingame/MainGameDisplay.java +++ b/source/core/src/main/com/csse3200/game/components/maingame/MainGameDisplay.java @@ -15,7 +15,6 @@ import com.badlogic.gdx.scenes.scene2d.utils.ClickListener; import com.badlogic.gdx.utils.Array; import com.csse3200.game.GdxGame; -import com.csse3200.game.components.pausemenu.PauseMenuButtonComponent; import com.csse3200.game.entities.Entity; import com.csse3200.game.entities.factories.PauseMenuFactory; import com.csse3200.game.screens.TowerType; @@ -316,6 +315,7 @@ public void clicked(InputEvent event, float x, float y) { towerTable.add(tower3).padRight(10f); towerTable.add(tower4).padRight(10f); towerTable.add(tower5).padRight(10f); + towerTable.stack(new Label(String.format("%s", towers.get(0).getPrice()), getSkin())); towerTable.row(); towerTable.add("1", "small"); towerTable.add("2", "small"); diff --git a/source/core/src/main/com/csse3200/game/components/pausemenu/PauseMenuButtonComponent.java b/source/core/src/main/com/csse3200/game/components/pausemenu/PauseMenuButtonComponent.java index 0f4dafbee..cb130da50 100644 --- a/source/core/src/main/com/csse3200/game/components/pausemenu/PauseMenuButtonComponent.java +++ b/source/core/src/main/com/csse3200/game/components/pausemenu/PauseMenuButtonComponent.java @@ -123,7 +123,15 @@ public void changed(ChangeEvent changeEvent, Actor actor) { window.setHeight(windowSizeY); window.setX((ServiceLocator.getRenderService().getStage().getWidth() / 2) - (windowSizeX / 2)); window.setY((ServiceLocator.getRenderService().getStage().getHeight() / 2) - (windowSizeY / 2)); - window.addAction(Actions.fadeIn(0.8f, Interpolation.bounceIn)); + + // Animate the pause menu opening + window.setPosition(((float) Gdx.graphics.getWidth() / 2) - (windowSizeX / 2),0); + window.addAction(new SequenceAction(Actions.moveTo( + ( ((float) Gdx.graphics.getWidth() / 2) - (windowSizeX / 2) ), + ( ((float) Gdx.graphics.getHeight() / 2) - (windowSizeY / 2) ), + 0.3f, + Interpolation.fastSlow), + Actions.fadeIn(0.3f))); stage.addActor(window); }