1
0
mirror of https://github.com/Klagarge/PokeHES.git synced 2025-10-31 03:39:16 +00:00

enemy integration done, but big bug when move

This commit is contained in:
2022-06-10 16:39:50 +02:00
parent 1466ba041a
commit 56d57ca17c
10 changed files with 48 additions and 47 deletions

View File

@@ -8,6 +8,7 @@ import ch.hevs.gdx2d.lib.interfaces.DrawableObject;
public abstract class Entity implements DrawableObject {
protected String name;
protected String map;
Spritesheet ss;
@@ -20,19 +21,17 @@ public abstract class Entity implements DrawableObject {
protected boolean move = false;
public Entity(String name){
this(name, new Vector2(0,0));
public Entity(String name, int x, int y, String map){
this(name, new Vector2(SPRITE_WIDTH * x, SPRITE_HEIGHT * y), map);
}
public Entity(String name, int x, int y){
this(name, new Vector2(SPRITE_WIDTH * x, SPRITE_HEIGHT * y));
}
public Entity(String name, Vector2 initialPosition){
public Entity(String name, Vector2 initialPosition, String map){
this.name = name;
lastPosition = new Vector2(initialPosition);
newPosition = new Vector2(initialPosition);
position = new Vector2(initialPosition);
this.map = map;
}
public void init(){
@@ -58,4 +57,8 @@ public abstract class Entity implements DrawableObject {
public String getName() {
return name;
}
public String getMap() {
return map;
}
}