Compare commits

...

1 Commits
main ... julien

Author SHA1 Message Date
ZIRTR0X 2bb0642d0b melange des deux codes
3 years ago

@ -6,7 +6,7 @@
<?import javafx.scene.shape.Rectangle?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="900.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1">
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="900.0" xmlns="http://javafx.com/javafx/11" xmlns:fx="http://javafx.com/fxml/1">
<children>
<ImageView fitHeight="662.0" fitWidth="979.0" pickOnBounds="true" preserveRatio="true">
<image>

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import com.jfoenix.controls.JFXToggleButton?>
<?import com.jfoenix.controls.JFXButton?>
<?import javafx.scene.Cursor?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.MenuItem?>
@ -11,10 +12,9 @@
<?import javafx.scene.shape.Line?>
<?import javafx.scene.shape.Rectangle?>
<?import javafx.scene.text.Font?>
<?import javafx.scene.control.RadioButton?>
<?import javafx.scene.control.ToggleGroup?>
<AnchorPane fx:id="levelRoot" xmlns:fx="http://javafx.com/fxml/1" id="pane" maxHeight="-Infinity" maxWidth="-Infinity"
minHeight="-Infinity"
minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0"
@ -39,17 +39,17 @@
</Label>
<Line endX="181.0" endY="-3.0517578125E-5" layoutX="107.0" layoutY="160.0" startX="1.0889129638671875"
startY="-1.52587890625E-5" stroke="#535252"/>
<RadioButton fx:id="radioButton1" layoutX="85" layoutY="200" prefHeight="33.0" prefWidth="75.0" selected="true" textFill="WHITE">
<RadioButton fx:id="radioButton1" layoutX="85" layoutY="200" prefHeight="33.0" prefWidth="75.0" textFill="WHITE" onMouseClicked="#setDifficulty1">
<toggleGroup>
<ToggleGroup fx:id="group"/>
</toggleGroup>
</RadioButton>
<RadioButton fx:id="radioButton2" layoutX="160" layoutY="200" prefHeight="33.0" prefWidth="75.0" textFill="WHITE">
<RadioButton fx:id="radioButton2" layoutX="160" layoutY="200" prefHeight="33.0" prefWidth="75.0" textFill="WHITE" onMouseClicked="#setDifficulty2">
<toggleGroup>
<fx:reference source="group"/>
</toggleGroup>
</RadioButton>
<RadioButton fx:id="radioButton3" layoutX="238" layoutY="200" prefHeight="33.0" prefWidth="75.0" textFill="WHITE">
<RadioButton fx:id="radioButton3" layoutX="238" layoutY="200" prefHeight="33.0" prefWidth="75.0" textFill="WHITE" onMouseClicked="#setDifficulty3">
<toggleGroup>
<fx:reference source="group"/>
</toggleGroup>
@ -88,13 +88,33 @@
<SplitMenuButton alignment="CENTER" contentDisplay="CENTER" layoutX="152.0" layoutY="351.0"
mnemonicParsing="false" text="Choix Personnage">
<items>
<MenuItem onAction="#changeSkin" fx:id="choice1" mnemonicParsing="false" text="Personnage 1"/>
<MenuItem onAction="#changeSkin" fx:id="choice2" mnemonicParsing="false" text="Personnage 2"/>
<MenuItem onAction="#changeSkin" fx:id="choice3" mnemonicParsing="false" text="Personnage 3"/>
<MenuItem onAction="#changeSkin1" fx:id="choice1" mnemonicParsing="false" text="Personnage 1"/>
<MenuItem onAction="#changeSkin2" fx:id="choice2" mnemonicParsing="false" text="Personnage 2"/>
<MenuItem onAction="#changeSkin3" fx:id="choice3" mnemonicParsing="false" text="Personnage 3"/>
</items>
<font>
<Font name="Segoe UI Black" size="12.0"/>
</font>
</SplitMenuButton>
</children>
<Rectangle arcHeight="5.0" arcWidth="5.0" height="50.0" layoutX="775.0" layoutY="525.0" opacity="0.6"
stroke="BLACK" strokeLineCap="ROUND" strokeLineJoin="ROUND" strokeMiterLimit="0.0" strokeWidth="5.0"
width="100.0">
<cursor>
<Cursor fx:constant="DEFAULT"/>
</cursor>
</Rectangle>
<Rectangle arcHeight="5.0" arcWidth="5.0" height="50.0" layoutX="775.0" layoutY="525.0" opacity="0.6"
stroke="BLACK" strokeLineCap="ROUND" strokeLineJoin="ROUND" strokeMiterLimit="0.0" strokeWidth="5.0"
width="100.0">
<cursor>
<Cursor fx:constant="DEFAULT"/>
</cursor>
</Rectangle>
<JFXButton layoutX="788" layoutY="535" prefHeight="30.0" prefWidth="75.0"
style="-fx-background-color: #EB9C0A;" text="START" textFill="WHITE" onMouseClicked="#launchGame" fx:id="button">
<font>
<Font name="Segoe UI Black" size="13.0"/>
</font>
</JFXButton>
</AnchorPane>

@ -9,18 +9,21 @@
<?import javafx.scene.text.Font?>
<?import javafx.scene.text.Text?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="900.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1">
<children>
<AnchorPane fx:controller="controller.PageGameController" maxHeight="-Infinity" maxWidth="-Infinity"
minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="900.0"
xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1">
<ImageView fitHeight="600.0" fitWidth="600.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="/image/terrain/map1.png" />
<Image url="@../image/terrain/map1.png"/>
</image>
</ImageView>
<Rectangle arcWidth="5.0" fill="#535353" height="614.0" layoutX="599.0" layoutY="-7.0" stroke="BLACK" strokeType="INSIDE" strokeWidth="0.0" width="302.0" />
<ImageView fx:id="persoImageView" fitHeight="32.0" fitWidth="32.0" layoutX="132.0" layoutY="74.0" pickOnBounds="true"
preserveRatio="true"/>
<Rectangle arcWidth="5.0" fill="#535353" height="614.0" layoutX="599.0" layoutY="-7.0" stroke="BLACK"
strokeType="INSIDE" strokeWidth="0.0" width="302.0"/>
<ImageView fitHeight="85.0" fitWidth="59.0" layoutX="625.0" layoutY="28.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="/image/personnage/Perso1.2.png" />
<Image url="@../image/personnage/Perso1.2.png"/>
</image>
</ImageView>
<Text fill="WHITE" layoutX="712.0" layoutY="64.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Joueur 1">
@ -28,13 +31,15 @@
<Font name="Segoe UI Black" size="19.0"/>
</font>
</Text>
<Button layoutX="711.0" layoutY="519.0" mnemonicParsing="false" style="-fx-background-color: #ffa20d;" text="Lancer le dé" textFill="WHITE" />
<Rectangle arcHeight="20.0" arcWidth="20.0" height="342.0" layoutX="624.0" layoutY="149.0" opacity="0.21" stroke="BLACK" strokeType="INSIDE" strokeWidth="0.0" width="252.0" />
<Button fx:id="boutonDe" onAction="#lancerDe" layoutX="711.0" layoutY="519.0" mnemonicParsing="false" style="-fx-background-color: #ffa20d;"
text="Lancer le dé" textFill="WHITE"/>
<Rectangle arcHeight="20.0" arcWidth="20.0" height="342.0" layoutX="624.0" layoutY="149.0" opacity="0.21"
stroke="BLACK" strokeType="INSIDE" strokeWidth="0.0" width="252.0"/>
<Text fill="WHITE" layoutX="729.0" layoutY="180.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Action">
<font>
<Font size="15.0"/>
</font>
</Text>
<Line endX="74.33331298828125" endY="1.52587890625E-5" layoutX="763.0" layoutY="201.0" startX="-100.0" stroke="WHITE" />
</children>
<Line endX="74.33331298828125" endY="1.52587890625E-5" layoutX="763.0" layoutY="201.0" startX="-100.0"
stroke="WHITE"/>
</AnchorPane>

