diff --git a/core/assets/sound/beat.mp3 b/core/assets/sound/beat.mp3 new file mode 100644 index 0000000..88c5fe9 Binary files /dev/null and b/core/assets/sound/beat.mp3 differ diff --git a/core/src/netwerkprog/game/client/MainGame.java b/core/src/netwerkprog/game/client/MainGame.java index 06ab823..016c163 100644 --- a/core/src/netwerkprog/game/client/MainGame.java +++ b/core/src/netwerkprog/game/client/MainGame.java @@ -36,6 +36,9 @@ import netwerkprog.game.util.graphics.TextRenderer; import java.awt.*; +/** + * Main game class + */ public class MainGame extends Game implements ClientCallback { SpriteBatch batch; float screenWidth; @@ -68,6 +71,10 @@ public class MainGame extends Game implements ClientCallback { private MainGame() { } + /** + * return the instance of the main game. + * @return the main game + */ public static MainGame getInstance() { if (INSTANCE == null) { INSTANCE = new MainGame(); @@ -113,8 +120,12 @@ public class MainGame extends Game implements ClientCallback { camera.update(); setGamestate(GAMESTATE.SELECTING_FACTION); connectToServer(); + playSong(); } + /** + * initialize all characters. + */ public void initCharacters() { assets.load("core/assets/characters.png", Texture.class); assets.finishLoading(); @@ -151,7 +162,7 @@ public class MainGame extends Game implements ClientCallback { private void playSong() { // play music - Music music = Gdx.audio.newMusic(Gdx.files.getFileHandle("core/assets/earrape.mp3", Files.FileType.Internal)); + Music music = Gdx.audio.newMusic(Gdx.files.getFileHandle("core/assets/beat.mp3", Files.FileType.Internal)); music.setVolume(.1f); music.play(); music.setLooping(true); diff --git a/core/src/netwerkprog/game/server/ServerClient.java b/core/src/netwerkprog/game/server/ServerClient.java index dfc2c30..7045ec1 100644 --- a/core/src/netwerkprog/game/server/ServerClient.java +++ b/core/src/netwerkprog/game/server/ServerClient.java @@ -1,7 +1,7 @@ package netwerkprog.game.server; -import netwerkprog.game.util.data.connection.ConnectionData; import netwerkprog.game.util.data.Data; +import netwerkprog.game.util.data.connection.ConnectionData; import java.io.IOException; import java.io.ObjectInputStream;