51 lines
1021 B
Java
51 lines
1021 B
Java
package Entities;
|
|
|
|
import Frames.Frame;
|
|
|
|
/**
|
|
* Entity class, which is the main class regrouping characters and projectiles
|
|
* @author Victor
|
|
*
|
|
*/
|
|
public class Entity {
|
|
private int posx;
|
|
private int posy;
|
|
private Frame currentFrame;
|
|
|
|
/**
|
|
* base constructor of the entity class
|
|
*/
|
|
public Entity() {
|
|
this.posx = 0;
|
|
this.posy = 0;
|
|
this.currentFrame = new Frame();
|
|
}
|
|
|
|
/**
|
|
* constructor of the entity class with parameters
|
|
* @param posx the position of the entity on the x axis
|
|
* @param posy the position of the entity on the y axis
|
|
* @param f the current frame of the new entity
|
|
*/
|
|
public Entity(int posx, int posy, Frame f) {
|
|
this.posx = posx;
|
|
this.posy = posy;
|
|
this.currentFrame = f;
|
|
}
|
|
|
|
public void setPos(int x, int y) {
|
|
this.posx = x;
|
|
this.posy = y;
|
|
}
|
|
|
|
public void setCurrentFrame(Frame f) {
|
|
this.currentFrame = f;
|
|
}
|
|
|
|
public int getPosX() {return this.posx;}
|
|
|
|
public int getPosY() {return this.posy;}
|
|
|
|
public Frame getCurrentframe() {return this.currentFrame;}
|
|
}
|