@ -0,0 +1,151 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import com.jfoenix.controls.JFXButton?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<AnchorPane prefHeight="500.0" prefWidth="800.0" style="-fx-background-color: White;">
<children>
<AnchorPane prefHeight="46.0" prefWidth="800.0" style="-fx-background-color: #002d40;">
<children>
<Label layoutX="7.0" layoutY="7.0">
<graphic>
<ImageView fitHeight="46.0" fitWidth="32.0" pickOnBounds="true" preserveRatio="true">
<Image url="image/button/burger.png" />
</ImageView>
</graphic>
</Label>
<ImageView fitHeight="24.0" fitWidth="24.0" layoutX="762.0" layoutY="11.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@image/exit.png" />
</image>
</ImageView>
</children>
</AnchorPane>
<AnchorPane layoutY="46.0" prefHeight="454.0" prefWidth="44.0" style="-fx-background-color: white;">
<children>
<VBox alignment="TOP_CENTER" prefHeight="200.0" prefWidth="44.0" spacing="10.0" style="-fx-background-color: white;" AnchorPane.topAnchor="20.0">
<children>
<ImageView fitHeight="46.0" fitWidth="32.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@images/home.png" />
</image>
</ImageView>
<ImageView fitHeight="46.0" fitWidth="32.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@images/add.png" />
</image>
</ImageView>
<ImageView fitHeight="46.0" fitWidth="32.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@images/data.png" />
</image>
</ImageView>
<ImageView fitHeight="46.0" fitWidth="32.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@images/user.png" />
</image>
</ImageView>
<ImageView fitHeight="46.0" fitWidth="32.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@images/setting.png" />
</image>
</ImageView>
<ImageView fitHeight="46.0" fitWidth="32.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@images/backup.png" />
</image>
</ImageView>
</children>
</VBox>
</children>
</AnchorPane>
<AnchorPane layoutX="44.0" layoutY="46.0" prefHeight="454.0" prefWidth="756.0" AnchorPane.bottomAnchor="0.0" AnchorPane.rightAnchor="0.0">
<children>
<Pane layoutY="21.0" prefHeight="454.0" prefWidth="756.0" style="-fx-background-color: #d9ecf2;" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
</children>
</AnchorPane>
<AnchorPane prefHeight="200.0" prefWidth="200.0" style="-fx-background-color: #000;" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
<AnchorPane prefHeight="454.0" prefWidth="178.0" style="-fx-background-color: White;" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="40.0">
<children>
<VBox prefHeight="200.0" prefWidth="100.0" spacing="5.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="20.0">
<children>
<JFXButton alignment="BASELINE_LEFT" buttonType="RAISED" prefHeight="38.0" prefWidth="179.0" text="Dashboard">
<font>
<Font size="16.0" />
</font>
</JFXButton>
<JFXButton alignment="BASELINE_LEFT" buttonType="RAISED" layoutX="10.0" layoutY="10.0" prefHeight="38.0" prefWidth="179.0" text="Add New">
<font>
<Font size="16.0" />
</font>
</JFXButton>
<JFXButton alignment="BASELINE_LEFT" buttonType="RAISED" layoutX="10.0" layoutY="58.0" prefHeight="38.0" prefWidth="179.0" text="Data">
<font>
<Font size="16.0" />
</font>
</JFXButton>
<JFXButton alignment="BASELINE_LEFT" buttonType="RAISED" layoutX="10.0" layoutY="106.0" prefHeight="38.0" prefWidth="179.0" text="User">
<font>
<Font size="16.0" />
</font>
</JFXButton>
<JFXButton alignment="BASELINE_LEFT" buttonType="RAISED" layoutX="10.0" layoutY="154.0" prefHeight="38.0" prefWidth="179.0" text="Setting">
<font>
<Font size="16.0" />
</font>
</JFXButton>
<JFXButton alignment="BASELINE_LEFT" buttonType="RAISED" layoutX="10.0" layoutY="202.0" prefHeight="38.0" prefWidth="179.0" text="BackUp">
<font>
<Font size="16.0" />
</font>
</JFXButton>
</children>
</VBox>
</children>
</AnchorPane>
<AnchorPane prefHeight="454.0" prefWidth="44.0" style="-fx-background-color: white;" AnchorPane.bottomAnchor="0.0">
<children>
<VBox alignment="TOP_CENTER" prefHeight="200.0" prefWidth="44.0" spacing="10.0" style="-fx-background-color: white;" AnchorPane.topAnchor="20.0">
<children>
<ImageView fitHeight="46.0" fitWidth="32.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="image/button/burger.png" />
</image>
</ImageView>
<ImageView fitHeight="46.0" fitWidth="32.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@images/add.png" />
</image>
</ImageView>
<ImageView fitHeight="46.0" fitWidth="32.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@images/data.png" />
</image>
</ImageView>
<ImageView fitHeight="46.0" fitWidth="32.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@images/user.png" />
</image>
</ImageView>
<ImageView fitHeight="46.0" fitWidth="32.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@images/setting.png" />
</image>
</ImageView>
<ImageView fitHeight="46.0" fitWidth="32.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@images/backup.png" />
</image>
</ImageView>
</children>
</VBox>
</children>
</AnchorPane>
</children>
</AnchorPane>

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import com.jfoenix.controls.JFXButton?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.SplitPane?>
<?import javafx.scene.effect.Shadow?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.shape.Line?>
<?import javafx.scene.shape.Rectangle?>
<?import javafx.scene.text.Font?>
<?import javafx.scene.control.Button?>
<AnchorPane fx:controller="controller.GamePlayController" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="900.0" xmlns="http://javafx.com/javafx/11" xmlns:fx="http://javafx.com/fxml/1" >
<children>
<AnchorPane minHeight="300.0" minWidth="300.0" prefHeight="608.0" prefWidth="348.0" layoutX="600.0">
<children>
<Rectangle arcHeight="5.0" arcWidth="5.0" fill="#323436" height="608.0" layoutY="0.0" stroke="BLACK" strokeType="INSIDE" width="312.0" />
<ImageView fitHeight="128.0" fitWidth="93.0" layoutX="29.0" layoutY="33.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../image/personnage/Perso1.2.png" />
</image>
</ImageView>
<Label layoutX="144.0" layoutY="59.0" prefHeight="41.0" prefWidth="124.0" text="Pseudonyme" textFill="WHITE">
<font>
<Font name="Segoe UI Black" size="16.0" />
</font>
</Label>
<Rectangle arcHeight="5.0" arcWidth="5.0" height="331.0" layoutX="50.0" layoutY="166.0" opacity="0.3" stroke="BLACK" strokeDashOffset="10.0" strokeLineCap="ROUND" strokeLineJoin="ROUND" strokeMiterLimit="100.0" strokeType="INSIDE" strokeWidth="5.0" width="201.0" />
<Line endX="100.0" layoutX="139.0" layoutY="222.0" startX="-77.0" stroke="#f2f0f0" />
<Label alignment="CENTER" layoutX="88.0" layoutY="173.0" prefHeight="41.0" prefWidth="124.0" text="Action" textFill="WHITE">
<font>
<Font name="Segoe UI" size="16.0" />
</font>
</Label>
<JFXButton fx:id="buttonDe" onAction="#lancerDe" layoutX="95.0" layoutY="530.0" prefHeight="30.0" prefWidth="119.0" ripplerFill="#e1e1e1" style="-fx-background-color: #EB9C0A;" text="Lancer le dé" textAlignment="CENTER" textFill="WHITE">
<font>
<Font name="Segoe UI" size="15.0" />
</font>
<effect>
<Shadow />
</effect>
</JFXButton>
</children>
</AnchorPane>
</children>
<ImageView fx:id="persoImageView" fitHeight="32.0" fitWidth="32.0" layoutX="132.0" layoutY="74.0" pickOnBounds="true"
preserveRatio="true">
</ImageView>
</AnchorPane>

