lancement jouer tour auto plateau

This commit is contained in:
Chiara 2020-04-29 16:56:15 +02:00
parent 47a2be3252
commit ab74bb0fdf
15 changed files with 106 additions and 37 deletions

View File

@ -38,8 +38,8 @@ public class JouerSonTour1Controller implements Initializable{
int OFFSET_X = 0;
int OFFSET_Y = 0;
int WIDTH = 200;
int HEIGHT = 200;
int WIDTH = 80;
int HEIGHT = 80;
int COUNT = 6;
int COLUMNS = 6;

View File

@ -11,26 +11,17 @@ import java.util.ResourceBundle;
import ihm.PopUp;
import ihm.PopUpBoolean;
import ihm.SpriteAnimation;
import javafx.animation.Animation;
import javafx.event.Event;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.geometry.Rectangle2D;
import javafx.scene.Group;
import javafx.scene.Parent;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.image.ImageView;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Pane;
import javafx.scene.layout.VBox;
<<<<<<< HEAD
=======
import javafx.util.Duration;
>>>>>>> eea99d2341b1df015a2831034aa39534addff16e
import main.Joueur;
import main.View;
@ -41,6 +32,7 @@ public class PlateauController implements Initializable {
private List<Button> btnRevelation = new ArrayList<Button>();
private List<ImageView> cartePerso = new ArrayList<ImageView>();
private List<Label> nomJoueur = new ArrayList<Label>();
private List<AnchorPane> tour = new ArrayList<AnchorPane>();
@FXML private HBox joueur1;
@FXML private HBox joueur2;
@ -69,6 +61,7 @@ public class PlateauController implements Initializable {
this.hboxJoueur.add(joueur4);
for (HBox hbox : hboxJoueur) {
tour.add((AnchorPane) hbox.getChildren().get(0));
VBox carte = (VBox) hbox.getChildren().get(1);
cartePerso.add((ImageView) carte.getChildren().get(0));
btnRevelation.add((Button) carte.getChildren().get(1));
@ -82,6 +75,7 @@ public class PlateauController implements Initializable {
this.vboxJoueur.add(joueur8);
for (VBox vbox : vboxJoueur) {
tour.add((AnchorPane) vbox.getChildren().get(0));
HBox joueur = (HBox) vbox.getChildren().get(1);
VBox carte = (VBox) joueur.getChildren().get(1);
cartePerso.add((ImageView) carte.getChildren().get(0));
@ -106,13 +100,25 @@ public class PlateauController implements Initializable {
}
try {
final URL fxmlURL = getClass().getResource("../ressources/Jouer_tour(1)lancer_des.fxml");
final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.ENGLISH);
final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle);
Pane root = fxmlLoader.load();
root.setPrefSize(255, 180);
tour.get(0).getChildren().setAll(root);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
listJoueur = View.getJoueurs();
}
/**
* Affiche aux yeux de tous la carte personnage du joueur
*
* @param j : Le joueur sur lequel on a cliqu<EFBFBD>
* @param j : Le joueur sur lequel on a cliqué
*/
public void seReveler(int numJoueur) throws IOException {
System.out.println(listJoueur.get(numJoueur).getNom() + " se revele");
@ -163,16 +169,21 @@ public class PlateauController implements Initializable {
* @param j : map donnant le joueur et son numero
*/
public void showInformation(Map<Integer, Joueur> j) {
/*System.out.println("\tplacement des joueurs");
System.out.println("\tplacement des joueurs");
int taille = this.vboxJoueur.size() + this.hboxJoueur.size();
for (int i=0; i<taille; i++) {
if (j.get(i) != null)
nomJoueur.get(i).setText(j.get(i).getNom());
else {
vboxJoueur.get(i).setVisible(false);
if (i < 4) {
hboxJoueur.get(i).setVisible(false);
}else {
vboxJoueur.get(i-4).setVisible(false);
}
}
}*/
}
}
public void rollDice(Joueur joueur, int typeDice, int[] rolls) {

View File

@ -6,23 +6,23 @@
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.text.Font?>
<Pane fx:id="rootPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="480.0" prefWidth="640.0" stylesheets="@style/popUp.css" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.JouerSonTour1Controller">
<Pane fx:id="rootPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="180.0" prefWidth="255.0" stylesheets="@style/popUp.css" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.JouerSonTour1Controller">
<children>
<Label layoutX="135.0" layoutY="29.0" text="%au.tour.de">
<Label layoutX="54.0" layoutY="19.0" text="%au.tour.de">
<font>
<Font size="36.0" />
<Font size="14.0" />
</font>
</Label>
<Button layoutX="262.0" layoutY="388.0" mnemonicParsing="false" onMouseClicked="#lancerDes" text="%lancer.de.des">
<Button layoutX="70.0" layoutY="140.0" mnemonicParsing="false" onMouseClicked="#lancerDes" text="%lancer.de.des">
<font>
<Font size="18.0" />
<Font size="14.0" />
</font></Button>
<Label fx:id="nomJoueur" layoutX="405.0" layoutY="29.0" text="%joueur1">
<Label fx:id="nomJoueur" layoutX="140.0" layoutY="19.0" text="%joueur1">
<font>
<Font size="36.0" />
<Font size="14.0" />
</font>
</Label>
<AnchorPane fx:id="d6" layoutX="91.0" layoutY="140.0" prefHeight="200.0" prefWidth="200.0" />
<AnchorPane fx:id="d4" layoutX="379.0" layoutY="140.0" prefHeight="200.0" prefWidth="200.0" />
<AnchorPane fx:id="d6" layoutX="23.0" layoutY="50.0" prefHeight="80.0" prefWidth="80.0" />
<AnchorPane fx:id="d4" layoutX="129.0" layoutY="50.0" prefHeight="80.0" prefWidth="80.0" />
</children>
</Pane>
</Pane>

View File

@ -4,6 +4,7 @@
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.BorderPane?>
@ -22,7 +23,13 @@
<AnchorPane prefHeight="155.0" prefWidth="255.0" styleClass="tour" />
<VBox alignment="CENTER" prefHeight="155.0" prefWidth="116.0">
<children>
<ImageView fitHeight="97.8" fitWidth="70.05" pickOnBounds="true" preserveRatio="true" />
<ImageView fitHeight="97.8" fitWidth="70.05" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@img/dosCartesPersonnage.jpg" />
</image>
<VBox.margin>
<Insets bottom="5.0" />
</VBox.margin></ImageView>
<Button mnemonicParsing="false" styleClass="bouton" stylesheets="@style/plateau.css" text="%se.reveler" />
</children>
<HBox.margin>
@ -58,7 +65,13 @@
<AnchorPane prefHeight="155.0" prefWidth="255.0" styleClass="tour" />
<VBox alignment="CENTER" prefHeight="155.0" prefWidth="116.0">
<children>
<ImageView fitHeight="97.8" fitWidth="70.05" pickOnBounds="true" preserveRatio="true" />
<ImageView fitHeight="97.8" fitWidth="70.05" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@img/dosCartesPersonnage.jpg" />
</image>
<VBox.margin>
<Insets bottom="5.0" />
</VBox.margin></ImageView>
<Button mnemonicParsing="false" styleClass="bouton" stylesheets="@style/plateau.css" text="%se.reveler" />
</children>
<HBox.margin>
@ -100,7 +113,13 @@
<AnchorPane prefHeight="180.0" prefWidth="255.0" styleClass="tour" />
<VBox alignment="CENTER" prefHeight="155.0" prefWidth="116.0">
<children>
<ImageView fitHeight="97.8" fitWidth="70.05" pickOnBounds="true" preserveRatio="true" />
<ImageView fitHeight="97.8" fitWidth="70.05" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@img/dosCartesPersonnage.jpg" />
</image>
<VBox.margin>
<Insets bottom="5.0" />
</VBox.margin></ImageView>
<Button mnemonicParsing="false" styleClass="bouton" stylesheets="@style/plateau.css" text="%se.reveler" />
</children>
<HBox.margin>
@ -136,7 +155,13 @@
<AnchorPane prefHeight="155.0" prefWidth="255.0" styleClass="tour" />
<VBox alignment="CENTER" prefHeight="155.0" prefWidth="116.0">
<children>
<ImageView fitHeight="97.8" fitWidth="70.05" pickOnBounds="true" preserveRatio="true" />
<ImageView fitHeight="97.8" fitWidth="70.05" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@img/dosCartesPersonnage.jpg" />
</image>
<VBox.margin>
<Insets bottom="5.0" />
</VBox.margin></ImageView>
<Button mnemonicParsing="false" styleClass="bouton" stylesheets="@style/plateau.css" text="%se.reveler" />
</children>
<HBox.margin>
@ -196,7 +221,13 @@
</VBox>
<VBox alignment="CENTER" prefHeight="200.0" prefWidth="100.0">
<children>
<ImageView fitHeight="97.8" fitWidth="70.05" pickOnBounds="true" preserveRatio="true" />
<ImageView fitHeight="97.8" fitWidth="70.05" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@img/dosCartesPersonnage.jpg" />
</image>
<VBox.margin>
<Insets bottom="5.0" />
</VBox.margin></ImageView>
<Button mnemonicParsing="false" styleClass="bouton" stylesheets="@style/plateau.css" text="%se.reveler" />
</children>
</VBox>
@ -233,7 +264,13 @@
</VBox>
<VBox alignment="CENTER" prefHeight="200.0" prefWidth="100.0">
<children>
<ImageView fitHeight="97.8" fitWidth="70.05" pickOnBounds="true" preserveRatio="true" />
<ImageView fitHeight="97.8" fitWidth="70.05" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@img/dosCartesPersonnage.jpg" />
</image>
<VBox.margin>
<Insets bottom="5.0" />
</VBox.margin></ImageView>
<Button mnemonicParsing="false" styleClass="bouton" stylesheets="@style/plateau.css" text="%se.reveler" />
</children>
</VBox>
@ -276,7 +313,13 @@
</VBox>
<VBox alignment="CENTER" prefHeight="200.0" prefWidth="100.0">
<children>
<ImageView fitHeight="97.8" fitWidth="70.05" pickOnBounds="true" preserveRatio="true" />
<ImageView fitHeight="97.8" fitWidth="70.05" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@img/dosCartesPersonnage.jpg" />
</image>
<VBox.margin>
<Insets bottom="5.0" />
</VBox.margin></ImageView>
<Button mnemonicParsing="false" styleClass="bouton" stylesheets="@style/plateau.css" text="%se.reveler" />
</children>
</VBox>
@ -310,7 +353,13 @@
</VBox>
<VBox alignment="CENTER" prefHeight="200.0" prefWidth="100.0">
<children>
<ImageView fitHeight="97.8" fitWidth="70.05" pickOnBounds="true" preserveRatio="true" />
<ImageView fitHeight="97.8" fitWidth="70.05" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@img/dosCartesPersonnage.jpg" />
</image>
<VBox.margin>
<Insets bottom="5.0" />
</VBox.margin></ImageView>
<Button mnemonicParsing="false" styleClass="bouton" stylesheets="@style/plateau.css" text="%se.reveler" />
</children>
</VBox>
@ -331,12 +380,18 @@
<children>
<HBox prefHeight="100.0" prefWidth="200.0" styleClass="carteLumiere" stylesheets="@style/plateau.css">
<children>
<ImageView fitHeight="97.8" fitWidth="70.05" pickOnBounds="true" preserveRatio="true" styleClass="background" />
<ImageView fitHeight="97.8" fitWidth="70.05" pickOnBounds="true" preserveRatio="true" styleClass="background">
<image>
<Image url="@img/dosCartesLumière.jpg" />
</image></ImageView>
</children>
</HBox>
<HBox prefHeight="100.0" prefWidth="200.0" styleClass="carteVision" stylesheets="@style/plateau.css">
<children>
<ImageView fitHeight="97.8" fitWidth="70.05" pickOnBounds="true" preserveRatio="true" />
<ImageView fitHeight="97.8" fitWidth="70.05" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@img/dosCartesVision.jpg" />
</image></ImageView>
</children>
<VBox.margin>
<Insets bottom="30.0" top="30.0" />
@ -344,7 +399,10 @@
</HBox>
<HBox prefHeight="100.0" prefWidth="200.0" styleClass="carteTenebre" stylesheets="@style/plateau.css">
<children>
<ImageView fitHeight="97.8" fitWidth="70.05" pickOnBounds="true" preserveRatio="true" />
<ImageView fitHeight="97.8" fitWidth="70.05" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@img/dosCartesNoires.jpg" />
</image></ImageView>
</children>
</HBox>
</children>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB