fix faction choosing

This commit is contained in:
Sem van der Hoeven
2020-06-07 15:54:22 +02:00
parent 9337c44e20
commit fd6d91b7ed
2 changed files with 6 additions and 2 deletions

View File

@@ -205,7 +205,7 @@ public class MainGame extends Game implements ClientCallback {
if (this.ready && this.enemyReady) {
if (this.chosenFaction == Faction.HACKER) {
chooseHacker();
} else {
} else if (this.chosenFaction == Faction.MEGACORPORATION){
chooseMegaCorp();
}
}
@@ -223,7 +223,7 @@ public class MainGame extends Game implements ClientCallback {
}
private void renderText() {
String text = "FACION: " + chosenFaction;
String text = "FACTION: " + chosenFaction;
text += "\nSelected character: " + selectedCharacter.getName();
text += "\nHealth: " + selectedCharacter.getHealth();
layout.setText(font, text);

View File

@@ -119,10 +119,14 @@ public class GameInputProcessor implements InputProcessor {
}
} else if (mainGame.getGamestate() == GAMESTATE.SELECTING_FACTION) {
if (keycode == Input.Keys.NUM_1) {
System.out.println("choosing mega");
mainGame.send(new TeamData(Faction.MEGACORPORATION,mainGame.getUsername()));
mainGame.chooseMegaCorp();
}
if (keycode == Input.Keys.NUM_2) {
System.out.println("choosing hacker");
mainGame.send(new TeamData(Faction.HACKER,mainGame.getUsername()));
mainGame.chooseHacker();
}
}