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.*;
|
import java.awt.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Main game class
|
||||||
|
*/
|
||||||
public class MainGame extends Game implements ClientCallback {
|
public class MainGame extends Game implements ClientCallback {
|
||||||
SpriteBatch batch;
|
SpriteBatch batch;
|
||||||
float screenWidth;
|
float screenWidth;
|
||||||
@@ -68,6 +71,10 @@ public class MainGame extends Game implements ClientCallback {
|
|||||||
private MainGame() {
|
private MainGame() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* return the instance of the main game.
|
||||||
|
* @return the main game
|
||||||
|
*/
|
||||||
public static MainGame getInstance() {
|
public static MainGame getInstance() {
|
||||||
if (INSTANCE == null) {
|
if (INSTANCE == null) {
|
||||||
INSTANCE = new MainGame();
|
INSTANCE = new MainGame();
|
||||||
@@ -113,8 +120,12 @@ public class MainGame extends Game implements ClientCallback {
|
|||||||
camera.update();
|
camera.update();
|
||||||
setGamestate(GAMESTATE.SELECTING_FACTION);
|
setGamestate(GAMESTATE.SELECTING_FACTION);
|
||||||
connectToServer();
|
connectToServer();
|
||||||
|
playSong();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* initialize all characters.
|
||||||
|
*/
|
||||||
public void initCharacters() {
|
public void initCharacters() {
|
||||||
assets.load("core/assets/characters.png", Texture.class);
|
assets.load("core/assets/characters.png", Texture.class);
|
||||||
assets.finishLoading();
|
assets.finishLoading();
|
||||||
@@ -151,7 +162,7 @@ public class MainGame extends Game implements ClientCallback {
|
|||||||
|
|
||||||
private void playSong() {
|
private void playSong() {
|
||||||
// play music
|
// 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.setVolume(.1f);
|
||||||
music.play();
|
music.play();
|
||||||
music.setLooping(true);
|
music.setLooping(true);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package netwerkprog.game.server;
|
package netwerkprog.game.server;
|
||||||
|
|
||||||
import netwerkprog.game.util.data.connection.ConnectionData;
|
|
||||||
import netwerkprog.game.util.data.Data;
|
import netwerkprog.game.util.data.Data;
|
||||||
|
import netwerkprog.game.util.data.connection.ConnectionData;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.ObjectInputStream;
|
import java.io.ObjectInputStream;
|
||||||
|
|||||||
Reference in New Issue
Block a user