Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package jumpingalien.model;
- import jumpingalien.util.Sprite;
- import be.kuleuven.cs.som.annotate.*;
- import javafx.geometry.HorizontalDirection;
- /**
- * A class for making the Mazub alien move jump, duck and also get the imageSprites and coordinates.
- *
- * @version 3.0
- * @author Thierry Klougbo & Jordi De Pau
- *
- * @invar Each Mazub can have its time as time.
- * | canHaveAstime(this.gettime())
- */
- public class Mazub extends Entity{
- /**
- * Initialise the object Mazub (player) with given coordinations of Pixel X and Pixel and given sprites = Images of the player
- *
- * @param BottomPixelX
- * The Bottom Pixel X for this player Mazub
- * @param BottomPixelY
- * The Bottom Pixel Y for this player Mazub
- * @param sprites
- * Sprites an array of at least 10 Images and are even for every animation for player mazub.
- * @throws IllegalArgumentException
- * The given BottomPixelX and BottomPixelY are no valid Bottom pixels for any Mazub.
- * ||if(BottomPixelX<0 || BottomPixelX>1024 || BottomPixelY <0 || BottomPixelY>768) {throw new IllegalArgumentException();}
- */
- public Mazub(int BottomPixelX,int BottomPixelY, Sprite... sprites) throws IllegalArgumentException{
- super(BottomPixelX, BottomPixelY, sprites);
- if(BottomPixelX<0 || BottomPixelX>1024 || BottomPixelY <0 || BottomPixelY>768) {throw new IllegalArgumentException();}
- else {
- setSPRITES(sprites);
- setActualPosition((double)BottomPixelX/100,(double)BottomPixelY/100);
- setPixelPosition(BottomPixelX, BottomPixelY);}
- setHitPoint(100);
- }
- //Game World
- //PreDefined WorldBorder
- public final double WORLD_WIGTH = 1024.00;
- public final double WORLD_HEIGHT = 768.00;
- public double[] dimentions=new double[2];
- /**
- * returns an array containing the wigth and the height of the game window.
- * @return
- * |result == dimentions
- */
- public double[] getDimentions() {dimentions[0]=WORLD_WIGTH; dimentions[1]=WORLD_HEIGHT; return dimentions;}
- public double[] actualPosition=new double[2];
- //Position => Defensively
- public void setActualPosition(double X,double Y)throws IllegalArgumentException{
- if( Y<=-1 || Y>WORLD_HEIGHT || X<=-1 || X>WORLD_WIGTH) {throw new IllegalArgumentException();}
- actualPosition[0] = X; actualPosition[1]=Y;
- setPixelPosition((int)(actualPosition[0]*100), (int)(actualPosition[1]*100));
- }
- /**
- * @return The actual position of Mazub.
- * |result == actualPosition
- */
- public double[] getActualPosition() {return actualPosition;}
- public int[] pixelPosition=new int[2];
- public void setPixelPosition(int newX,int newY) {pixelPosition[0] = newX; pixelPosition[1] = newY;}
- /**
- * @return
- * | result==pixelPosition
- */
- public int[] getPixelPosition() {return pixelPosition;}
- //Orientation => Nominal
- public int PREVIOUS_ORIENTATION;
- /**
- * @param cURRENT_ORIENTATION
- * @return true if cURRENT_ORIENTATION is equal to 1 or -1
- * |result==(cURRENT_ORIENTATION==-1) || result==(cURRENT_ORIENTATION==1)
- */
- public static boolean isValidOrientation(int cURRENT_ORIENTATION) {
- return (cURRENT_ORIENTATION==-1) || (cURRENT_ORIENTATION==1);
- }
- /**
- * @param cURRENT_ORIENTATION
- * The current orientation of Mazub.
- * @pre cURRENT_ORIENTATION must be 1 or -1
- * |(cURRENT_ORIENTATION==-1)||(cURRENT_ORIENTATION==1)
- * @post ..
- * |new.CURRENT_ORIENTATION = cURRENT_ORIENTATION
- */
- public void setOrientation(int cURRENT_ORIENTATION) {
- assert(cURRENT_ORIENTATION==-1)||(cURRENT_ORIENTATION==1);
- Orientation = cURRENT_ORIENTATION;}
- /**
- * @return
- * |result==CURRENT_ORIENTATION
- */
- public int getOrientation() {return Orientation;}
- /**
- * @pre second must be equal to 1
- * | if(second == 1)
- * @post the previous orientation is equal to the current orientation.
- * |new.PREVIOUS_ORIENTATION = CURRENT_ORIENTATION
- */
- public void setPREVIOUS_ORIENTATION() {if(second == 1)
- {PREVIOUS_ORIENTATION = Orientation;}}
- /**
- * @return the previous orientation
- * |result==PREVIOUS_ORIENTATION
- */
- public int getPREVIOUS_ORIENTATION() {return PREVIOUS_ORIENTATION;}
- //Horizontal => Totally
- public double[] Acceleration=new double[2];
- public void setAcceleration(double aX, double aY) {Acceleration[0] = aX; Acceleration[1] = aY;}
- public double[] getAcceleration() {return Acceleration;}
- public double MINIMAL_HORIZONTAL_SPEED =1.0;
- public double MAXIMUM_HORIZONTAL_SPEED = 3.0;
- /**
- * @return ...
- * |result==MAXIMUM_HORIZONTAL_SPEED
- */
- public double getMAXIMUM_HORIZONTAL_SPEED() {return MAXIMUM_HORIZONTAL_SPEED;}
- /**
- * @param mAXIMUM_HORIZONTAL_SPEED
- * @post ...
- * |MAXIMUM_HORIZONTAL_SPEED = mAXIMUM_HORIZONTAL_SPEED
- */
- public void setMAXIMUM_HORIZONTAL_SPEED(double mAXIMUM_HORIZONTAL_SPEED) {MAXIMUM_HORIZONTAL_SPEED = mAXIMUM_HORIZONTAL_SPEED;}
- /**
- *
- * @return ...
- * |result==MINIMAL_HORIZONTAL_SPEED
- */
- public double getMINIMAL_HORIZONTAL_SPEED() {return MINIMAL_HORIZONTAL_SPEED;}
- /**
- *
- * @param mINIMAL_HORIZONTAL_SPEED
- * @post ..
- * |MINIMAL_HORIZONTAL_SPEED = mINIMAL_HORIZONTAL_SPEED*getOrientation()
- */
- public void setMINIMAL_HORIZONTAL_SPEED(double mINIMAL_HORIZONTAL_SPEED) {MINIMAL_HORIZONTAL_SPEED = mINIMAL_HORIZONTAL_SPEED*getOrientation();}
- public void horizontalChanging(double time) {
- int px=getPixelPosition()[0]; int py=getPixelPosition()[1];
- if(world.getGeologicalFeatures(px+(getSpriteDimention()[0]-1), py)!=1) {
- if(isDucking() == true) {setMAXIMUM_HORIZONTAL_SPEED(1.0*getOrientation());}
- if(isDucking() == false){setVelocity(getVelocity()[0]+ getAcceleration()[0]*time, getVelocity()[1]);}
- if(getOrientation()==-1 && getVelocity()[0]< getMAXIMUM_HORIZONTAL_SPEED()) {setVelocity(getMAXIMUM_HORIZONTAL_SPEED(), getVelocity()[1]);}
- if(getOrientation()==1 && getVelocity()[0]>getMAXIMUM_HORIZONTAL_SPEED()) {setVelocity(getMAXIMUM_HORIZONTAL_SPEED(), getVelocity()[1]);}
- if(getOrientation()==-1 && getVelocity()[0]>getMINIMAL_HORIZONTAL_SPEED()) {setVelocity(getMINIMAL_HORIZONTAL_SPEED(), getVelocity()[1]);}
- if(getOrientation()==1 && getVelocity()[0]<getMINIMAL_HORIZONTAL_SPEED()) {setVelocity(getMINIMAL_HORIZONTAL_SPEED(), getVelocity()[1]);}
- }
- }
- //Vertical => Totally
- /**
- *
- * @return...
- * |result== Velocity
- */
- @Override
- public double[] getVelocity() {return Velocity;}
- @Override
- public void setVelocity(double VelocityX, double VelocityY) {Velocity[0] = VelocityX; Velocity[1]=VelocityY;}
- public void verticalChanging(double time) {
- int px=getPixelPosition()[0]; int py=getPixelPosition()[1];
- if(getActualPosition()[1] > 0 && world.getGeologicalFeatures(px+(getSpriteDimention()[0]-1), py)!=1) {setAcceleration(getAcceleration()[0], -10);}
- // else if(getActualPosition()[1] > 0 && world.getGeologicalFeatures(px, py)==1) {setAcceleration(getAcceleration()[0], 0);}
- if(getActualPosition()[1]<=0) {setAcceleration(getAcceleration()[0],0);}
- setVelocity(getVelocity()[0],getVelocity()[1]+getAcceleration()[1]*time);
- }
- //Running => Nominally
- public boolean Moving;
- /**
- * @post Orientation is equal to 1
- * |new.getOrientation()=1
- * @post Horizontal acceleration is equal to 0.9
- * |new.getHORIZONTAL_ACCELERATION=0.9
- * @post Horizontal velocity is equal to 1
- * |new.getHORIZOTAL_VELOCITY=1
- * @post Maximum horizontal speed is equal to 3.0*the current orientation
- * |new.getMAXIMUM_HORIZONTAL_SPEED=3.0*getOrientation()
- */
- @Override
- public void startMovingRight() {
- int px=getPixelPosition()[0]; int py=getPixelPosition()[1];
- // if(world.getGeologicalFeatures(px+(getSpriteDimention()[0]-1), py+(getSpriteDimention()[1]-2))!=1) {
- Moving = true;
- setOrientation(1);
- setAcceleration(0.9, getAcceleration()[1]);
- setVelocity(1, getVelocity()[1]);
- setMAXIMUM_HORIZONTAL_SPEED(3.0*getOrientation());
- // }
- }
- /**
- * @post Orientation is equal to -1
- * |new.getOrientation()=-1
- * @post Horizontal acceleration is equal to -0.9
- * |new.getHORIZONTAL_ACCELERATION=-0.9
- * @post Horizontal velocity is equal to -1
- * |new.getHORIZOTAL_VELOCITY=-1
- * @post Maximum horizontal speed is equal to 3.0*the current orientation
- * |new.getMAXIMUM_HORIZONTAL_SPEED=3.0*getOrientation()
- */
- @Override
- public void startMovingLeft() {
- int px=getPixelPosition()[0]; int py=getPixelPosition()[1];
- // if(world.getGeologicalFeatures(px, py+(getSpriteDimention()[1]-2))!=1) {
- Moving = true;
- setOrientation(-1);
- setAcceleration(-0.9, getAcceleration()[1]);
- setVelocity(-1, getVelocity()[1]);
- setMAXIMUM_HORIZONTAL_SPEED(3.0*getOrientation());
- // }
- }
- /**
- * @post The current orientation is equal to 0
- * | new.getOrientation() == 0
- * @post The current horizontal accelereation is equal to 0
- * | new.getAcceleration()[0]=0
- * @post The horizontal velocity is equal to 0
- * | new.getVelocity()[0]=0
- */
- public void endMove() {
- Moving = false;
- setOrientation(0);
- setAcceleration(0, getAcceleration()[1]);
- setVelocity(0, getVelocity()[1]);
- }
- /**
- *
- * @return the value of the variable Moving
- * | result == if(Moving) {return true;}
- * else {return false;}
- */
- public boolean isMoving() {
- //assert(moving==true) ?
- if(Moving) {return true;}
- else {return false;}
- }
- /**
- * Initialize this new Mazub with given time.
- *
- * @param time
- * The time for this new Mazub.
- * @pre This new Mazub can have the given time as its time.
- * | canHaveAstime(time)
- * @post The time of this new Mazub is equal to the given
- * time.
- * | new.gettime() == time
- */
- public void running(double time) {
- if(getActualPosition()[0] >= 0 && getActualPosition()[0] <= getDimentions()[0]) {
- double posx=getActualPosition()[0]+ (getVelocity()[0]*time)+(0.5*getAcceleration()[0]*time*time);
- setActualPosition(posx, getActualPosition()[1]);
- }
- if(getActualPosition()[0]>getDimentions()[0]) {setActualPosition(getDimentions()[0],getActualPosition()[1]);}
- if(getActualPosition()[0]< 0) {setActualPosition(0, getActualPosition()[1]);}
- }
- //Jumping & Falling => Defensively
- public boolean jumping;
- public double ACCELERATION_WHILE_JUMPING = 8.0;
- public double ACCELERATION_WHILE_FALLING = -10.0;
- /**
- * Set the vertical velocity of this object_name to the given vertical velocity.
- *
- * @pre The given vertical velocity must be a valid vertical velocity for any
- * Mazub.
- * | isValidVERTICAL_VELOCITY(setVetical_VELOCITY(ACCELERATION_WHILE_JUMPINT))
- *
- * @post The vertical velocity of this Mazub is equal to the given
- * vertical velocity.
- * | new.getVERTICAL_VELOCITY() == setVetical_VELOCITY(ACCELERATION_WHILE_JUMPINT)
- * @post The vertical acceleration of this Mazub is equal to -10.
- * | new.getAcceleration()[1] == setVetical_ACCELERATION(-10)
- *
- */
- public void startJump() {
- // if(world.getGeologicalFeatures(px, py)!=1) {
- jumping = true;
- setAcceleration(getAcceleration()[0], ACCELERATION_WHILE_JUMPING);
- setVelocity(getVelocity()[0], getVelocity()[1]+getAcceleration()[1]);
- // }
- }
- /**
- * @post The vertical velocity of this Mazub is equal to 0.
- * | new.getVERTICAL_VELOCITY() == setVetical_VELOCITY(0)
- */
- public void endJump() {
- jumping = false;
- setVelocity(getVelocity()[0],0);
- setAcceleration(getAcceleration()[0],0);
- }
- /**
- *
- * @return if Mazub is jumping or not
- * |result == if(jumping) {return true;}
- | else{return false;}
- */
- public boolean isJumping() {
- if(jumping) {return true;}
- else{return false;}
- }
- /**
- * Check whether the given time is a valid time for
- * any Mazub.
- *
- * @param time
- * The time to check.
- * @return
- * | result ==
- */
- public static boolean isValidtime(double time) {
- return true;
- }
- /**
- * Initialize this new Mazub with given time.
- *
- * @param time
- * The time for this new Mazub.
- * @throws ExceptionName_Java
- * The given time is not a valid time for any
- * Mazub.
- * | ! isValidtime(gettime())
- * @effect ...
- * |if(getActualPositionY() >= 0 && getActualPositionY() <= getWorldHeight()) {setActualPositionY(getActualPositionY()+ (getVERTICAl_VELOCITY()*time)+(0.5*getAcceleration()[1]*time*time)) ;}
- * |if(getActualPositionY()>getWorldHeight()) {setActualPositionY(getWorldHeight());}
- * |if(getActualPositionY()< 0) {setActualPositionY(0);}
- */
- public void jumping(double time) throws IllegalArgumentException{
- if (! isValidtime(time)) {throw new IllegalArgumentException();}
- if(getActualPosition()[1] >= 0 && getActualPosition()[1] <= getDimentions()[1]) {
- double posy=getActualPosition()[1]+ (getVelocity()[1]*time)+(0.5*getAcceleration()[1]*time*time);
- setActualPosition(getActualPosition()[0], posy);
- }
- if(getActualPosition()[1]>getDimentions()[1]) {setActualPosition(getActualPosition()[0],getDimentions()[1]);}
- if(getActualPosition()[1]< 0) {setActualPosition(getActualPosition()[0],0);}
- }
- // Ducking => Totally
- public boolean Ducking;
- /**
- * @effect...
- * |if(getOrientation() != 0) {setMAXIMUM_HORIZONTAL_SPEED(1.0*getOrientation());}
- * |else {setMAXIMUM_HORIZONTAL_SPEED(1.0);}
- *@post ...
- * |Ducking = true
- */
- public void startDucking() {
- if(getOrientation() != 0) {setMAXIMUM_HORIZONTAL_SPEED(1.0*getOrientation());}
- else {setMAXIMUM_HORIZONTAL_SPEED(1.0);}
- Ducking = true;
- }
- /**
- * @effect...
- * |if(getOrientation() != 0)setMAXIMUM_HORIZONTAL_SPEED(3.0*getOrientation());
- * |else {setMAXIMUM_HORIZONTAL_SPEED(3.0);} Ducking = false;
- */
- public void endDucking() {
- if(getOrientation() != 0)setMAXIMUM_HORIZONTAL_SPEED(3.0*getOrientation());
- else {setMAXIMUM_HORIZONTAL_SPEED(3.0);} Ducking = false;
- }
- /**
- *
- * @return...
- * |if(Ducking) {return true;}
- * |else {return false;}
- */
- public boolean isDucking() {
- if(Ducking) {return true;}
- else {return false;}
- }
- //AdvencedTime => totally
- //Time
- public double second = 0;
- public double milisecond= 0;
- public double HitTime=0;
- /**
- * Changes the position of Mazub
- * @param time
- * @effect...
- * |horizontalChanging(time);
- * |verticalChanging(time);
- * |running(time);
- * |jumping(time);
- * |if(second >= 1.0) {setPREVIOUS_ORIENTATION(); second =0;}
- * |else{second =+time;}
- * |if (milisecond >= 0.075) {setImagCount(getImagCount()+ 1); milisecond = 0;}
- * |else {milisecond += time;}
- * |if(isMoving() == false) {setImagCount(0);}
- */
- @Override
- public void advanceTime(double time) {
- horizontalChanging(time);
- verticalChanging(time);
- running(time);
- jumping(time);
- if(second >= 1.0) {setPREVIOUS_ORIENTATION(); second =0;}
- else{second +=time;}
- if (milisecond >= 0.075) {setImagCount(getImagCount()+ 1); milisecond = 0;}
- else {milisecond += time;}
- if(isMoving() == false) {setImagCount(0);}
- }
- //Sprites => Defensively
- //Sprite
- public Sprite CURRENT_SPRITE;
- public Sprite[] SPRITES;
- public int imagCount;
- /**
- *
- * @return...
- * |result==SPRITES
- */
- public Sprite[] getSPRITES() {return SPRITES;}
- /**
- * Sets the sprites for Mazub
- * @param sPRITES
- * @post ...
- * |SPRITES = sPRITES
- * @throws IllegalArgumentExecption if array of sprytes is empty.
- * |if(sPRITES==null) {throw new IllegalArgumentException();}
- */
- public void setSPRITES(Sprite[] sPRITES) throws IllegalArgumentException{
- if(sPRITES==null) {throw new IllegalArgumentException();}
- SPRITES = sPRITES;}
- /**
- * Sets the image Count of the sprites for Mazub
- * @param imagCount
- * @post ..
- * |this.imagCount = imagCount
- */
- public void setImagCount(int imagCount){
- this.imagCount = imagCount;}
- /**
- * Gets the image Count of the sprites for Mazub
- * @return...
- * |result==imagCount
- */
- public int getImagCount() {return imagCount;}
- /**
- * Gets the current sprite for Mazub while it is moving.
- * @effect...
- * |if((isDucking() == false)&&(getPREVIOUS_ORIENTATION() ==0) && (getOrientation() == 0)) {return getSPRITES()[0];}
- * |else if((isDucking() == true) && (getPREVIOUS_ORIENTATION()==0) &&(getOrientation() == 0)) {return getSPRITES()[1];
- * |else if((getPREVIOUS_ORIENTATION() > 0) && (Moving == false) && (isDucking() == false)) {return getSPRITES()[2];}
- * |else if((getPREVIOUS_ORIENTATION() < 0) && (Moving == false)&& (isDucking() == false)) {return getSPRITES()[3];}
- * |else if((getOrientation() == 1) && (isDucking() ==false) && (isJumping() == true)) {return getSPRITES()[4];}
- * |else if((getOrientation() ==-1) && (isDucking() == false)&& (isJumping() == true)) {return getSPRITES()[5];}
- * |else if((getPREVIOUS_ORIENTATION() ==1||getOrientation() == 1) && (isDucking() == true)) {return getSPRITES()[6];}
- * |else if((getPREVIOUS_ORIENTATION() == -1|| getOrientation() == -1) &&(isDucking() ==true)) {return getSPRITES()[7];}
- * |else if((getOrientation() == 1) && (isDucking() == false)&& (isJumping() == false)) {return getSPRITES()[8+setImages()];}
- * |else if((getOrientation() == -1) && (isDucking()== false)&& (isJumping() ==false)) {return getSPRITES()[((SPRITES.length-8)/2+8)+(setImages())];}
- * |else {return getSPRITES()[1];}
- * @return
- * |result==getSPRITES()
- */
- public Sprite getCurrentSprite() {
- //0 is not moving horizontally, has not moved horizontally within the last second of in-game time and is not ducking.
- if((isDucking() == false)&&(getPREVIOUS_ORIENTATION() ==0) && (getOrientation() == 0)) {return getSPRITES()[0]; }
- //1 is not moving horizontally, has not moved horizontally within the last second of in-game time and is ducking.
- else if ((isDucking() == true) && (getPREVIOUS_ORIENTATION()==0) &&(getOrientation() == 0)) {return getSPRITES()[1];}
- //2 is not moving horizontally but its last horizontal movement was to the right (within 1s), and the character is not ducking.
- //Looking at right
- else if ((getPREVIOUS_ORIENTATION() > 0) && (Moving == false) && (isDucking() == false)) {return getSPRITES()[2];}
- //3 is not moving horizontally but its last horizontal movement was to the left (within 1s), and the character is not ducking.
- //Looking at left
- else if ((getPREVIOUS_ORIENTATION() < 0) && (Moving == false)&& (isDucking() == false)) {return getSPRITES()[3];}
- //4 is moving to the right and jumping and not ducking.
- //Jumping right
- else if ((getOrientation() == 1) && (isDucking() ==false) && (isJumping() == true)) {return getSPRITES()[4];}
- //5 is moving to the left and jumping and not ducking.
- else if ((getOrientation() ==-1) && (isDucking() == false)&& (isJumping() == true)) {return getSPRITES()[5];}
- //6 is ducking and moving to the right or was moving to the right (within 1s)
- else if ((getPREVIOUS_ORIENTATION() ==1||getOrientation() == 1) && (isDucking() == true)) {return getSPRITES()[6];}
- //7 is ducking and moving to the left or was moving to the left (within 1s).
- else if ((getPREVIOUS_ORIENTATION() == -1|| getOrientation() == -1) &&(isDucking() ==true)) {return getSPRITES()[7];}
- //8..(8 + m) the character is neither ducking nor jumping and moving to the right
- else if ((getOrientation() == 1) && (isDucking() == false)&& (isJumping() == false)) {return getSPRITES()[8+setImages()];}
- //(9 + m)..(9 + 2m) the character is neither ducking nor jumping and moving to the left.
- else if ((getOrientation() == -1) && (isDucking()== false)&& (isJumping() ==false)) {return getSPRITES()[((SPRITES.length-8)/2+8)+(setImages())];}
- else {return getSPRITES()[1];}
- }
- /**
- * Sets the images of Mazub
- * @post...
- * |int length=(getSPRITES().length-8)/2;
- * |int m1 = getImagCount();
- * @return ...
- * |result==m1
- * @effect...
- * |if(getImagCount() >= length) {setImagCount(0);
- */
- public int setImages() {
- int length=(getSPRITES().length-8)/2;
- if(getImagCount() >= length) {setImagCount(0);}
- int m1 = getImagCount();
- return m1;
- }
- public boolean IllegalSprites;
- /**
- * Gets illegal Sprites
- * @return
- * |result==if(IllegalSprites)
- * @effect...
- * |if( getSPRITES() == null || getSPRITES().length< 10 ||(getSPRITES().length%2) == 1) {
- * |return IllegalSprites = true;}
- * |for (Sprite sprite : SPRITES) {if(sprite == null) {return IllegalSprites = true;}}
- */
- public boolean getIllegalSprites() {
- if( getSPRITES() == null || getSPRITES().length< 10 ||(getSPRITES().length%2) == 1) {
- return IllegalSprites = true;}
- for (Sprite sprite : SPRITES) {
- if(sprite == null) {return IllegalSprites = true;}}
- return IllegalSprites = false;
- }
- int[] SpriteDimentions=new int[2];
- public int Width=0;int Heigth=0;
- public int[] getSpriteDimention() {
- if(isJumping()|| isMoving()) {this.Width=70;this.Heigth=97;}
- if(!(isMoving()) && !(isDucking()) && !(isJumping())) {this.Width=70; this.Heigth=97;}
- if(isDucking()) {this.Width=70; this.Heigth=70;}
- SpriteDimentions[0]=this.Width;
- SpriteDimentions[1]=this.Heigth;
- return SpriteDimentions;
- }
- @Override
- public void setHitPoint(int hitpoint) {
- if(Hitpoint<=500) {Hitpoint= Hitpoint+hitpoint;}
- }
- public int getHitpointMZ() {return Hitpoint;}
- @Override
- public boolean isDeadGameObject() {
- if(getHitpointMZ()==0) {return true;}
- else {return false;}
- }
- @Override
- public void terminateGameObject() { }
- World world;
- @Override
- public void setWorld(World qworld) {world = qworld;}
- public World getWorld() {return world;}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement