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

indexBoss LM

parent d9bca948
No related branches found
No related tags found
No related merge requests found
......@@ -110,7 +110,7 @@ public class Monster extends Entity{
public void attaque(){//isAttacking > 0 pour dire que si il est entrain d'attaquer, il finit son attaque
if ((Math.abs(this.coord.getX()-getGameCharacter().coord.getX()) <= 2+entityWIDTH/2+getGameCharacter().entityWIDTH/2 && Math.abs(this.coord.getZ()-getGameCharacter().coord.getZ()) <= entityHEIGHT && characInFrontOf()) || isAttacking > 0){ //n'attaque que si perso pas invincible
//si il n'est pas immobile il s'arrete
if (isAttacking < 50){
if (isAttacking >= 50){
isAttacking++;
}
//sinon on cree l'attaque
......@@ -178,7 +178,9 @@ public class Monster extends Entity{
//on supprime tous les monstres morts
int i = 0;
while (i < liste.size()){
if (liste.get(i).death())liste.remove(i);
if (liste.get(i).death() && !(liste.get(i) instanceof Boss)){
liste.remove(i);
}
else i++;
}
......
......@@ -9,6 +9,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import entity.Boss;
import entity.Character;
import entity.Hearth;
import entity.Kunai;
......@@ -197,6 +198,10 @@ public class Jeu implements Game{
//monstres evoluent dans le jeu
Monster.evolveAllMonsters(monsterList);
//on recupere l index du boss
for (Monster monster : monsterList){
if (monster instanceof Boss) {levelManager.setIndexBoss(monsterList.indexOf(monster));break;}
}
//perso evolue dans le jeu (en actualisant ses coordonnees)
gameCharacter.evolveCharacter();
......
......@@ -239,4 +239,10 @@ public class LevelManager {
public int getIndexPorte() {
return indexPorte;
}
public void setIndexBoss(int indexBoss) {
this.indexBoss = indexBoss;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment