Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package jumpingalien.model;
- import jumpingalien.util.Sprite;
- public class Entity {
- private double World_Width= 10.24;
- private double World_Height= 7.68;
- public double[] ActualPositon;
- public double[] getActualPosition() {
- return ActualPositon;
- }
- public void changeActualPosition(double[] newPosition) throws Exception {
- if(newPosition[1] <0 || newPosition[0] <0) {throw new Exception("A or both positions are negative");}
- if(newPosition[0]>World_Width || newPosition[1]> World_Height) {throw new Exception("A or both positions is bigger than world dimentions");}
- else if(Double.isNaN(newPosition[0]) ||Double.isNaN(newPosition[0])) {throw new Exception("Invalid input type");}
- else if(newPosition.length != 2) {throw new Exception("Invalid size of Position");}
- else{this.ActualPositon = newPosition;}
- }
- public int[] PixelPosition;
- public int[] getPixelPosition() {
- int[] newPixelPosition= {(int) (getActualPosition()[0]*100),(int) (getActualPosition()[1]*100)};
- return newPixelPosition ;
- }
- public void setActualPositon(double x, double y) throws Exception {
- if(x <0 || y <0) {throw new Exception("A or both positions are negative");}
- else if(Double.isNaN(x) ||Double.isNaN(y)) {throw new Exception("Invalid input type");}
- else{double[] actualPositon= {x,y};
- ActualPositon = actualPositon;}
- }
- public void setPixelPosition(int x, int y) throws Exception {
- if(x <0 || y <0) {throw new Exception("A or both positions are negative");}
- else{
- int[] newPositon= {x,y};
- PixelPosition = newPositon;}
- }
- private int Orientation=0;
- public int getOrientation() {
- return Orientation;
- }
- public void setOrientation(int currentOrientation) {
- }
- public double[] Velocity = {0,0};
- public double[] getVelocity() {
- return this.Velocity;
- }
- public void setVelocity(double x, double y) {
- double[] velocity= {x,y};
- Velocity = velocity;
- }
- public void startMoveLeft() throws Exception {
- }
- public void startMoveRight() throws Exception {
- }
- public void advanceTime(double time) throws Exception {
- }
- public void setCurrentSprite(Sprite currentSprite) {
- }
- public Sprite getCurrentSprite() {
- return null;
- }
- public World CurrentWorld;
- public World getWorld() {
- return null;
- }
- public void setWorld(World world) {
- CurrentWorld=world;
- }
- public void setHitPoint(int hitpoint) {
- }
- public double[] Acceleration = {0,0};
- public double[] getAcceleration() {
- return null;
- }
- public boolean IsDead;
- public boolean isDeadGameObject() {
- return IsDead;
- }
- public boolean IsTerminated;
- public boolean isTerminatedGameObject() {
- return IsTerminated;
- }
- public void terminateGameObject() {
- }
- public int getHitpoint() {
- // TODO Auto-generated method stub
- return 0;
- }
- public Sprite[] getSprites() {
- // TODO Auto-generated method stub
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment