Réorganisation du projet

julien
ZartaX0O3 4 years ago
parent b09fc7af18
commit 0e81d33751

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DiscordProjectSettings">
<option name="show" value="PROJECT" />
<option name="description" value="" />
</component>
</project>

2
code/.gitignore vendored

@ -6,7 +6,7 @@
# BlueJ files
*.ctxt
/.idea
# Mobile Tools for Java (J2ME)
.mtj.tmp/

@ -1,5 +1,4 @@
#player{
-fx-text-fill: #ffffff;
}

@ -8,20 +8,19 @@
<?import javafx.scene.shape.Circle?>
<?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"
xmlns="http://javafx.com/javafx/11" fx:controller="sample.MainPageController">
<Circle layoutX="146.0" layoutY="138.0" opacity="0.42" radius="219.0" stroke="BLACK" strokeType="INSIDE"/>
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"
AnchorPane.topAnchor="0.0">
<Image url="/fire.gif"/>
<Image url="/image/plaine.gif"/>
</ImageView>
<Circle layoutX="146.0" layoutY="138.0" opacity="0.42" radius="219.0" stroke="BLACK" strokeType="INSIDE"/>
<ImageView fitHeight="205.0" fitWidth="204.0" layoutX="61.0" layoutY="-26.0" pickOnBounds="true"
preserveRatio="true">
<Image url="/logo.png"/>
<Image url="/image/logo.png"/>
</ImageView>
<JFXButton layoutX="104.0" layoutY="163.0" prefHeight="30.0" prefWidth="119.0"
style="-fx-background-color: #EB9C0A;" text="New Game" textFill="WHITE" onMouseClicked="#startGame">

@ -10,16 +10,15 @@
<?import javafx.scene.shape.Rectangle?>
<?import javafx.scene.text.*?>
<?import java.net.URL?>
<AnchorPane fx:id="levelRoot" xmlns:fx="http://javafx.com/fxml/1" id="pane" opacity="0.91" prefHeight="600.0"
prefWidth="800.0"
xmlns="http://javafx.com/javafx/11" fx:controller="sample.TopPlayerController">
<stylesheets>
<URL value="@../css/anchor.css"/>
</stylesheets>
<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"
xmlns="http://javafx.com/javafx/11" fx:controller="controller.TopPlayerController">
<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"
AnchorPane.topAnchor="0.0">
<Image url="/fire.gif"/>
<Image url="/image/plaine.gif"/>
</ImageView>
<JFXButton onMouseClicked="#returnToMenu" layoutX="20.0" layoutY="10.0" prefHeight="30.0" prefWidth="80.0"
style="-fx-background-color: #EB9C0A;"
@ -35,7 +34,7 @@
strokeType="INSIDE" width="500.0"/>
<ImageView fitHeight="205.0" fitWidth="204.0" layoutX="350.0" layoutY="-4.0" pickOnBounds="true"
preserveRatio="true">
<Image url="/logo.png"/>
<Image url="/image/logo.png"/>
</ImageView>
<Label layoutX="387.0" layoutY="168.0" text="Top Players">
<font>
@ -105,32 +104,32 @@
</LinearGradient>
</textFill>
</Label>
<Label id="player" layoutX="395.0" layoutY="315.0" text="4 - ZartaX0O3">
<Label id="player" layoutX="395.0" layoutY="315.0" text="4 - ZartaX0O3" textFill="WHITE">
<font>
<Font name="Segoe UI Black" size="17.0"/>
</font>
</Label>
<Label id="player" layoutX="395.0" layoutY="382.0" text="6 - ZartaX0O3">
<Label id="player" layoutX="395.0" layoutY="382.0" text="6 - ZartaX0O3" textFill="WHITE">
<font>
<Font name="Segoe UI Black" size="17.0"/>
</font>
</Label>
<Label id="player" layoutX="395.0" layoutY="347.0" text="5 - ZartaX0O3">
<Label id="player" layoutX="395.0" layoutY="347.0" text="5 - ZartaX0O3" textFill="WHITE">
<font>
<Font name="Segoe UI Black" size="17.0"/>
</font>
</Label>
<Label id="player" layoutX="395.0" layoutY="417.0" text="7 - ZartaX0O3">
<Label id="player" layoutX="395.0" layoutY="417.0" text="7 - ZartaX0O3" textFill="WHITE">
<font>
<Font name="Segoe UI Black" size="17.0"/>
</font>
</Label>
<Label id="player" layoutX="395.0" layoutY="450.0" text="8 - ZartaX0O3">
<Label id="player" layoutX="395.0" layoutY="450.0" text="8 - ZartaX0O3" textFill="WHITE">
<font>
<Font name="Segoe UI Black" size="17.0"/>
</font>
</Label>
<Label id="player" layoutX="395.0" layoutY="486.0" text="9 - ZartaX0O3">
<Label id="player" layoutX="395.0" layoutY="486.0" text="9 - ZartaX0O3" textFill="WHITE">
<font>
<Font name="Segoe UI Black" size="17.0"/>
</font>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 675 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 862 B

