Modifier and Type | Field and Description |
---|---|
static java.lang.String |
WEAPON_SLOT_NAME
Stores the name of the slot on the player in Spine where melee weapon images are stored.
|
Constructor and Description |
---|
MeleeWeapon(java.lang.String name,
java.lang.String description,
float damage,
float reach)
Accepts the name, description, damage, and range of the melee weapon.
|
Modifier and Type | Method and Description |
---|---|
Rectangle |
getCollider()
Returns the collider around the melee weapon used to detect when the weapon hits an enemy.
|
float |
getReach()
Gets the horizontal reach in world units of the melee weapon.
|
void |
hit(GameObject gameObject)
Called when the MeleeWeapon has hit a GameObject and should deal damage to it.
|
abstract void |
hitTree(Tree tree)
Called when the MeleeWeapon has hit a tree and should deal damage to it.
|
void |
setCollider(Rectangle collider)
Sets the collider around the melee weapon used to detect when the weapon hits an enemy.
|
void |
setReach(float range)
Sets the horizontal reach in world units of the melee weapon.
|
getDamage, getSlotName, getWeaponAttachment, setDamage, setWeaponAttachment, setWeaponSlotName
getDescription, getItemAttachment, getName, setDescription, setItemAttachment, setName
public static final java.lang.String WEAPON_SLOT_NAME
public MeleeWeapon(java.lang.String name, java.lang.String description, float damage, float reach)
public float getReach()
public void setReach(float range)
public void hit(GameObject gameObject)
public abstract void hitTree(Tree tree)
public Rectangle getCollider()
public void setCollider(Rectangle collider)