Skip to content
Snippets Groups Projects
Commit 90e98a03 authored by Louis MALTERRE's avatar Louis MALTERRE
Browse files

collisions de nouveau operationnelles LM

parent 22ef7425
No related branches found
No related tags found
No related merge requests found
......@@ -133,7 +133,7 @@ public class Character extends Entity{
public void keyGestion() {
for (Coffre cof : Jeu.getCoffreTable()){
if (collision(this.getHitBox(), cof.getHitbox())){
if (HitBox.collision(this.getHitBox(), cof.getHitbox())){
if (cof.key ==true) {
this.key += 1;
cof.key = false;
......@@ -196,7 +196,6 @@ public class Character extends Entity{
deplacements();
collisionGestion();
keyGestion();
System.out.println(obstacleBeneath);
//updateVoisinage();
this.setHitBox(new HitBox(this.getCoord(),entityHEIGHT,entityWIDTH)); // mise à jour moins crade pour l'instant
if (tableCommande.get("CommandAttack") == 1) attaque();
......
......@@ -21,6 +21,7 @@ import environnement.HitBox;
import loaders.ObstacleLoader;
import map.Obstacle;
import loaders.CharacterLoader;
import map.Coffre;
import map.LevelManager;
......@@ -65,7 +66,7 @@ public class Jeu implements Game{
public static List<Obstacle> obstacleTable = new ArrayList<>();
private static List<Monster> monsterList = new ArrayList<>();
private static List<Kunai> kunaiList = new ArrayList<>();
//private static List<Coffre> coffreTable = new ArrayList<>();
private static List<Coffre> coffreTable = new ArrayList<>();
public final static int TILES_DEFAULT_SIZE=32;
public final static float SCALE=1.75f;
......@@ -123,7 +124,7 @@ public class Jeu implements Game{
obstacleTable.add(new Obstacle(new HitBox(new Coordonnees(600, 662.5),75,50)));
obstacleTable.add(new Obstacle(new HitBox(new Coordonnees(450, 400),32,128)));*/
//coffreTable.add(new Coffre(new HitBox(new Coordonnees(900, 685),30,30))); //table des coffres
coffreTable.add(new Coffre(new HitBox(new Coordonnees(900, 685),30,30))); //table des coffres
//on met des monstres, faut supp la pour table monstres
monsterList.add(new Monster(new Coordonnees(1000, sol.getHitbox().getExtremites().get("HautGauche").getZ()-500), 1000, 30, 60, 1,5));
......@@ -245,9 +246,9 @@ public class Jeu implements Game{
public static List<Obstacle> getObstacleTable() {
return obstacleTable;
}
/*public static List<Coffre> getCoffreTable() {
public static List<Coffre> getCoffreTable() {
return coffreTable;
}*/
}
public static Character getGameCharacter() {
return gameCharacter;
......
......@@ -40,7 +40,7 @@ public class LevelManager {
int index = levelOne.getSpriteIndex(i, j);
//g.drawImage(levelSprite[index], Jeu.TILES_SIZE * i, Jeu.TILES_SIZE * j, Jeu.TILES_SIZE, Jeu.TILES_SIZE, null);
if (index<=14) {
liste.add(new Obstacle(new HitBox(new Coordonnees(Jeu.TILES_SIZE * i, Jeu.TILES_SIZE * j-300), Jeu.TILES_SIZE, Jeu.TILES_SIZE)));
liste.add(new Obstacle(new HitBox(new Coordonnees(Jeu.TILES_SIZE * i, Jeu.TILES_SIZE * j-600), Jeu.TILES_SIZE, Jeu.TILES_SIZE)));
System.out.println(liste.size());
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment