1
0
mirror of https://github.com/Klagarge/PokeHES.git synced 2024-11-26 19:13:27 +00:00

add pv for player

This commit is contained in:
Rémi Heredero 2022-06-16 16:59:02 +02:00
parent 3747d19255
commit b808af6adc
2 changed files with 5 additions and 4 deletions

View File

@ -20,6 +20,7 @@ public class Player extends Character{
public Player(int x, int y, String map) {
super("Player", x, y, "Character_flipped", map);
this.pv = Settings.TIME*60;
}
public void addXp(int xp){
@ -119,9 +120,8 @@ public class Player extends Character{
}
@Override
protected void removedPv(int pv) {
// TODO Auto-generated method stub
public void removedPv(int pv) {
this.pv -= pv;
}
public int getXpMax(){

View File

@ -68,8 +68,9 @@ public class PokeMudry extends PortableApplication {
boolean onBattleScreen = sp.screenManager.getActiveScreen().getClass().equals(ScreenBattle.class);
long timeNow = System.currentTimeMillis();
if((timeNow-lastMesure) >= 1000){
if((timeNow-lastMesure) >= 1000){ // one second
lastMesure = timeNow;
sp.p.removedPv(1);
for (Enemy enemy : enemies) { enemy.recoveredTime++; }
}
if((timeNow-beginTime)/1000 >= 60 * Settings.TIME) System.out.println("Game finished");