@ -1,39 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.Cursor?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.SplitPane?>
<?import javafx.scene.effect.ImageInput?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.text.Text?>
<SplitPane dividerPositions="0.6635044642857143" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" style="-fx-background-color: #404040;" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/17">
<items>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="397.0" prefWidth="439.0">
<children>
<ImageView fitHeight="397.0" fitWidth="397.0" layoutX="-2.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../terrain/map1.png" />
</image>
</ImageView>
</children></AnchorPane>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="397.0" prefWidth="197.0" style="-fx-background-color: darkgray;">
<children>
<Button layoutX="59.0" layoutY="311.0" mnemonicParsing="false" text="Lancer le dé" />
<Text layoutX="63.0" layoutY="155.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Tours :" />
<ImageView fitHeight="67.0" fitWidth="62.0" layoutX="28.0" layoutY="69.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@Perso1.2.png" />
</image>
</ImageView>
</children>
<effect>
<ImageInput />
</effect></AnchorPane>
</items>
<cursor>
<Cursor fx:constant="DEFAULT" />
</cursor>
</SplitPane>

@ -1,40 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.shape.Line?>
<?import javafx.scene.shape.Rectangle?>
<?import javafx.scene.text.Font?>
<?import javafx.scene.text.Text?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="900.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1">
<children>
<ImageView fitHeight="600.0" fitWidth="600.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@terrain/map1.png" />
</image>
</ImageView>
<Rectangle arcWidth="5.0" fill="#535353" height="614.0" layoutX="599.0" layoutY="-7.0" stroke="BLACK" strokeType="INSIDE" strokeWidth="0.0" width="302.0" />
<ImageView fitHeight="85.0" fitWidth="59.0" layoutX="625.0" layoutY="28.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@personnage/Perso1.2.png" />
</image>
</ImageView>
<Text fill="WHITE" layoutX="712.0" layoutY="64.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Joueur 1">
<font>
<Font name="Segoe UI Black" size="19.0" />
</font>
</Text>
<Button layoutX="711.0" layoutY="519.0" mnemonicParsing="false" style="-fx-background-color: #ffa20d;" text="Lancer le dé" textFill="WHITE" />
<Rectangle arcHeight="20.0" arcWidth="20.0" height="342.0" layoutX="624.0" layoutY="149.0" opacity="0.21" stroke="BLACK" strokeType="INSIDE" strokeWidth="0.0" width="252.0" />
<Text fill="WHITE" layoutX="729.0" layoutY="180.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Action">
<font>
<Font size="15.0" />
</font>
</Text>
<Line endX="74.33331298828125" endY="1.52587890625E-5" layoutX="763.0" layoutY="201.0" startX="-100.0" stroke="WHITE" />
</children>
</AnchorPane>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1000 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 970 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 989 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 978 B

After

Width:  |  Height:  |  Size: 978 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 970 B

After

Width:  |  Height:  |  Size: 970 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 970 B

After

Width:  |  Height:  |  Size: 970 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1012 B

After

Width:  |  Height:  |  Size: 1012 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 955 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 910 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 927 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

