diff --git a/core/assets/gamemusic.mp3 b/core/assets/gamemusic.mp3 new file mode 100644 index 0000000..b5bdcee Binary files /dev/null and b/core/assets/gamemusic.mp3 differ diff --git a/core/assets/mainmenu.mp3 b/core/assets/mainmenu.mp3 new file mode 100644 index 0000000..2c24926 Binary files /dev/null and b/core/assets/mainmenu.mp3 differ diff --git a/core/src/com/dungeoncrawler/control/Controller.java b/core/src/com/dungeoncrawler/control/Controller.java index 8260d8a..6c44061 100644 --- a/core/src/com/dungeoncrawler/control/Controller.java +++ b/core/src/com/dungeoncrawler/control/Controller.java @@ -290,6 +290,7 @@ public class Controller extends ApplicationAdapter implements InputProcessor{ if(v != null){ if(v.click() == -1){} else if(v.click() == 0){ + v.cleanUp(); v = null; m = new GameScreen(d); newEntity(new Archer(0,0,0),96,96,0); diff --git a/core/src/com/dungeoncrawler/view/GameScreen.java b/core/src/com/dungeoncrawler/view/GameScreen.java index fb684cc..3afd289 100644 --- a/core/src/com/dungeoncrawler/view/GameScreen.java +++ b/core/src/com/dungeoncrawler/view/GameScreen.java @@ -1,6 +1,7 @@ package com.dungeoncrawler.view; import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.audio.Music; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.Texture; @@ -45,6 +46,9 @@ public class GameScreen { TiledMap tm; OrthographicCamera camera; + // Sound + Music music; + public GameScreen(Dungeon d) { //CONTROLS ctr = new Texture("controls.png"); @@ -86,6 +90,9 @@ public class GameScreen { tm = new TiledMap(); tmr = new OrthogonalTiledMapRenderer(tm); + + music = Gdx.audio.newMusic(Gdx.files.internal("gamemusic.mp3")); + music.play(); } diff --git a/core/src/com/dungeoncrawler/view/MainMenu.java b/core/src/com/dungeoncrawler/view/MainMenu.java index b0325d6..cbffdf5 100644 --- a/core/src/com/dungeoncrawler/view/MainMenu.java +++ b/core/src/com/dungeoncrawler/view/MainMenu.java @@ -1,6 +1,7 @@ package com.dungeoncrawler.view; import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.audio.Music; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.Pixmap; @@ -34,6 +35,9 @@ public class MainMenu{ float h = Gdx.graphics.getHeight(); OrthographicCamera camera; + // Sound + Music music; + public MainMenu() { //MENU-SCREEN float w = Gdx.graphics.getWidth(); @@ -77,6 +81,10 @@ public class MainMenu{ CursorMoveY = 0f; //PLAYER + + // Sound + music = Gdx.audio.newMusic(Gdx.files.internal("mainmenu.mp3")); + music.play(); } @@ -136,6 +144,10 @@ public class MainMenu{ else{return -1;} } + public void cleanUp(){ + music.dispose(); + } + diff --git a/desktop/src/com/dungeoncrawler/desktop/DesktopLauncher.java b/desktop/src/com/dungeoncrawler/desktop/DesktopLauncher.java index 9e8e9c2..524a6f2 100644 --- a/desktop/src/com/dungeoncrawler/desktop/DesktopLauncher.java +++ b/desktop/src/com/dungeoncrawler/desktop/DesktopLauncher.java @@ -12,6 +12,7 @@ public class DesktopLauncher { config.width = 1600; config.height = 900; config.title = "The Restless Caverns"; + config.resizable = false; //config.addIcon("logo.png", Files.FileType.Internale); new LwjglApplication(new Controller(), config);