1
0
mirror of https://github.com/Klagarge/PokeHES.git synced 2024-11-23 01:43:28 +00:00
This commit is contained in:
Fastium 2022-06-15 08:20:28 +02:00
parent 26a8b0280b
commit 997f303567
3 changed files with 50 additions and 4 deletions

View File

@ -75,16 +75,17 @@ public class PokeMudry extends PortableApplication {
//manage battle
if(!sp.b.getScreenBattleOn()){
sp.p.addXp(sp.b.getNewXp());
sp.e.removedPv(sp.b.getNewXp());
sp.b.setPvEnemy(sp.e.getPv());
sp.b.setXpPlayer(sp.p.getXp());
}
if(!sp.b.getScreenBattleOn() && onBattleScreen){
sp.p.onEnemy = false;
sp.sm = sp.screenManager.getScreenMap();
sp.p.addXp(sp.b.getNewXp());
sp.e.removedPv(sp.b.getNewXp());
}
// Graphics render

View File

@ -0,0 +1,45 @@
package Screen;
import Entity.Enemy;
import Entity.Player;
import Game.Battle;
import ch.hevs.gdx2d.lib.GdxGraphics;
public class ScreenPlayer {
public ManagerOfScreen screenManager = new ManagerOfScreen();
public Player p = null;
public Enemy e = null;
public Battle b = null;
public ScreenMap sm = null;
public ScreenBattle sb = null;
public void init(){
// One player by ScreenPlayer
p = new Player(8, 15, "desert");
//p = new Player(4, 2, "21RI");
b = new Battle(new Enemy("enemi", 0, 0, "charachter", "desert", 50, "enemi"));
// Create both type of screen and record for reuse
screenManager.registerScreen(ScreenMap.class);
screenManager.registerScreen(ScreenBattle.class);
sb = screenManager.getScreenBattle();
sm = screenManager.getScreenMap();
}
public void render(GdxGraphics g){
if(sm != null){
sm.setPlayer(p);
}
if(sb != null){
sb.setBattle(b);
b.setEnemy(e);
}
screenManager.render(g);
}
}

View File

@ -17,7 +17,7 @@ public class ScreenPlayer {
// One player by ScreenPlayer
p = new Player(8, 15, "desert");
//p = new Player(4, 2, "21RI");
// = new Player(4, 2, "21RI");
b = new Battle(new Enemy("enemi", 0, 0, "charachter", "desert", 50, "enemi"));