diff --git a/core/assets/levels/level2.tmx b/core/assets/levels/level2.tmx index 7a8d2c8..88fb5e5 100644 --- a/core/assets/levels/level2.tmx +++ b/core/assets/levels/level2.tmx @@ -1,17 +1,19 @@ - + - eJxjYBgFo2B4ACY62MGIhAmpo5Z91ABMaBgZMEMxslpS3IXNvMEMBrv7hhIAAE/AACE= + eJxjYBgFo2B4ACYK9TMSqQaGKTWLGEANc5iwYGTADMXI6klxFzbzyAWU6B1oOyhNf0MRAABepAAp - - - + + + + + diff --git a/core/assets/sounds/jumping.mp3 b/core/assets/sounds/jumping.mp3 new file mode 100644 index 0000000..b8e4d86 Binary files /dev/null and b/core/assets/sounds/jumping.mp3 differ diff --git a/core/src/com/game/States/Play.java b/core/src/com/game/States/Play.java index eb9b4fd..cb2f475 100644 --- a/core/src/com/game/States/Play.java +++ b/core/src/com/game/States/Play.java @@ -3,6 +3,7 @@ package com.game.States; import static com.game.Misc.Vars.PPM; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input; +import com.badlogic.gdx.audio.Sound; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.maps.tiled.TiledMap; @@ -41,6 +42,8 @@ public class Play extends State { ArrayList platforms = new ArrayList(); + private Sound jumpSound = Gdx.audio.newSound(Gdx.files.internal("sounds/jumping.mp3")); + public Play(StateManager sm) { super(sm); world = new World(new Vector2(0, Vars.GRAVITY.y), true); @@ -110,6 +113,7 @@ public class Play extends State { public void handleInput() { if(Gdx.input.isKeyPressed(Input.Keys.SPACE)) { + jumpSound.play(); player.jump(); } @@ -125,7 +129,7 @@ public class Play extends State { { player = new Player(world, new Vector2(500, 500), new Vector2(60, 60), Base.Colours.NONE); - tileMap = new TmxMapLoader().load("levels/level1.tmx"); + tileMap = new TmxMapLoader().load("levels/level2.tmx"); tmr = new OrthogonalTiledMapRenderer(tileMap); TiledMapTileLayer layer = (TiledMapTileLayer)tileMap.getLayers().get("PLATFORM");