# Conflicts:
#	core/src/netwerkprog/game/util/game/GameCharacter.java
This commit is contained in:
MickWerf
2020-06-07 17:02:39 +02:00
3 changed files with 13 additions and 2 deletions

BIN
core/assets/sound/beat.mp3 Normal file

Binary file not shown.

View File

@@ -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);

View File

@@ -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;