1
0
mirror of https://github.com/Klagarge/PokeHES.git synced 2025-04-12 10:56:04 +00:00
PokeHES/src/Entity/Enemy.java
Fastium 8c8c59411d a
2022-06-15 19:52:31 +02:00

48 lines
956 B
Java

package Entity;
import com.badlogic.gdx.math.Vector2;
public class Enemy extends Character{
private String branch;
public Enemy(String name, int x, int y, String img, String map, int pv, String branch) {
super(name, x, y, img, map);
//generate his text
this.map = map;
turn(Character.Direction.DOWN);
this.branch = branch;
this.pv = pv;
}
public void setPosition(int x, int y, String map){
position.set(x, y);
this.map = map;
}
public void setPosition(Vector2 vPosition, String map){
setPosition((int)vPosition.x, (int)vPosition.y, map);
}
@Override
public void removedPv(int pv) {
this.pv -= pv;
}
public String getBranch(){
return branch;
}
@Override
public int getPv(){
//the pv can go under 0, but his real pv is 0 (for the player)
return (pv<0) ? 0 : pv;
}
}