From 5bf19250260873cb2189a5e333f9b4e29f472847 Mon Sep 17 00:00:00 2001 From: Felix Stupp Date: Fri, 1 Jul 2016 14:00:36 +0200 Subject: [PATCH] =?UTF-8?q?GeneralMap:=20N=C3=A4chster=20Modi-Button?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Von Angelica, Andreas, Julien --- GeneralMap.java | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/GeneralMap.java b/GeneralMap.java index 0fc3ce3..0882dbc 100644 --- a/GeneralMap.java +++ b/GeneralMap.java @@ -17,7 +17,7 @@ public abstract class GeneralMap extends World implements ButtonEvent Felder, im Moment nur Anzahl der Provinzen Später evtl. weitere Werte wie Schwierigkeit denkbar */ - + Button modus = new Button("Kampf",25,this); private final int X_OFFSET = 160; // Verschiebt die Provinzen nach rechts private final int Y_OFFSET = 0; // Verschiebt die Provinzen nach unten @@ -30,15 +30,20 @@ public abstract class GeneralMap extends World implements ButtonEvent protected enum GameStates { KAMPF, - VERSCHIEBEN + VERSCHIEBEN, + SETZEN } protected Province[] provinces; + protected int[] continentBoni; protected Player[] players; protected int currentPlayer = 0; protected GameStates status = GameStates.VERSCHIEBEN; + protected int provinceCount; + protected int armyMinimum; + // Kampfsystem Province offenderProvince; Province defenderProvince; @@ -58,6 +63,7 @@ public abstract class GeneralMap extends World implements ButtonEvent { super(1600,900,1); players = new Player[playerList.length]; + addObject( modus, 1500, 808); for (int i = 0; i < playerList.length; i++) { players[i] = new Player(i,playerList[i],colorList[i]); } @@ -513,6 +519,32 @@ public abstract class GeneralMap extends World implements ButtonEvent currentPlayer = 0; } } + if ( modus == b && status==GameStates.SETZEN) + { + status=GameStates.KAMPF; + modus.setText("Kampf beenden"); + + + } + if ( modus == b && status== GameStates.KAMPF) + { + status=GameStates.VERSCHIEBEN; + modus.setText("Nächster Spieler"); + } + if ( modus == b && status==GameStates.VERSCHIEBEN) + { + if( currentPlayer== players.length-1) + { + currentPlayer=0; + + } + else + { + currentPlayer+=1; + + } + + } } // Kampfsystem