Merge branch 'development' of https://github.com/PTE-SH/ShadowHunterGame into development

This commit is contained in:
Yessine Ben El Bey
2020-05-07 17:11:26 +02:00
17 changed files with 309 additions and 118 deletions

View File

@ -1,11 +1,13 @@
package ihm.controller;
import carte.CarteLieu;
import javafx.animation.TranslateTransition;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.StackPane;
import javafx.scene.paint.Color;
import javafx.util.Duration;
import main.Joueur;
public class GestionnaireDePions {
@ -33,9 +35,18 @@ public class GestionnaireDePions {
FlowPane fpAncient = (FlowPane) nAncient.getChildren().get(0);
fpAncient.getChildren().remove(pionVie);
System.out.println(damage);
if(damage < 0) {
damage = 0;
}else if(damage > gp.getChildren().size()-1) {
damage = gp.getChildren().size()-1;
}
StackPane nNew = (StackPane) gp.getChildren().get(damage);
FlowPane fpNew = (FlowPane) nNew.getChildren().get(0);
fpNew.getChildren().add(pionVie);
}
public void deplacerPionLieux(Joueur j) {
@ -56,9 +67,21 @@ public class GestionnaireDePions {
StackPane sp = (StackPane) hbox.getChildren().get(indexCL%2);
FlowPane fp = (FlowPane) sp.getChildren().get(0);
fp.getChildren().add(this.pionLieu);
fp.getChildren().add(this.pionLieu);
}
public void animationDeplacer(double x, double y, Pion p) {
TranslateTransition translate = new TranslateTransition();
translate.setByX(x);
translate.setByY(y);
translate.setDuration(Duration.millis(2000));
translate.setNode(p);
translate.play();
}
}

View File

@ -294,8 +294,8 @@ public class PlateauController implements Initializable {
}
public void updateVieJoueur(Joueur joueur, int damage) {
/*JoueurIHM jIHM = getJoueurIHM(joueur);
jIHM.deplacerPionVie(damage);*/
JoueurIHM jIHM = getJoueurIHM(joueur);
jIHM.deplacerPionVie(damage);
}