1
0
mirror of https://github.com/Klagarge/PokeHES.git synced 2024-11-23 01:43:28 +00:00

comments done

This commit is contained in:
Rémi Heredero 2022-06-17 09:21:07 +02:00
parent 769adeeeca
commit bae3543a0b
4 changed files with 20 additions and 5 deletions

View File

@ -69,7 +69,7 @@ public class PokeMudry extends PortableApplication {
boolean onEndScreen = sp.screenManager.getActiveScreen().getClass().equals(ScreenEnd.class); boolean onEndScreen = sp.screenManager.getActiveScreen().getClass().equals(ScreenEnd.class);
long timeNow = System.currentTimeMillis(); long timeNow = System.currentTimeMillis();
if((timeNow-lastMesure) >= 1000 && !onEndScreen){ // one second if((timeNow-lastMesure) >= 1000 && !onEndScreen){ // one second during the game
lastMesure = timeNow; lastMesure = timeNow;
sp.p.removedPv(1); sp.p.removedPv(1);
for (Enemy enemy : enemies) { enemy.recoveredTime++; } for (Enemy enemy : enemies) { enemy.recoveredTime++; }

View File

@ -6,16 +6,28 @@ public class ManagerOfScreen extends ScreenManager{
ManagerOfScreen(){ ManagerOfScreen(){
} }
/**
* Get the current screen map
* @return the current screen map
*/
public ScreenMap getScreenMap(){ public ScreenMap getScreenMap(){
this.activateScreen(0); this.activateScreen(0);
return (ScreenMap)this.getActiveScreen(); return (ScreenMap)this.getActiveScreen();
} }
/**
* Get the current screen battle
* @return the current screen battle
*/
public ScreenBattle getScreenBattle(){ public ScreenBattle getScreenBattle(){
this.activateScreen(1); this.activateScreen(1);
return (ScreenBattle)this.getActiveScreen(); return (ScreenBattle)this.getActiveScreen();
} }
/**
* Get the current end screen
* @return the current end screen
*/
public ScreenEnd getScreenEnd(){ public ScreenEnd getScreenEnd(){
this.activateScreen(2); this.activateScreen(2);
return (ScreenEnd) this.getActiveScreen(); return (ScreenEnd) this.getActiveScreen();

View File

@ -47,7 +47,7 @@ public class ScreenMap extends RenderingScreen{
try { map = player.getMap(); } catch (Exception e) {} try { map = player.getMap(); } catch (Exception e) {}
// create map // create all map
createMap("test"); createMap("test");
createMap("test_couloir"); createMap("test_couloir");
createMap("desert"); createMap("desert");
@ -150,6 +150,11 @@ public class ScreenMap extends RenderingScreen{
return speed; 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) { public boolean isDoor(Vector2 position) {
if (doors == null) return false; if (doors == null) return false;
boolean onDoor = false; boolean onDoor = false;

View File

@ -17,10 +17,9 @@ public class ScreenPlayer {
public void init(){ public void init(){
// One player by ScreenPlayer // One player by ScreenPlayer
//p = new Player(8, 15, "desert");
p = new Player(4, 2, "21RI"); 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); b = new Battle(e);
// Create both type of screen and record for reuse // Create both type of screen and record for reuse
@ -31,7 +30,6 @@ public class ScreenPlayer {
se = screenManager.getScreenEnd(); se = screenManager.getScreenEnd();
sm = screenManager.getScreenMap(); sm = screenManager.getScreenMap();
} }
public void render(GdxGraphics g){ public void render(GdxGraphics g){