1
0
mirror of https://github.com/Klagarge/PokeHES.git synced 2025-07-07 17:01:10 +00:00

fix bug !!! (hallelujah)

This commit is contained in:
2022-06-13 19:26:52 +02:00
parent 6d71baa535
commit e71d23dd81
3 changed files with 14 additions and 10 deletions

View File

@ -14,10 +14,10 @@ public class Player extends Character{
private int xp;
public Enemy lastEnemy = null;
public boolean frontOfEnemy = false;
public boolean onEnemy = false;
public Player(int x, int y, String map) {
super("Player", x, y, "Character", map);
super("Player", x, y, "character", map);
}
public void addXp(int xp){
@ -32,7 +32,7 @@ public class Player extends Character{
// Compute direction and next cell
Vector<TiledMapTile> nextCell = new Vector<>();
Player.Direction goalDirection = Player.Direction.NULL;
Vector2 nextPos = position;
Vector2 nextPos = new Vector2(position);
if (c.keyStatus.get(Input.Keys.RIGHT)) {
goalDirection = Player.Direction.RIGHT;
@ -98,7 +98,7 @@ public class Player extends Character{
if(bMap && pX==eX && pY==eY) {
lastEnemy = enemy;
frontOfEnemy = true;
onEnemy = true;
return true;
}
}