add music
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.
@@ -27,7 +27,6 @@ import netwerkprog.game.util.data.Data;
|
|||||||
import netwerkprog.game.util.data.character.DamageData;
|
import netwerkprog.game.util.data.character.DamageData;
|
||||||
import netwerkprog.game.util.data.character.MoveData;
|
import netwerkprog.game.util.data.character.MoveData;
|
||||||
import netwerkprog.game.util.data.connection.NameData;
|
import netwerkprog.game.util.data.connection.NameData;
|
||||||
import netwerkprog.game.util.data.connection.ReadyData;
|
|
||||||
import netwerkprog.game.util.data.connection.TeamData;
|
import netwerkprog.game.util.data.connection.TeamData;
|
||||||
import netwerkprog.game.util.data.connection.TurnData;
|
import netwerkprog.game.util.data.connection.TurnData;
|
||||||
import netwerkprog.game.util.game.Faction;
|
import netwerkprog.game.util.game.Faction;
|
||||||
@@ -37,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;
|
||||||
@@ -69,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();
|
||||||
@@ -114,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();
|
||||||
@@ -152,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;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package netwerkprog.game.util.data.character;
|
package netwerkprog.game.util.data.character;
|
||||||
|
|
||||||
import netwerkprog.game.client.game.map.GameTile;
|
|
||||||
import netwerkprog.game.util.data.Data;
|
import netwerkprog.game.util.data.Data;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package netwerkprog.game.util.game;
|
package netwerkprog.game.util.game;
|
||||||
|
|
||||||
|
|
||||||
import com.badlogic.gdx.Gdx;
|
|
||||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||||
import com.badlogic.gdx.scenes.scene2d.Actor;
|
import com.badlogic.gdx.scenes.scene2d.Actor;
|
||||||
import netwerkprog.game.client.game.map.GameTile;
|
import netwerkprog.game.client.game.map.GameTile;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package netwerkprog.game.util.graphics;
|
package netwerkprog.game.util.graphics;
|
||||||
|
|
||||||
import netwerkprog.game.util.application.Updatable;
|
|
||||||
|
|
||||||
public interface Renderable extends Updatable {
|
public interface Renderable {
|
||||||
void render();
|
void render();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package netwerkprog.game.util.tree;
|
package netwerkprog.game.util.tree;
|
||||||
|
|
||||||
import java.util.Iterator;
|
|
||||||
|
|
||||||
public class BST<E extends Comparable<E>> extends AbstractTree<E> {
|
public class BST<E extends Comparable<E>> extends AbstractTree<E> {
|
||||||
protected TreeNode<E> root;
|
protected TreeNode<E> root;
|
||||||
protected int size = 0;
|
protected int size = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user