Skip to content
Snippets Groups Projects
Commit 4cc33e53 authored by Azurlors's avatar Azurlors
Browse files

ça marche !!

parent 769f7a79
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,7 @@ package jeu;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.nio.file.Paths;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
......@@ -30,10 +30,13 @@ public class Jeu implements Game{
public Jeu(String source) {
BufferedReader helpReader;
beginPath = Paths.get(".").toAbsolutePath().normalize() + "\\src\\main\\resources\\Frames_perso\\"; // met ce que tu veux pour pas avoir de pb et pour les tests
String fn = "Frames_perso";
URL url = Jeu.class.getClassLoader().getResource(fn);
assert url != null;
beginPath = url.toString().substring(6)+"/";
movement = "Character_idle";
numberOfMovement = 1;
characterSkinPath = beginPath + movement + Integer.toString(numberOfMovement) + ".png"; // path premiere frame
characterSkinPath = beginPath + movement + numberOfMovement + ".png"; // path premiere frame
/*A = new ArrayList<Double>();
n = 0;*/
gameCharacterLoader = new CharacterLoader(characterSkinPath,new Character(new Coordonnees(200, 300), 2000, 1,600000));
......@@ -49,7 +52,7 @@ public class Jeu implements Game{
System.out.println("Help not available");
}
directionJeu = new HashMap<String,Boolean>();
directionJeu = new HashMap<>();
directionJeu.put("Right", false);
directionJeu.put("Left", false);
directionJeu.put("Jump", false);
......@@ -101,7 +104,7 @@ public class Jeu implements Game{
nbBeforeFramechgt = nbIterationPerFrame;
}
else nbBeforeFramechgt--;
characterSkinPath = beginPath + movement + Integer.toString(numberOfMovement) + ".png";
characterSkinPath = beginPath + movement + numberOfMovement + ".png";
gameCharacterLoader.setSkinPath(characterSkinPath);
gameCharacterLoader.refreshImage();
......
......@@ -12,13 +12,6 @@ public class Main {
public static void main(String[] args) throws InterruptedException {
//Façon de prendre l'url pour toi Louis
System.out.println("\n");
String fn = "Frames_perso/Character_attack1.png";
java.net.URL url = Main.class.getClassLoader().getResource(fn);
System.out.println(url);
System.out.println("\n");
// creation du jeu particulier et de son afficheur
Jeu game = new Jeu("helpFilePacman.txt");
Painter painter = new Painter();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment