1
0
mirror of https://github.com/Klagarge/PokeHES.git synced 2025-07-07 17:01:10 +00:00
This commit is contained in:
2022-06-09 17:32:47 +02:00
parent 5573b545e0
commit 3d05c1e5fa
7 changed files with 115 additions and 133 deletions

View File

@ -7,11 +7,13 @@ import com.badlogic.gdx.math.Vector2;
import ch.hevs.gdx2d.lib.GdxGraphics;
public class Enemy extends Character{
private String map;
public FightData fightData;
public Enemy(String name, int x, int y, String img) {
public Enemy(String name, int x, int y, String img, String map) {
super(name, x, y, img);
this.map = map;
turn(Character.Direction.DOWN);
//generate the vector of fight
@ -20,12 +22,17 @@ public class Enemy extends Character{
}
public void setPosition(int x, int y){
public String getMap() {
return map;
}
public void setPosition(Vector2 vPosition){
setPosition((int)vPosition.x, (int)vPosition.y);
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

View File

@ -46,13 +46,8 @@ public class Player extends Character{
// Is the move valid ?
if (sm.isWalkable(nextCell)) {
if(!enemy()){
// Go
setSpeed(sm.getSpeed(nextCell));
go(goalDirection);
} else {
}
setSpeed(sm.getSpeed(nextCell));
go(goalDirection);
} else {
// Face the wall
turn(goalDirection);
@ -78,12 +73,10 @@ public class Player extends Character{
}
private boolean enemy() {
/*
Vector<Entity> entities = testHER.getEntities;
for (Entity entity : entities) {
//Vector<Enemy> enemies = PokeMudry.getEnemies;
//for (Enemy enemy : enemies) {
}
*/
//}
return false;
}