Merge remote-tracking branch 'origin/main'

# Conflicts:
#	code/ressources/image/personnage/Perso1.png
julien
ZartaX0O3 4 years ago
commit 9956ab1cbe

@ -3,10 +3,20 @@
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/ressources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="lib" level="project" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../Téléchargements/jfoenix-9.0.10.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>
</module>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

@ -4,8 +4,14 @@ import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.media.MediaPlayer;
import javafx.stage.Stage;
import model.Database;
import javafx.scene.media.Media;
import model.Musique;
import java.io.File;
import java.io.*;
import java.util.Objects;
@ -15,19 +21,26 @@ public class Main extends Application {
private static Database currentd;
@Override
public void start(Stage primaryStage) throws Exception{
public void start(Stage primaryStage) throws Exception {
Parent root = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/fxml/GameConfigurationMenu.fxml")));
primaryStage.setTitle("Hello World");
primaryStage.setScene(new Scene(root, 900, 600));
primaryStage.setResizable(false);
primaryStage.show();
String pathmusique ="/musique/medieval_musique1.mp3";
System.out.println(pathmusique);
Musique song = new Musique();
song.play(pathmusique);
//song.sound.isPlaying()
}
public static Database getDatabase(){
public static Database getDatabase() {
return currentd;
}
public static void serialize() throws IOException {
try (ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream("database.txt"))) {
out.writeObject(currentd);
@ -36,20 +49,16 @@ public class Main extends Application {
System.exit(0);
}
}
public static void deserialize() throws ClassNotFoundException, IOException{
public static void deserialize() throws ClassNotFoundException, IOException {
ObjectInputStream in = null;
try {
in=new ObjectInputStream (new FileInputStream("database.txt"));
currentd=(Database) in.readObject();
in = new ObjectInputStream(new FileInputStream("database.txt"));
currentd = (Database) in.readObject();
in.close();
}
catch (FileNotFoundException | NullPointerException e){
currentd=new Database();
} catch (FileNotFoundException | NullPointerException e) {
currentd = new Database();
}
}
public static void main(String[] args) {
launch(args);
}
}

@ -1,52 +0,0 @@
package model;
public class Avatar {
int idAvatar;
String image;
int coordX;
int coordY;
public Avatar(int idAvatar, String image, int coordX, int coordY) {
this.idAvatar = idAvatar;
this.image = image;
this.coordX = coordX;
this.coordY = coordY;
}
public Avatar(int idAvatar, String image) {
this.idAvatar = idAvatar;
this.image = image;
}
public int getIdAvatar() {
return idAvatar;
}
public String getImage() {
return image;
}
public int getCoordX() {
return coordX;
}
public int getCoordY() {
return coordY;
}
public void setIdAvatar(int idAvatar) {
this.idAvatar = idAvatar;
}
public void setImage(String image) {
this.image = image;
}
public void setCoordX(int coordX) {
this.coordX = coordX;
}
public void setCoordY(int coordY) {
this.coordY = coordY;
}
}

@ -1,57 +0,0 @@
package model;
public class Case {
int idCase;
int coordX;
int coordY;
boolean isStart;
boolean isEnd;
public Case(int idCase, int coordX, int coordY, boolean isStart, boolean isEnd) {
this.idCase = idCase;
this.coordX = coordX;
this.coordY = coordY;
this.isStart = isStart;
this.isEnd = isEnd;
}
public int getIdCase() {
return idCase;
}
public int getCoordX() {
return coordX;
}
public int getCoordY() {
return coordY;
}
public boolean isStart() {
return isStart;
}
public boolean isEnd() {
return isEnd;
}
public void setIdCase(int idCase) {
this.idCase = idCase;
}
public void setCoordX(int coordX) {
this.coordX = coordX;
}
public void setCoordY(int coordY) {
this.coordY = coordY;
}
public void setStart(boolean start) {
isStart = start;
}
public void setEnd(boolean end) {
isEnd = end;
}
}

@ -0,0 +1,19 @@
package model;
import javafx.scene.media.AudioClip;
import javafx.scene.media.Media;
import javafx.scene.media.MediaPlayer;
import java.util.Objects;
public class Musique {
public void play(String path) {
Media media = new Media(Objects.requireNonNull(getClass().getResource(path)).toExternalForm());
AudioClip mediaPlayer = new AudioClip(media.getSource());
mediaPlayer.volumeProperty().setValue(0.025);
mediaPlayer.play();
}
}
Loading…
Cancel
Save