Merge branch 'master' of https://github.com/SemvdH/netwerk-programming-eindopdracht
# Conflicts: # core/src/netwerkprog/game/util/game/GameCharacter.java
This commit is contained in:
BIN
core/assets/sound/beat.mp3
Normal file
BIN
core/assets/sound/beat.mp3
Normal file
Binary file not shown.
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user