1
0
mirror of https://github.com/Klagarge/PokeHES.git synced 2025-07-07 17:01:10 +00:00

finish to add enemy

This commit is contained in:
2022-06-15 16:49:33 +02:00
parent 62ebdf6248
commit 907ae78eec
6 changed files with 22 additions and 11 deletions

View File

@ -7,6 +7,7 @@ import com.badlogic.gdx.Input;
import Control.Controller;
import Entity.Enemy;
import Entity.Entity;
import Entity.Character.Direction;
import Game.Battle;
import Screen.ScreenBattle;
import Screen.ScreenMap;
@ -45,8 +46,12 @@ public class PokeMudry extends PortableApplication {
// add player, create and add all enemies in entities
entities.add((Entity) sp.p);
enemies.add(new Enemy("Mudry", 10, 15, "lumberjack_sheet32", "desert", 25, "informatique"));
enemies.add(new Enemy("Mudry", 5, 11, "lumberjack_sheet32", "21N304", 25, "informatique"));
enemies.add(new Enemy("Mudry", 5, 11, "lumberjack_sheet32", "21N304", 25, "informatique", Direction.DOWN));
enemies.add(new Enemy("Paciotti", 5, 11, "lumberjack_sheet32", "21N205", 0, "mecanique", Direction.DOWN));
enemies.add(new Enemy("Gloeckner", 1, 7, "lumberjack_sheet32", "21N307", 0, "allemand", Direction.RIGHT));
enemies.add(new Enemy("Bianchi", 1, 3, "lumberjack_sheet32", "23N308", 0, "electricite", Direction.RIGHT));
enemies.add(new Enemy("Nicollier", 4, 2, "lumberjack_sheet32", "21N308", 0, "mathematique", Direction.LEFT));
enemies.add(new Enemy("Ellert", 1, 4, "lumberjack_sheet32", "23N215", 0, "physique", Direction.RIGHT));
for (Enemy enemy : enemies) { entities.add(enemy); }
@ -65,11 +70,15 @@ public class PokeMudry extends PortableApplication {
// Switch screen
if (sp.p.onEnemy && onMapScreen){
sp.e = sp.p.lastEnemy;
sp.sb = sp.screenManager.getScreenBattle();
if(sp.e == null) System.out.println("sdfsdfsdfsdf");
sp.b = new Battle(sp.e);
g.resetCamera();
int pv = sp.e.getPv();
if (pv>0) {
sp.sb = sp.screenManager.getScreenBattle();
sp.b = new Battle(sp.e);
g.resetCamera();
} else {
sp.p.onEnemy = false;
}
}
if(onBattleScreen) sp.sb.manage(controller, sp.b);