amazing music
This commit is contained in:
BIN
core/assets/earrape.mp3
Normal file
BIN
core/assets/earrape.mp3
Normal file
Binary file not shown.
@@ -76,13 +76,13 @@ public class MainGame extends ApplicationAdapter {
|
||||
|
||||
String[] strings = new String[]{
|
||||
"#########################",
|
||||
"#xxxx #",
|
||||
"# x #",
|
||||
"# xxxx xxxxx #",
|
||||
"# xxxx xxxxx #",
|
||||
"# xxxx xx xx #",
|
||||
"# x xxxxx #",
|
||||
"# x xxxx #",
|
||||
"#xxxx # #",
|
||||
"# x # #",
|
||||
"# xxxx #xxxx #",
|
||||
"# xxxx #xxxx #",
|
||||
"# xxxx #x xx #",
|
||||
"# x #xxxx #",
|
||||
"# x #xxx #",
|
||||
"# x #",
|
||||
"# xxxxxx #",
|
||||
"# x #",
|
||||
@@ -101,7 +101,7 @@ public class MainGame extends ApplicationAdapter {
|
||||
// this.tree.insert(new Hacker(,new BodySwap()));
|
||||
|
||||
|
||||
// playSong();
|
||||
playSong();
|
||||
|
||||
|
||||
// connectToServer();
|
||||
@@ -124,7 +124,8 @@ public class MainGame extends ApplicationAdapter {
|
||||
|
||||
for (int i = 1; i <= 5; i++) {
|
||||
GameCharacter temp = new Agent("Agent" + i, characters[11][0], new BodySwap("Test"));
|
||||
mapRenderer.getGameTiles()[3][i].visit(temp);
|
||||
int width = mapRenderer.getGameTiles()[0].length;
|
||||
mapRenderer.getGameTiles()[3][width-(i+1)].visit(temp);
|
||||
if (chosenFaction == Faction.MEGACORPORATION) {
|
||||
this.team.addMember(temp);
|
||||
}
|
||||
@@ -136,7 +137,7 @@ public class MainGame extends ApplicationAdapter {
|
||||
|
||||
private void playSong() {
|
||||
// play music
|
||||
Music music = Gdx.audio.newMusic(Gdx.files.getFileHandle("core/assets/music.mp3", Files.FileType.Internal));
|
||||
Music music = Gdx.audio.newMusic(Gdx.files.getFileHandle("core/assets/earrape.mp3", Files.FileType.Internal));
|
||||
music.setVolume(.1f);
|
||||
music.play();
|
||||
music.setLooping(true);
|
||||
|
||||
@@ -46,6 +46,7 @@ public class GameInputProcessor implements InputProcessor {
|
||||
|
||||
camera.zoom = MathUtils.clamp(camera.zoom, 1.5f, 1.8f);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public boolean isWPressed() {
|
||||
@@ -124,8 +125,10 @@ public class GameInputProcessor implements InputProcessor {
|
||||
System.out.println("HACKER");
|
||||
mainGame.setChosenFaction(Faction.HACKER);
|
||||
mainGame.initCharacters();
|
||||
camera.translate(-400,0);
|
||||
mainGame.setGamestate(GAMESTATE.PLAYING);
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -148,21 +151,28 @@ public class GameInputProcessor implements InputProcessor {
|
||||
GameTile gameTile = mainGame.mapRenderer.getGameTiles()[row][col];
|
||||
if (gameTile.contains(touchPoint.x, touchPoint.y)) {
|
||||
if (button == Input.Buttons.LEFT) {
|
||||
// System.out.println(gameTile + " row: " + row + ", col: " + col);
|
||||
|
||||
// moving selected character
|
||||
if (mainGame.hasCharacterSelected() && !gameTile.containsCharacter()) {
|
||||
// System.out.println(mainGame.getSelectedCharacter());
|
||||
|
||||
if (gameTile.getSymbol() != '#' && mainGame.mapRenderer.getSurroundedTilesOfCurrentCharacter().contains(gameTile)) {
|
||||
removeCharacterFromTile(mainGame.getSelectedCharacter());
|
||||
gameTile.visit(mainGame.getSelectedCharacter());
|
||||
mainGame.mapRenderer.setSurroundedTilesOfCurrentCharacter(col, row);
|
||||
}
|
||||
}
|
||||
// clicking on enemy
|
||||
if (mainGame.hasCharacterSelected() && gameTile.containsCharacter() && gameTile.getCharacter().getFaction() != mainGame.getChosenFaction()) {
|
||||
gameTile.getCharacter().damage(10);
|
||||
}
|
||||
// set selected character
|
||||
if (!mainGame.hasCharacterSelected() && gameTile.containsCharacter()) {
|
||||
if (gameTile.getCharacter().getFaction() == mainGame.getChosenFaction()) {
|
||||
mainGame.setSelectedCharacter(gameTile.getCharacter());
|
||||
mainGame.mapRenderer.setSurroundedTilesOfCurrentCharacter(col, row);
|
||||
}
|
||||
}
|
||||
// switch character
|
||||
if (gameTile.containsCharacter()
|
||||
&& !mainGame.getSelectedCharacter().equals(gameTile.getCharacter())
|
||||
&& gameTile.getCharacter().getFaction() == mainGame.getChosenFaction()) {
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.badlogic.gdx.graphics.Texture;
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||
import netwerkprog.game.client.MainGame;
|
||||
import netwerkprog.game.util.application.Timer;
|
||||
import netwerkprog.game.util.game.GameCharacter;
|
||||
import netwerkprog.game.util.graphics.Renderable;
|
||||
|
||||
@@ -118,9 +119,9 @@ public class MapRenderer implements Renderable {
|
||||
|
||||
if (cur.containsCharacter()) {
|
||||
batch.draw(cur.getCharacter().getTextureRegion(), cur.x, cur.y);
|
||||
|
||||
if (cur.getCharacter().equals(mainGame.getSelectedCharacter())) {
|
||||
batch.draw(square, cur.x, cur.y);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,6 +59,7 @@ public abstract class GameCharacter extends Actor implements Comparable<GameChar
|
||||
public void damage(int amount) {
|
||||
this.health -= amount;
|
||||
if (this.health < 0) this. health = 0;
|
||||
System.out.println("OUCH character " + name + " was damaged for " + amount);
|
||||
}
|
||||
|
||||
public boolean isDead() {
|
||||
|
||||
Reference in New Issue
Block a user