@ -9,17 +9,21 @@
<?import javafx.scene.text.Font?>
<?import javafx.scene.text.Text?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="900.0" xmlns="http://javafx.com/javafx/11" xmlns:fx="http://javafx.com/fxml/1">
<children>
<AnchorPane fx:controller="controller.PageGameController" maxHeight="-Infinity" maxWidth="-Infinity"
minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="900.0"
xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1">
<ImageView fitHeight="600.0" fitWidth="600.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="/image/terrain/map1.png" />
<Image url="@../image/terrain/map1.png"/>
</image>
</ImageView>
<Rectangle arcWidth="5.0" fill="#535353" height="614.0" layoutX="599.0" layoutY="-7.0" stroke="BLACK" strokeType="INSIDE" strokeWidth="0.0" width="302.0" />
<ImageView fx:id="persoImageView" fitHeight="32.0" fitWidth="32.0" layoutX="132.0" layoutY="74.0" pickOnBounds="true"
preserveRatio="true"/>
<Rectangle arcWidth="5.0" fill="#535353" height="614.0" layoutX="599.0" layoutY="-7.0" stroke="BLACK"
strokeType="INSIDE" strokeWidth="0.0" width="302.0"/>
<ImageView fitHeight="85.0" fitWidth="59.0" layoutX="625.0" layoutY="28.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="/image/personnage/Perso1.2.png" />
<Image url="@../image/personnage/Perso1.2.png"/>
</image>
</ImageView>
<Text fill="WHITE" layoutX="712.0" layoutY="64.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Joueur 1">
@ -27,13 +31,15 @@
<Font name="Segoe UI Black" size="19.0"/>
</font>
</Text>
<Button layoutX="711.0" layoutY="519.0" mnemonicParsing="false" style="-fx-background-color: #ffa20d;" text="Lancer le dé" textFill="WHITE" />
<Rectangle arcHeight="20.0" arcWidth="20.0" height="342.0" layoutX="624.0" layoutY="149.0" opacity="0.21" stroke="BLACK" strokeType="INSIDE" strokeWidth="0.0" width="252.0" />
<Button fx:id="boutonDe" onAction="#lancerDe" layoutX="711.0" layoutY="519.0" mnemonicParsing="false" style="-fx-background-color: #ffa20d;"
text="Lancer le dé" textFill="WHITE"/>
<Rectangle arcHeight="20.0" arcWidth="20.0" height="342.0" layoutX="624.0" layoutY="149.0" opacity="0.21"
stroke="BLACK" strokeType="INSIDE" strokeWidth="0.0" width="252.0"/>
<Text fill="WHITE" layoutX="729.0" layoutY="180.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Action">
<font>
<Font size="15.0"/>
</font>
</Text>
<Line endX="74.33331298828125" endY="1.52587890625E-5" layoutX="763.0" layoutY="201.0" startX="-100.0" stroke="WHITE" />
</children>
<Line endX="74.33331298828125" endY="1.52587890625E-5" layoutX="763.0" layoutY="201.0" startX="-100.0"
stroke="WHITE"/>
</AnchorPane>

@ -11,7 +11,8 @@
<?import javafx.scene.shape.Rectangle?>
<?import javafx.scene.text.Font?>
<AnchorPane fx:id="FirstAnchor" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="900.0" xmlns="http://javafx.com/javafx/11" xmlns:fx="http://javafx.com/fxml/1" fx:controller="controller.GamePlayController">
<?import javafx.scene.control.Button?>
<AnchorPane fx:controller="controller.GamePlayController" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="900.0" xmlns="http://javafx.com/javafx/11" xmlns:fx="http://javafx.com/fxml/1" >
<children>
<AnchorPane minHeight="300.0" minWidth="300.0" prefHeight="608.0" prefWidth="348.0" layoutX="600.0">
<children>
@ -33,7 +34,7 @@
<Font name="Segoe UI" size="16.0" />
</font>
</Label>
<JFXButton layoutX="95.0" layoutY="530.0" prefHeight="30.0" prefWidth="119.0" ripplerFill="#e1e1e1" style="-fx-background-color: #EB9C0A;" text="Lancer le dé" textAlignment="CENTER" textFill="WHITE">
<JFXButton fx:id="buttonDe" onAction="#lancerDe" layoutX="95.0" layoutY="530.0" prefHeight="30.0" prefWidth="119.0" ripplerFill="#e1e1e1" style="-fx-background-color: #EB9C0A;" text="Lancer le dé" textAlignment="CENTER" textFill="WHITE">
<font>
<Font name="Segoe UI" size="15.0" />
</font>
@ -44,4 +45,7 @@
</children>
</AnchorPane>
</children>
<ImageView fx:id="persoImageView" fitHeight="32.0" fitWidth="32.0" layoutX="132.0" layoutY="74.0" pickOnBounds="true"
preserveRatio="true">
</ImageView>
</AnchorPane>

@ -1,40 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.shape.Line?>
<?import javafx.scene.shape.Rectangle?>
<?import javafx.scene.text.Font?>
<?import javafx.scene.text.Text?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="900.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1">
<children>
<ImageView fitHeight="600.0" fitWidth="600.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@terrain/map1.png" />
</image>
</ImageView>
<Rectangle arcWidth="5.0" fill="#535353" height="614.0" layoutX="599.0" layoutY="-7.0" stroke="BLACK" strokeType="INSIDE" strokeWidth="0.0" width="302.0" />
<ImageView fitHeight="85.0" fitWidth="59.0" layoutX="625.0" layoutY="28.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@personnage/Perso1.2.png" />
</image>
</ImageView>
<Text fill="WHITE" layoutX="712.0" layoutY="64.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Joueur 1">
<font>
<Font name="Segoe UI Black" size="19.0" />
</font>
</Text>
<Button layoutX="711.0" layoutY="519.0" mnemonicParsing="false" style="-fx-background-color: #ffa20d;" text="Lancer le dé" textFill="WHITE" />
<Rectangle arcHeight="20.0" arcWidth="20.0" height="342.0" layoutX="624.0" layoutY="149.0" opacity="0.21" stroke="BLACK" strokeType="INSIDE" strokeWidth="0.0" width="252.0" />
<Text fill="WHITE" layoutX="729.0" layoutY="180.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Action">
<font>
<Font size="15.0" />
</font>
</Text>
<Line endX="74.33331298828125" endY="1.52587890625E-5" layoutX="763.0" layoutY="201.0" startX="-100.0" stroke="WHITE" />
</children>
</AnchorPane>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1000 B

After

Width:  |  Height:  |  Size: 1000 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 970 B

After

Width:  |  Height:  |  Size: 970 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 989 B

After

Width:  |  Height:  |  Size: 989 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 978 B

After

Width:  |  Height:  |  Size: 978 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 970 B

After

Width:  |  Height:  |  Size: 970 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 970 B

After

Width:  |  Height:  |  Size: 970 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1012 B

After

Width:  |  Height:  |  Size: 1012 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 955 B

After

Width:  |  Height:  |  Size: 955 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 910 B

After

Width:  |  Height:  |  Size: 910 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 927 B

After

