From baff97fa03b5925c4df721c06d329dbe31365580 Mon Sep 17 00:00:00 2001 From: Fastium <79766552+Fastium@users.noreply.github.com> Date: Thu, 16 Jun 2022 19:30:07 +0200 Subject: [PATCH] display the pv of enemy ok --- src/Game/Battle.java | 1 + src/Main/PokeMudry.java | 2 +- src/Screen/ScreenBattle.java | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Game/Battle.java b/src/Game/Battle.java index 7bc172f..246f3b2 100644 --- a/src/Game/Battle.java +++ b/src/Game/Battle.java @@ -96,6 +96,7 @@ public class Battle { xpPlayer += xp; //remove pv enemy pvEnemy -= xp; + if(pvEnemy<0) pvEnemy =0; } diff --git a/src/Main/PokeMudry.java b/src/Main/PokeMudry.java index 63813a4..a6a8b15 100644 --- a/src/Main/PokeMudry.java +++ b/src/Main/PokeMudry.java @@ -48,7 +48,7 @@ public class PokeMudry extends PortableApplication { // add player, create and add all enemies in entities entities.add((Entity) sp.p); enemies.add(new Enemy("Gloeckner", 1, 7, "lumberjack_sheet32", "21N307", 600, "allemand", Direction.RIGHT)); - enemies.add(new Enemy("Nicollier", 4, 2, "lumberjack_sheet32", "21N308", 1600, "mathematique", Direction.LEFT)); + enemies.add(new Enemy("Nicollier", 4, 2, "lumberjack_sheet32", "21N308", 20, "mathematique", Direction.LEFT)); enemies.add(new Enemy("Mudry", 5, 11, "lumberjack_sheet32", "21N304", 700, "informatique", Direction.DOWN)); enemies.add(new Enemy("Ellert", 1, 4, "lumberjack_sheet32", "23N215", 300, "physique", Direction.RIGHT)); enemies.add(new Enemy("Bianchi", 1, 3, "lumberjack_sheet32", "23N308", 1200, "electricite", Direction.RIGHT)); diff --git a/src/Screen/ScreenBattle.java b/src/Screen/ScreenBattle.java index 3fb10d9..c03d240 100644 --- a/src/Screen/ScreenBattle.java +++ b/src/Screen/ScreenBattle.java @@ -84,7 +84,7 @@ public class ScreenBattle extends RenderingScreen{ //dialog if(b == null) return; if(b.getLine() == null) return; - g.drawString(15, 260 ,b.getLine() , unbuntuRegularBlack); + g.drawString(15, 260, b.getLine(), unbuntuRegularBlack); } @@ -93,7 +93,7 @@ public class ScreenBattle extends RenderingScreen{ //draw image g.drawPicture(Settings.SIDE - (192/2), Settings.SIDE-240/2, enemyImg); //draw pv - g.drawString(350, Settings.SIDE - 15 , "PV : " + b.pvEnemy + " / " + b.e.getPvInit(), unbuntuRegularWhite); + g.drawString(300, Settings.SIDE - 15 , "PV : " + b.pvEnemy + " / " + b.e.getPvInit(), unbuntuRegularWhite); }