This commit is contained in:
Sem van der Hoeven
2020-06-07 17:59:48 +02:00
parent 0d22df0fab
commit 17df656725
4 changed files with 7 additions and 2 deletions

View File

@@ -122,7 +122,7 @@ public class MainGame extends Game implements ClientCallback {
camera.update();
setGamestate(GAMESTATE.SELECTING_FACTION);
connectToServer();
playSong();
// playSong();
}
/**

View File

@@ -173,7 +173,7 @@ public class GameInputProcessor implements InputProcessor {
if (mainGame.hasCharacterSelected() && gameTile.containsCharacter() && gameTile.getCharacter().getFaction() != mainGame.getChosenFaction()) {
if (mainGame.mapRenderer.getSurroundedTilesOfCurrentCharacter().contains(gameTile)) {
if (!gameTile.getCharacter().isDead()) {
gameTile.getCharacter().damage(100);
gameTile.getCharacter().damage(gameTile.getCharacter().getDamageAmount());
mainGame.increaseTurn();
mainGame.send(new DamageData(gameTile.getCharacter().getName()));
}

View File

@@ -20,6 +20,8 @@ public class GameTile extends Rectangle {
super.height = textureRegion.getRegionHeight();
}
public GameCharacter getCharacter() {
return character;
}

View File

@@ -58,6 +58,9 @@ public abstract class GameCharacter extends Actor implements Comparable<GameChar
this.health += amount;
if (this.health > 100) this.health = 10;
}
public int getDamageAmount() {
return 10;
}
public void damage(int amount) {
this.health -= amount;