mirror of
				https://github.com/Klagarge/PokeHES.git
				synced 2025-10-31 03:39:16 +00:00 
			
		
		
		
	done
This commit is contained in:
		| @@ -2,16 +2,58 @@ package Entity; | ||||
|  | ||||
| import com.badlogic.gdx.math.Vector2; | ||||
|  | ||||
| public abstract class Entity { | ||||
|     private Vector2 position; | ||||
|     private String name; | ||||
| import ch.hevs.gdx2d.components.bitmaps.Spritesheet; | ||||
| import ch.hevs.gdx2d.lib.GdxGraphics; | ||||
| import ch.hevs.gdx2d.lib.interfaces.DrawableObject; | ||||
|  | ||||
| public abstract class Entity implements DrawableObject { | ||||
|     protected String name; | ||||
|  | ||||
|     Spritesheet ss; | ||||
|      | ||||
|     protected final static int SPRITE_WIDTH = 32; | ||||
|     protected final static int SPRITE_HEIGHT = 32; | ||||
|  | ||||
|     Vector2 lastPosition; | ||||
|     Vector2 newPosition; | ||||
|     Vector2 position; | ||||
|  | ||||
|     protected boolean move = false; | ||||
|  | ||||
|     public Entity(String name){ | ||||
|         this.name = name; | ||||
|         this(name, new Vector2(0,0)); | ||||
|     } | ||||
|  | ||||
|     public Vector2 getPosition() { | ||||
|         return position; | ||||
|     public Entity(String name, int x, int y){ | ||||
|         this(name, new Vector2(SPRITE_WIDTH * x, SPRITE_HEIGHT * y)); | ||||
|     } | ||||
|  | ||||
|     public Entity(String name, Vector2 initialPosition){ | ||||
|         this.name = name; | ||||
|         lastPosition = new Vector2(initialPosition); | ||||
|         newPosition = new Vector2(initialPosition); | ||||
|         position = new Vector2(initialPosition); | ||||
|     } | ||||
|  | ||||
|     public void init(){ | ||||
|  | ||||
|     } | ||||
|  | ||||
|     public void graphicRender(GdxGraphics g){ | ||||
|          | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @return the current position of the entity on the map. | ||||
|      */ | ||||
|     public Vector2 getPosition(){ | ||||
|         return this.position; | ||||
|     } | ||||
|  | ||||
|     public void setPosition(int x, int y){ | ||||
|         lastPosition.set(x, y); | ||||
|         newPosition.set(x, y); | ||||
|         position.set(x, y); | ||||
|     } | ||||
|  | ||||
|     public String getName() { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user