From bae3543a0b569a093169dcb0bd8df786ee1c45fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Fri, 17 Jun 2022 09:21:07 +0200 Subject: [PATCH] comments done --- src/Main/PokeMudry.java | 2 +- src/Screen/ManagerOfScreen.java | 12 ++++++++++++ src/Screen/ScreenMap.java | 7 ++++++- src/Screen/ScreenPlayer.java | 4 +--- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/Main/PokeMudry.java b/src/Main/PokeMudry.java index 5d1a03b..b638e19 100644 --- a/src/Main/PokeMudry.java +++ b/src/Main/PokeMudry.java @@ -69,7 +69,7 @@ public class PokeMudry extends PortableApplication { boolean onEndScreen = sp.screenManager.getActiveScreen().getClass().equals(ScreenEnd.class); long timeNow = System.currentTimeMillis(); - if((timeNow-lastMesure) >= 1000 && !onEndScreen){ // one second + if((timeNow-lastMesure) >= 1000 && !onEndScreen){ // one second during the game lastMesure = timeNow; sp.p.removedPv(1); for (Enemy enemy : enemies) { enemy.recoveredTime++; } diff --git a/src/Screen/ManagerOfScreen.java b/src/Screen/ManagerOfScreen.java index a63e4b0..dc4b3b5 100644 --- a/src/Screen/ManagerOfScreen.java +++ b/src/Screen/ManagerOfScreen.java @@ -6,16 +6,28 @@ public class ManagerOfScreen extends ScreenManager{ ManagerOfScreen(){ } + /** + * Get the current screen map + * @return the current screen map + */ public ScreenMap getScreenMap(){ this.activateScreen(0); return (ScreenMap)this.getActiveScreen(); } + /** + * Get the current screen battle + * @return the current screen battle + */ public ScreenBattle getScreenBattle(){ this.activateScreen(1); return (ScreenBattle)this.getActiveScreen(); } + /** + * Get the current end screen + * @return the current end screen + */ public ScreenEnd getScreenEnd(){ this.activateScreen(2); return (ScreenEnd) this.getActiveScreen(); diff --git a/src/Screen/ScreenMap.java b/src/Screen/ScreenMap.java index 69719fb..2d9e037 100644 --- a/src/Screen/ScreenMap.java +++ b/src/Screen/ScreenMap.java @@ -47,7 +47,7 @@ public class ScreenMap extends RenderingScreen{ try { map = player.getMap(); } catch (Exception e) {} - // create map + // create all map createMap("test"); createMap("test_couloir"); createMap("desert"); @@ -150,6 +150,11 @@ public class ScreenMap extends RenderingScreen{ return speed; } + /** + * Check if the position is a door and if yes, get and save all settings for change map + * @param position The position to be tested + * @return true if it's a door + */ public boolean isDoor(Vector2 position) { if (doors == null) return false; boolean onDoor = false; diff --git a/src/Screen/ScreenPlayer.java b/src/Screen/ScreenPlayer.java index 0569276..b5c6a05 100644 --- a/src/Screen/ScreenPlayer.java +++ b/src/Screen/ScreenPlayer.java @@ -17,10 +17,9 @@ public class ScreenPlayer { public void init(){ // One player by ScreenPlayer - //p = new Player(8, 15, "desert"); p = new Player(4, 2, "21RI"); - e = new Enemy("enemy", 0, 0, "desert", 50, "enemy"); + e = new Enemy("enemy", 0, 0, "21RI", 50, "enemy"); b = new Battle(e); // Create both type of screen and record for reuse @@ -31,7 +30,6 @@ public class ScreenPlayer { se = screenManager.getScreenEnd(); sm = screenManager.getScreenMap(); - } public void render(GdxGraphics g){