Width:  |  Height:  |  Size: 927 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -42,17 +42,17 @@ public class GameConfigMenuController implements Initializable {
@FXML
void changeSkin1(ActionEvent event){
ImageChange.setImage(new Image("/image/personnage/Perso1.png"));
ImageChange.setImage(new Image("/image/personnage/Perso1.2.png"));
this.personnage = 1;
}
@FXML
void changeSkin2(ActionEvent event){
ImageChange.setImage(new Image("/image/personnage/Perso2.png"));
ImageChange.setImage(new Image("/image/personnage/Perso2.2.png"));
this.personnage = 2;
}
@FXML
void changeSkin3(ActionEvent event){
ImageChange.setImage(new Image("/image/personnage/Perso3.png"));
ImageChange.setImage(new Image("/image/personnage/Perso3.2.png"));
this.personnage = 3;
}
@ -71,9 +71,9 @@ public class GameConfigMenuController implements Initializable {
@FXML
void launchGame(MouseEvent event) throws Exception {
AnchorPane pane = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/fxml/viewGame.fxml")));
GamePlayController gm = new GamePlayController();
AnchorPane gp = gm.mapInitialisation(this.difficulty);
AnchorPane gp = gm.mapInitialisation(this.difficulty, this.personnage);
AnchorPane pane = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/fxml/viewGame.fxml")));
levelRoot.getChildren().addAll(gp, pane);
}

@ -1,8 +1,13 @@
package controller;
import javafx.animation.KeyFrame;
import javafx.animation.Timeline;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.Scene;
import javafx.scene.canvas.Canvas;
import javafx.scene.control.Button;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.image.WritableImage;
@ -14,6 +19,9 @@ import javafx.scene.shape.Rectangle;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.stage.Stage;
import javafx.util.Duration;
import model.Case;
import model.Map;
import java.net.URL;
import java.util.ResourceBundle;
@ -22,15 +30,218 @@ public class GamePlayController implements Initializable {
private final int tileSize = 20 ;
private AnchorPane FirstAnchor;
@FXML
private ImageView persoImageView;
public AnchorPane FirstAnchor;
PageGameController pageGameController;
PersoController persoController;
Case caseActuelle;
MapController mapController;
Case caseAncienne;
String pathPerso;
Image imagePerso;
@Override
public void initialize(URL url, ResourceBundle resourceBundle) {
}
public void spawnPlayer(int difficulty, int perso) throws NullPointerException {
if(persoImageView != null) {
System.out.println("persoImageView is null");
}else {
System.out.println("persoImageView is not null");
System.out.println(persoImageView);
}
persoController = new PersoController();
persoController.createPerso(difficulty, perso);
mapController = persoController.getMapController();
caseActuelle = mapController.getStartCase();
pathPerso = persoController.getPath();
imagePerso = new Image(getClass().getClassLoader().getResource(pathPerso+"2.png").toExternalForm());
System.out.println(pathPerso+"2.png");
persoImageView.setLayoutY(persoController.getY());
persoImageView.setLayoutX(persoController.getX());
persoImageView.setFitHeight(32);
persoImageView.setFitWidth(32);
persoImageView.setImage(imagePerso);
}
public void movePlayerNextCase() throws InterruptedException {
Map map = persoController.getMap();
caseAncienne = caseActuelle;
caseActuelle = mapController.getNextCase(caseActuelle);
Timeline timeline = new Timeline();
timeline.setCycleCount(1);
//animation déplacement vers la droite
if(caseActuelle.getCoordX() > caseAncienne.getCoordX()){
Image imagePerso7 = new Image(getClass().getClassLoader().getResource(pathPerso+"7.png").toExternalForm());
Image imagePerso8 = new Image(getClass().getClassLoader().getResource(pathPerso+"8.png").toExternalForm());
Image imagePerso9 = new Image(getClass().getClassLoader().getResource(pathPerso+"9.png").toExternalForm());
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(200), event -> {
persoImageView.setImage(imagePerso8);
persoImageView.setLayoutX(persoImageView.getLayoutX()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(300), event -> {
persoImageView.setImage(imagePerso7);
persoImageView.setLayoutX(persoImageView.getLayoutX()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(400), event -> {
persoImageView.setImage(imagePerso9);
persoImageView.setLayoutX(persoImageView.getLayoutX()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(500), event -> {
persoImageView.setImage(imagePerso7);
persoImageView.setLayoutX(persoImageView.getLayoutX()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(600), event -> {
persoImageView.setImage(imagePerso9);
persoImageView.setLayoutX(persoImageView.getLayoutX()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(700), event -> {
persoImageView.setImage(imagePerso7);
persoImageView.setLayoutX(persoImageView.getLayoutX()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(800), event -> {
persoImageView.setImage(imagePerso9);
persoImageView.setLayoutX(persoImageView.getLayoutX()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(900), event -> {
persoImageView.setImage(imagePerso8);
persoImageView.setLayoutX(persoImageView.getLayoutX()+4);
}));
timeline.play();
}
//animation déplacement vers la gauche
if(caseActuelle.getCoordX() < caseAncienne.getCoordX()){
Image imagePerso4 = new Image(getClass().getClassLoader().getResource(pathPerso+"4.png").toExternalForm());
Image imagePerso5 = new Image(getClass().getClassLoader().getResource(pathPerso+"5.png").toExternalForm());
Image imagePerso6 = new Image(getClass().getClassLoader().getResource(pathPerso+"6.png").toExternalForm());
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(200), event -> {
persoImageView.setImage(imagePerso5);
persoImageView.setLayoutX(persoImageView.getLayoutX()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(300), event -> {
persoImageView.setImage(imagePerso4);
persoImageView.setLayoutX(persoImageView.getLayoutX()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(400), event -> {
persoImageView.setImage(imagePerso6);
persoImageView.setLayoutX(persoImageView.getLayoutX()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(500), event -> {
persoImageView.setImage(imagePerso4);
persoImageView.setLayoutX(persoImageView.getLayoutX()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(600), event -> {
persoImageView.setImage(imagePerso6);
persoImageView.setLayoutX(persoImageView.getLayoutX()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(700), event -> {
persoImageView.setImage(imagePerso4);
persoImageView.setLayoutX(persoImageView.getLayoutX()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(800), event -> {
persoImageView.setImage(imagePerso6);
persoImageView.setLayoutX(persoImageView.getLayoutX()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(900), event -> {
persoImageView.setImage(imagePerso5);
persoImageView.setLayoutX(persoImageView.getLayoutX()+4);
}));
timeline.play();
}
//animation déplacement vers le haut
if(caseActuelle.getCoordY() < caseAncienne.getCoordY()){
Image imagePerso10 = new Image(getClass().getClassLoader().getResource(pathPerso+"10.png").toExternalForm());
Image imagePerso11 = new Image(getClass().getClassLoader().getResource(pathPerso+"11.png").toExternalForm());
Image imagePerso12 = new Image(getClass().getClassLoader().getResource(pathPerso+"12.png").toExternalForm());
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(200), event -> {
persoImageView.setImage(imagePerso11);
persoImageView.setLayoutY(persoImageView.getLayoutY()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(300), event -> {
persoImageView.setImage(imagePerso10);
persoImageView.setLayoutY(persoImageView.getLayoutY()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(400), event -> {
persoImageView.setImage(imagePerso12);
persoImageView.setLayoutY(persoImageView.getLayoutY()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(500), event -> {
persoImageView.setImage(imagePerso10);
persoImageView.setLayoutY(persoImageView.getLayoutY()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(600), event -> {
persoImageView.setImage(imagePerso12);
persoImageView.setLayoutY(persoImageView.getLayoutY()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(700), event -> {
persoImageView.setImage(imagePerso10);
persoImageView.setLayoutY(persoImageView.getLayoutY()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(800), event -> {
persoImageView.setImage(imagePerso12);
persoImageView.setLayoutY(persoImageView.getLayoutY()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(900), event -> {
persoImageView.setImage(imagePerso11);
persoImageView.setLayoutY(persoImageView.getLayoutY()+4);
}));
timeline.play();
}
//animation déplacement vers le bas
if(caseActuelle.getCoordY() > caseAncienne.getCoordY()){
Image imagePerso1 = new Image(getClass().getClassLoader().getResource(pathPerso+"1.png").toExternalForm());
Image imagePerso2 = new Image(getClass().getClassLoader().getResource(pathPerso+"2.png").toExternalForm());
Image imagePerso3 = new Image(getClass().getClassLoader().getResource(pathPerso+"3.png").toExternalForm());
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(200), event -> {
persoImageView.setImage(imagePerso2);
persoImageView.setLayoutY(persoImageView.getLayoutY()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(300), event -> {
persoImageView.setImage(imagePerso1);
persoImageView.setLayoutY(persoImageView.getLayoutY()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(400), event -> {
persoImageView.setImage(imagePerso3);
persoImageView.setLayoutY(persoImageView.getLayoutY()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(500), event -> {
persoImageView.setImage(imagePerso1);
persoImageView.setLayoutY(persoImageView.getLayoutY()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(600), event -> {
persoImageView.setImage(imagePerso3);
persoImageView.setLayoutY(persoImageView.getLayoutY()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(700), event -> {
persoImageView.setImage(imagePerso1);
persoImageView.setLayoutY(persoImageView.getLayoutY()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(800), event -> {
persoImageView.setImage(imagePerso3);
persoImageView.setLayoutY(persoImageView.getLayoutY()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(900), event -> {
persoImageView.setImage(imagePerso2);
persoImageView.setLayoutY(persoImageView.getLayoutY()+4);
}));
timeline.play();
}
}
public AnchorPane mapInitialisation(int difficulty){
public void lancerDe(ActionEvent actionEvent) throws InterruptedException {
movePlayerNextCase();
System.out.println("lancer de");
}
public AnchorPane mapInitialisation(int difficulty, int perso) {
spawnPlayer(difficulty, perso);
System.out.println("difficulty : " + difficulty);
if(difficulty == 1){
Image w = new Image("/image/terrain/chemin.png");
Image b = new Image("/image/terrain/herbe.png");
@ -217,6 +428,4 @@ public class GamePlayController implements Initializable {
image.getPixelWriter().setColor(0, 0, color);
return image ;
}
}

@ -0,0 +1,102 @@
package controller;
import javafx.fxml.Initializable;
import model.Case;
import model.Map;
public class MapController implements Initializable {
public Map map;
@Override
public void initialize(java.net.URL location, java.util.ResourceBundle resources) {
}
public void createMap(int difficulty) {
if (difficulty == 1) {
map = new Map(32,30);
Case case1 = new Case(1,2,2, true, false,map);
Case case2 = new Case(2,3,2, false, false,map);
Case case3 = new Case(3,4,2, false, false,map);
Case case4 = new Case(4,5,2, false, false,map);
Case case5 = new Case(5,5,3, false, false,map);
Case case6 = new Case(6,5,4, false, false,map);
Case case7 = new Case(7,5,5, false, false,map);
Case case8 = new Case(8,5,6, false, false,map);
Case case9 = new Case(9,5,7, false, false,map);
Case case10 = new Case(10,5,8, false, false,map);
map.addCase(case1);
map.addCase(case2);
map.addCase(case3);
map.addCase(case4);
map.addCase(case5);
map.addCase(case6);
map.addCase(case7);
map.addCase(case8);
map.addCase(case9);
map.addCase(case10);
}
if (difficulty == 2) {
map = new Map(32,30);
Case case1 = new Case(1,2,2, true, false,map);
Case case2 = new Case(2,3,2, false, false,map);
Case case3 = new Case(3,4,2, false, false,map);
Case case4 = new Case(4,5,2, false, false,map);
Case case5 = new Case(5,5,3, false, false,map);
Case case6 = new Case(6,5,4, false, false,map);
Case case7 = new Case(7,5,5, false, false,map);
Case case8 = new Case(8,5,6, false, false,map);
Case case9 = new Case(9,5,7, false, false,map);
Case case10 = new Case(10,5,8, false, false,map);
map.addCase(case1);
map.addCase(case2);
map.addCase(case3);
map.addCase(case4);
map.addCase(case5);
map.addCase(case6);
map.addCase(case7);
map.addCase(case8);
map.addCase(case9);
map.addCase(case10);
}
if (difficulty == 3) {
map = new Map(32,30);
Case case1 = new Case(1,2,2, true, false,map);
Case case2 = new Case(2,3,2, false, false,map);
Case case3 = new Case(3,4,2, false, false,map);
Case case4 = new Case(4,5,2, false, false,map);
Case case5 = new Case(5,5,3, false, false,map);
Case case6 = new Case(6,5,4, false, false,map);
Case case7 = new Case(7,5,5, false, false,map);
Case case8 = new Case(8,5,6, false, false,map);
Case case9 = new Case(9,5,7, false, false,map);
Case case10 = new Case(10,5,8, false, false,map);
map.addCase(case1);
map.addCase(case2);
map.addCase(case3);
map.addCase(case4);
map.addCase(case5);
map.addCase(case6);
map.addCase(case7);
map.addCase(case8);
map.addCase(case9);
map.addCase(case10);
}
if (difficulty != 1 && difficulty != 2 && difficulty != 3) {
System.out.println("Difficulty not found");
}
}
public Map getMap(){
return map;
}
public Case getCaseStart(){
return map.getStartCase();
}
public Case getNextCase(Case c){
return map.getNextCase(c);
}
public Case getStartCase(){
return map.getStartCase();
}
}

@ -0,0 +1,28 @@
package controller;
import model.Album;
import model.Musique;
import java.util.ArrayList;
public class MusiqueController {
private Album song;
public void playMusique() throws InterruptedException {
ArrayList<Musique> musiqueListe = new ArrayList<Musique>();
Musique song1 = new Musique("/musique/medieval_musique1.mp3",211000);
Musique song2 = new Musique("/musique/medieval_musique2.mp3",248000);
Musique song3 = new Musique("/musique/medieval_musique3.mp3",248000);
Musique song4 = new Musique("/musique/medieval_musique4.mp3",209000);
song = new Album(musiqueListe);
song.addList(song1);
song.addList(song2);
song.addList(song3);
song.addList(song4);
song.play();
}
public void stopMusique() {
song.stop();
}
}

@ -0,0 +1,234 @@
package controller;
import javafx.animation.Animation;
import javafx.animation.KeyFrame;
import javafx.animation.Timeline;
import javafx.animation.Transition;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.util.Duration;
import model.Avatar;
import model.Case;
import model.Map;
import java.net.URL;
import java.util.ResourceBundle;
public class PageGameController implements Initializable {
@FXML
private ImageView map;
@FXML
private Button boutonDe;
@FXML
private ImageView persoImageView;
PersoController persoController;
Case caseActuelle;
MapController mapController;
Case caseAncienne;
String pathPerso;
Image imagePerso;
/*public void spawnPlayer(ImageView ImageView, int difficulty) {
if(persoImageView != null) {
System.out.println("persoImageView is null");
}else {
System.out.println("persoImageView is not null");
}
this.persoImageView = ImageView;
persoController = new PersoController();
persoController.createPerso(difficulty);
mapController = persoController.getMapController();
caseActuelle = mapController.getStartCase();
pathPerso = persoController.getPath();
imagePerso = new Image(getClass().getClassLoader().getResource(pathPerso+"2.png").toExternalForm());
persoImageView.setLayoutY(persoController.getY());
persoImageView.setLayoutX(persoController.getX());
persoImageView.setFitHeight(32);
persoImageView.setFitWidth(32);
persoImageView.setImage(imagePerso);
}*/
public void movePlayerNextCase() throws InterruptedException {
mapController = persoController.getMapController();
Map map = persoController.getMap();
caseAncienne = caseActuelle;
caseActuelle = mapController.getNextCase(caseActuelle);
Timeline timeline = new Timeline();
timeline.setCycleCount(1);
//animation déplacement vers la droite
if(caseActuelle.getCoordX() > caseAncienne.getCoordX()){
Image imagePerso7 = new Image(getClass().getClassLoader().getResource(pathPerso+"7.png").toExternalForm());
Image imagePerso8 = new Image(getClass().getClassLoader().getResource(pathPerso+"8.png").toExternalForm());
Image imagePerso9 = new Image(getClass().getClassLoader().getResource(pathPerso+"9.png").toExternalForm());
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(200), event -> {
persoImageView.setImage(imagePerso8);
persoImageView.setLayoutX(persoImageView.getLayoutX()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(300), event -> {
persoImageView.setImage(imagePerso7);
persoImageView.setLayoutX(persoImageView.getLayoutX()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(400), event -> {
persoImageView.setImage(imagePerso9);
persoImageView.setLayoutX(persoImageView.getLayoutX()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(500), event -> {
persoImageView.setImage(imagePerso7);
persoImageView.setLayoutX(persoImageView.getLayoutX()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(600), event -> {
persoImageView.setImage(imagePerso9);
persoImageView.setLayoutX(persoImageView.getLayoutX()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(700), event -> {
persoImageView.setImage(imagePerso7);
persoImageView.setLayoutX(persoImageView.getLayoutX()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(800), event -> {
persoImageView.setImage(imagePerso9);
persoImageView.setLayoutX(persoImageView.getLayoutX()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(900), event -> {
persoImageView.setImage(imagePerso8);
persoImageView.setLayoutX(persoImageView.getLayoutX()+4);
}));
timeline.play();
}
//animation déplacement vers la gauche
if(caseActuelle.getCoordX() < caseAncienne.getCoordX()){
Image imagePerso4 = new Image(getClass().getClassLoader().getResource(pathPerso+"4.png").toExternalForm());
Image imagePerso5 = new Image(getClass().getClassLoader().getResource(pathPerso+"5.png").toExternalForm());
Image imagePerso6 = new Image(getClass().getClassLoader().getResource(pathPerso+"6.png").toExternalForm());
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(200), event -> {
persoImageView.setImage(imagePerso5);
persoImageView.setLayoutX(persoImageView.getLayoutX()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(300), event -> {
persoImageView.setImage(imagePerso4);
persoImageView.setLayoutX(persoImageView.getLayoutX()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(400), event -> {
persoImageView.setImage(imagePerso6);
persoImageView.setLayoutX(persoImageView.getLayoutX()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(500), event -> {
persoImageView.setImage(imagePerso4);
persoImageView.setLayoutX(persoImageView.getLayoutX()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(600), event -> {
persoImageView.setImage(imagePerso6);
persoImageView.setLayoutX(persoImageView.getLayoutX()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(700), event -> {
persoImageView.setImage(imagePerso4);
persoImageView.setLayoutX(persoImageView.getLayoutX()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(800), event -> {
persoImageView.setImage(imagePerso6);
persoImageView.setLayoutX(persoImageView.getLayoutX()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(900), event -> {
persoImageView.setImage(imagePerso5);
persoImageView.setLayoutX(persoImageView.getLayoutX()+4);
}));
timeline.play();
}
//animation déplacement vers le haut
if(caseActuelle.getCoordY() < caseAncienne.getCoordY()){
Image imagePerso10 = new Image(getClass().getClassLoader().getResource(pathPerso+"10.png").toExternalForm());
Image imagePerso11 = new Image(getClass().getClassLoader().getResource(pathPerso+"11.png").toExternalForm());
Image imagePerso12 = new Image(getClass().getClassLoader().getResource(pathPerso+"12.png").toExternalForm());
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(200), event -> {
persoImageView.setImage(imagePerso11);
persoImageView.setLayoutY(persoImageView.getLayoutY()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(300), event -> {
persoImageView.setImage(imagePerso10);
persoImageView.setLayoutY(persoImageView.getLayoutY()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(400), event -> {
persoImageView.setImage(imagePerso12);
persoImageView.setLayoutY(persoImageView.getLayoutY()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(500), event -> {
persoImageView.setImage(imagePerso10);
persoImageView.setLayoutY(persoImageView.getLayoutY()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(600), event -> {
persoImageView.setImage(imagePerso12);
persoImageView.setLayoutY(persoImageView.getLayoutY()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(700), event -> {
persoImageView.setImage(imagePerso10);
persoImageView.setLayoutY(persoImageView.getLayoutY()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(800), event -> {
persoImageView.setImage(imagePerso12);
persoImageView.setLayoutY(persoImageView.getLayoutY()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(900), event -> {
persoImageView.setImage(imagePerso11);
persoImageView.setLayoutY(persoImageView.getLayoutY()+4);
}));
timeline.play();
}
//animation déplacement vers le bas
if(caseActuelle.getCoordY() > caseAncienne.getCoordY()){
Image imagePerso1 = new Image(getClass().getClassLoader().getResource(pathPerso+"1.png").toExternalForm());
Image imagePerso2 = new Image(getClass().getClassLoader().getResource(pathPerso+"2.png").toExternalForm());
Image imagePerso3 = new Image(getClass().getClassLoader().getResource(pathPerso+"3.png").toExternalForm());
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(200), event -> {
persoImageView.setImage(imagePerso2);
persoImageView.setLayoutY(persoImageView.getLayoutY()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(300), event -> {
persoImageView.setImage(imagePerso1);
persoImageView.setLayoutY(persoImageView.getLayoutY()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(400), event -> {
persoImageView.setImage(imagePerso3);
persoImageView.setLayoutY(persoImageView.getLayoutY()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(500), event -> {
persoImageView.setImage(imagePerso1);
persoImageView.setLayoutY(persoImageView.getLayoutY()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(600), event -> {
persoImageView.setImage(imagePerso3);
persoImageView.setLayoutY(persoImageView.getLayoutY()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(700), event -> {
persoImageView.setImage(imagePerso1);
persoImageView.setLayoutY(persoImageView.getLayoutY()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(800), event -> {
persoImageView.setImage(imagePerso3);
persoImageView.setLayoutY(persoImageView.getLayoutY()+4);
}));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(900), event -> {
persoImageView.setImage(imagePerso2);
persoImageView.setLayoutY(persoImageView.getLayoutY()+4);
}));
timeline.play();
}
}
@Override
public void initialize(URL url, ResourceBundle resourceBundle) {
}
public void lancerDe(ActionEvent actionEvent) throws InterruptedException {
movePlayerNextCase();
System.out.println("lancer de");
}
}

@ -0,0 +1,53 @@
package controller;
import model.Avatar;
import model.Map;
public class PersoController {
Avatar avatar;
MapController mc;
Map map;
public void createPerso(int difficulty, int perso) {
mc = new MapController();
mc.createMap(difficulty);
map = mc.getMap();
if (perso == 1) {
avatar = new Avatar(1, "image/personnage/Perso1.");
System.out.println("Perso 1");
}
if(perso == 2){
avatar = new Avatar(2, "image/personnage/Perso2.");
System.out.println("Perso 2");
}
if(perso == 3){
avatar = new Avatar(3, "image/personnage/Perso3.");
System.out.println("Perso 3");
}
if(perso != 1 && perso != 2 && perso != 3){
System.out.println("Perso non reconnu");
}
avatar.setCoord(map.getCoordStartX(), map.getCoordStartY());
if(avatar == null){
System.out.println("Erreur avatar");
}else{
System.out.println("Avatar créé");
}
}
public Map getMap() {
return map;
}
public MapController getMapController() {
return mc;
}
public String getPath(){
String path = avatar.getImage();
return path;
}
public int getX(){
return avatar.getCoordX();
}
public int getY(){
return avatar.getCoordY();
}
}

@ -1,5 +1,6 @@
package launcher;
import controller.MusiqueController;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
@ -18,7 +19,7 @@ import java.util.Objects;
public class Main extends Application {
private static Database currentd;
private Album song;
private MusiqueController mc;
@Override
public void start(Stage primaryStage) throws Exception {
@ -28,52 +29,15 @@ public class Main extends Application {
primaryStage.setScene(new Scene(root, 900, 600));
primaryStage.setResizable(false);
primaryStage.show();
//début musique
ArrayList<Musique> musiqueListe = new ArrayList<Musique>();
Musique song1 = new Musique("/musique/medieval_musique1.mp3",211000);
Musique song2 = new Musique("/musique/medieval_musique2.mp3",248000);
Musique song3 = new Musique("/musique/medieval_musique3.mp3",248000);
Musique song4 = new Musique("/musique/medieval_musique4.mp3",209000);
song = new Album(musiqueListe);
song.addList(song1);
song.addList(song2);
song.addList(song3);
song.addList(song4);
song.play();
//fin musique
//début map
//Map map = new Map(30,5,5,20,20);
Map map = new Map(32,30);
Case case1 = new Case(1,2,2, true, false,map);
Case case2 = new Case(2,3,2, false, false,map);
Case case3 = new Case(3,4,2, false, false,map);
Case case4 = new Case(4,5,2, false, false,map);
map.addCase(case1);
map.addCase(case2);
map.addCase(case3);
map.addCase(case4);
Avatar avatar1 = new Avatar(1, "/image/personnage/Person1.2.png");
avatar1.setCoord(map.getCoordStartX(), map.getCoordStartY());
//fin map
//fin map
mc = new MusiqueController();
mc.playMusique();
}
/*
@Override
public void stop(){
System.out.println("Stopping");
song.stop();
mc.stopMusique();
}
*/

@ -20,23 +20,6 @@ public class Album {
}
public void play() throws InterruptedException {
//System.out.println(listeMusiques.get(0).getPath());
/*AudioClip mediaPlayer;
Musique musicActuelle;
int i=1;
while(mediaPlayer.isPlaying() == true) {
musicActuelle = listeMusiques.get(i);
if (musicActuelle == null) {
i = 0;
}
Media media = new Media(Objects.requireNonNull(getClass().getResource(musicActuelle.getPath())).toExternalForm());
mediaPlayer = new AudioClip(media.getSource());
mediaPlayer.volumeProperty().setValue(0.025);
mediaPlayer.play();
i++;
}*/
musicThread = new Thread("musique") {
public void run(){
int i;
@ -67,7 +50,6 @@ public class Album {
public void addList(Musique musique){
listeMusiques.add(musique);
System.out.println("add");
}
public void removeList(Musique musique){

@ -16,23 +16,18 @@ public class Map {
public void addCase(Case c) {
this.map.add(c);
}
public void removeCase(Case c) {
this.map.remove(c);
}
public ArrayList<Case> getMap() {
return this.map;
}
public int getSizeTile() {
return this.sizeTile;
}
public int getSizeMap() {
return this.sizeMap;
}
public int getCoordStartX(){
for(Case c : this.map){
if(c.isStart == true){
@ -41,7 +36,6 @@ public class Map {
}
return 666; //code erreur
}
public int getCoordStartY(){
for(Case c : this.map){
if(c.isStart == true){
@ -50,6 +44,26 @@ public class Map {
}
return 666; //code erreur
}
public Case getNextCase(Case c){
int i;
int j;
for(i = 0; i < this.map.size(); i++){
if(c == this.map.get(i)){
j=i+1;
System.out.println("i : "+i+" j : "+j);
return this.map.get(j);
}
}
return c;
}
public Case getStartCase(){
for(Case c : this.map){
if(c.isStart == true){
return c;
}
}
return null;
}
}

Loading…
Cancel
Save