fix
This commit is contained in:
@@ -122,7 +122,7 @@ public class MainGame extends Game implements ClientCallback {
|
||||
camera.update();
|
||||
setGamestate(GAMESTATE.SELECTING_FACTION);
|
||||
connectToServer();
|
||||
playSong();
|
||||
// playSong();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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()));
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@ public class GameTile extends Rectangle {
|
||||
super.height = textureRegion.getRegionHeight();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public GameCharacter getCharacter() {
|
||||
return character;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user