Début pre start game menu

julien
ZartaX0O3 4 years ago
parent ce8d6c6e79
commit 606b03ca92

@ -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,8 +9,8 @@
<?import javafx.scene.text.Font?>
<AnchorPane fx:id="mainRoot" xmlns:fx="http://javafx.com/fxml/1" id="pane" maxHeight="-Infinity" maxWidth="-Infinity"
minHeight="-Infinity"
minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0"
minHeight="-Infinity"
minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0"
xmlns="http://javafx.com/javafx/11" fx:controller="controller.MainPageController">
<ImageView fitHeight="600.0" fitWidth="1300" layoutX="133.0" layoutY="150.0" pickOnBounds="true" preserveRatio="true"
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"

@ -9,8 +9,7 @@
<?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">
<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="600.0" fitWidth="600.0" pickOnBounds="true" preserveRatio="true">
<image>

@ -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>

@ -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>

@ -4,14 +4,14 @@ import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.control.MenuItem;
import javafx.scene.control.RadioButton;
import javafx.scene.control.ToggleGroup;
import javafx.scene.control.*;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.GridPane;
import java.io.IOException;
import java.net.URL;
import java.util.Objects;
import java.util.ResourceBundle;
@ -23,39 +23,62 @@ public class GameConfigMenuController implements Initializable {
@FXML private RadioButton radioButton1;
@FXML private RadioButton radioButton2;
@FXML private RadioButton radioButton3;
@FXML private Button button1;
@FXML private MenuItem choice1;
@FXML private MenuItem choice2;
@FXML private MenuItem choice3;
@FXML private ImageView ImageChange;
@FXML private ToggleGroup group;
private int personnage;
private int difficulty;
@Override
public void initialize(URL url, ResourceBundle resourceBundle) {
ToggleGroup group = new ToggleGroup();
radioButton1.setToggleGroup(group);
radioButton2.setToggleGroup(group);
radioButton3.setToggleGroup(group);
}
@FXML
void changeSkin(ActionEvent event){
choice1.setOnAction((e)-> {
void changeSkin1(ActionEvent event){
ImageChange.setImage(new Image("/image/personnage/Perso1.png"));
this.personnage = 1;
});
choice2.setOnAction((e)-> {
ImageChange.setImage(new Image("/image/personnage/Perso2.png"));
this.personnage = 2;
});
choice3.setOnAction((e)-> {
ImageChange.setImage(new Image("/image/personnage/Perso3.png"));
this.personnage = 3;
});
}
@FXML
void changeSkin2(ActionEvent event){
ImageChange.setImage(new Image("/image/personnage/Perso2.png"));
this.personnage = 2;
}
@FXML
void changeSkin3(ActionEvent event){
ImageChange.setImage(new Image("/image/personnage/Perso3.png"));
this.personnage = 3;
}
@FXML
void setDifficulty1(MouseEvent event){
this.difficulty = 1;
}
@FXML
void setDifficulty2(MouseEvent event){
this.difficulty = 2;
}
@FXML
void setDifficulty3(MouseEvent event){
this.difficulty = 3;
}
@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);
levelRoot.getChildren().addAll(gp, pane);
}
@FXML
void returnToMenu(MouseEvent event) throws Exception{
void returnToMenu(MouseEvent event) throws Exception{
AnchorPane pane = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/fxml/MainPage.fxml")));
levelRoot.getChildren().setAll(pane);
}

@ -47,8 +47,7 @@ public class MainPageController implements Initializable {
@FXML
void startGame(MouseEvent event) throws Exception{
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("GamePlay.fxml"));
AnchorPane pane=fxmlLoader.load();
// Appelle au controler de jeu....
AnchorPane pane = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/fxml/GameConfigurationMenu.fxml")));
mainRoot.getChildren().setAll(pane);
}
}

@ -10,8 +10,6 @@ import model.*;
import javafx.scene.media.Media;
import java.io.File;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
@ -25,11 +23,13 @@ public class Main extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
Parent root = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/fxml/PageGame.fxml")));
primaryStage.setTitle("Hello World");
Parent root = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/fxml/MainPage.fxml")));
primaryStage.setTitle("The Adventurer");
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);
@ -66,12 +66,15 @@ public class Main extends Application {
}
/*
@Override
public void stop(){
System.out.println("Stopping");
song.stop();
}
*/
public static Database getDatabase() {

Loading…
Cancel
Save