Damage character #11

Merged
SemvdH merged 5 commits from damage-character into master 2020-06-06 20:43:07 +00:00
2 changed files with 3 additions and 1 deletions
Showing only changes of commit 24a03a2854 - Show all commits

View File

@@ -125,7 +125,7 @@ public class MainGame extends ApplicationAdapter {
for (int i = 1; i <= 5; i++) { for (int i = 1; i <= 5; i++) {
GameCharacter temp = new Agent("Agent" + i, characters[11][0], new BodySwap("Test")); GameCharacter temp = new Agent("Agent" + i, characters[11][0], new BodySwap("Test"));
int width = mapRenderer.getGameTiles()[0].length; int width = mapRenderer.getGameTiles()[0].length;
mapRenderer.getGameTiles()[3][width-(i+1)].visit(temp); mapRenderer.getGameTiles()[3][width - (i + 1)].visit(temp);
if (chosenFaction == Faction.MEGACORPORATION) { if (chosenFaction == Faction.MEGACORPORATION) {
this.team.addMember(temp); this.team.addMember(temp);
} }
@@ -141,6 +141,7 @@ public class MainGame extends ApplicationAdapter {
music.setVolume(.1f); music.setVolume(.1f);
music.play(); music.play();
music.setLooping(true); music.setLooping(true);
} }

View File

@@ -163,6 +163,7 @@ public class GameInputProcessor implements InputProcessor {
} }
// clicking on enemy // clicking on enemy
if (mainGame.hasCharacterSelected() && gameTile.containsCharacter() && gameTile.getCharacter().getFaction() != mainGame.getChosenFaction()) { if (mainGame.hasCharacterSelected() && gameTile.containsCharacter() && gameTile.getCharacter().getFaction() != mainGame.getChosenFaction()) {
if (mainGame.mapRenderer.getSurroundedTilesOfCurrentCharacter().contains(gameTile))
gameTile.getCharacter().damage(10); gameTile.getCharacter().damage(10);
} }
// set selected character // set selected character