35 lines
773 B
Java
35 lines
773 B
Java
|
package com.uulm.marvelous.gamelibrary.entities;
|
||
|
|
||
|
import com.uulm.marvelous.gamelibrary.IntVector2;
|
||
|
|
||
|
/** Represents a rock entity on the map.
|
||
|
*/
|
||
|
public class Rock extends Entity {
|
||
|
/** The maximum hp of the rock.
|
||
|
*/
|
||
|
public final int maxHP;
|
||
|
|
||
|
/** The current hp of the rock.
|
||
|
*/
|
||
|
private int hp;
|
||
|
|
||
|
/** Constructs a new {@link Rock}.
|
||
|
* @param id The {@link EntityID} of the rock.
|
||
|
* @param position The position of the rock.
|
||
|
* @param hp The hp of the rock.
|
||
|
*/
|
||
|
public Rock(EntityID id, IntVector2 position, int hp) {
|
||
|
super(id, position);
|
||
|
this.maxHP = hp;
|
||
|
this.hp = hp;
|
||
|
}
|
||
|
|
||
|
public int getHp() {
|
||
|
return hp;
|
||
|
}
|
||
|
|
||
|
public void decreaseHp(int damage) {
|
||
|
this.hp -= damage;
|
||
|
}
|
||
|
}
|