public interface Attacker extends Trait, Updatable
Modifier and Type | Method and Description |
---|---|
void |
addListener(AttackerListener listener)
Add an attacker listener.
|
void |
attack(Transformable target)
Define a target to attack.
|
int |
getAttackDamages()
Get a random attack damages (between min and max).
|
Transformable |
getTarget()
Get the target entity.
|
boolean |
isAttacking()
Check weapon is attacking.
|
void |
setAttackDamages(int min,
int max)
Set attack damages between entity and target.
|
void |
setAttackDistance(int min,
int max)
Set attack distance between entity and target.
|
void |
setAttackFrame(int frame)
Represents the frame number (inside animation) which design the attack action.
|
void |
setAttackTimer(int time)
Set attack pause time between two attacks.
|
void |
stopAttack()
Stop the current attack.
|
void addListener(AttackerListener listener)
listener
- The attacker listener to add.void attack(Transformable target)
target
- The target to attack.void stopAttack()
void setAttackTimer(int time)
time
- The attack pause time.void setAttackFrame(int frame)
Example: for a footman, the frame number when the sword is going to hurt somebody (between 1-last).
frame
- The frame attack number.void setAttackDistance(int min, int max)
min
- The minimum attack distance (in tile).max
- The maximum attack distance (in tile).void setAttackDamages(int min, int max)
min
- The minimum attack damages.max
- The maximum attack damages.int getAttackDamages()
boolean isAttacking()
true
if currently attacking, false
else.Transformable getTarget()
Copyright © 2016 Byron 3D Games Studio. All rights reserved.