Before

Width:  |  Height:  |  Size: 1.6 MiB

After

Width:  |  Height:  |  Size: 1.6 MiB

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

@ -1,18 +1,14 @@
package sample;
package controller;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.chart.PieChart;
import javafx.scene.control.Button;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.AnchorPane;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Objects;
import java.util.ResourceBundle;
@ -45,7 +41,7 @@ public class MainPageController implements Initializable {
@FXML
void viewScore(MouseEvent event) throws Exception{
AnchorPane pane = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("TopPlayers.fxml")));
AnchorPane pane = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/fxml/TopPlayers.fxml")));
mainRoot.getChildren().setAll(pane);
}

@ -1,18 +1,13 @@
package sample;
package controller;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.chart.PieChart;
import javafx.scene.control.Button;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.AnchorPane;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Objects;
import java.util.ResourceBundle;
@ -32,7 +27,7 @@ public class TopPlayerController implements Initializable {
@FXML
void returnToMenu(MouseEvent event) throws Exception{
AnchorPane pane = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("MainPage.fxml")));
AnchorPane pane = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/fxml/MainPage.fxml")));
levelRoot.getChildren().setAll(pane);
}

@ -1,21 +1,55 @@
package launcher;
import model.Avatar;
import model.Case;
public class Main {
public static void Main (String[] args) {
Case depart = new Case(1,10,10,true,false);
Avatar avatar1 = new Avatar(1,"Perso1.1.png",0,0);
int xdepart = depart.getCoordX();
avatar1.setCoordX(xdepart);
int ydepart = depart.getCoordY();
avatar1.setCoordY(ydepart);
int xavatar1 = avatar1.getCoordX();
int yavatar1 = avatar1.getCoordY();
System.out.println("xavatar1 = " + xavatar1);
System.out.println("yavatar1 = " + yavatar1);
System.out.println("xdepart = " + xdepart);
System.out.println("ydepart = " + ydepart);
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import model.Database;
import java.io.*;
import java.util.Objects;
public class Main extends Application {
private static Database currentd;
@Override
public void start(Stage primaryStage) throws Exception{
Parent root = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/fxml/ConfigurationMenu.fxml")));
primaryStage.setTitle("Hello World");
primaryStage.setScene(new Scene(root, 900, 600));
primaryStage.setResizable(false);
primaryStage.show();
}
public static Database getDatabase(){
return currentd;
}
public static void serialize() throws IOException {
try (ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream("database.txt"))) {
out.writeObject(currentd);
} finally {
//System.out.println("Saved!");
System.exit(0);
}
}
public static void deserialize() throws ClassNotFoundException, IOException{
ObjectInputStream in = null;
try {
in=new ObjectInputStream (new FileInputStream("database.txt"));
currentd=(Database) in.readObject();
in.close();
}
catch (FileNotFoundException | NullPointerException e){
currentd=new Database();
}
}
public static void main(String[] args) {
launch(args);
}
}

@ -1,14 +1,9 @@
package sample;
package model;
import javafx.scene.layout.Pane;
import launcher.Main;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
public class DataTable implements Serializable {
private static int id=0;

@ -1,4 +1,4 @@
package sample;
package model;
import java.io.*;
import java.util.ArrayList;

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import com.jfoenix.controls.JFXButton?>
<?import javafx.scene.control.*?>
<?import javafx.scene.effect.Shadow?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.paint.*?>
<?import javafx.scene.shape.Rectangle?>
<?import javafx.scene.text.*?>
<?import java.net.URL?>
<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"
xmlns="http://javafx.com/javafx/11" fx:controller="controller.TopPlayerController">
<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"
AnchorPane.topAnchor="0.0">
<Image url="/image/plaine.gif"/>
</ImageView>
<Rectangle arcHeight="5.0" arcWidth="5.0" height="600.0" layoutX="50" opacity="0.42" stroke="BLACK"
strokeType="INSIDE" width="800.0"/>
</AnchorPane>
Loading…
Cancel
Save