SimpleEnemy constructor
SimpleEnemy({
- required Vector2 position,
- required Vector2 size,
- SimpleDirectionAnimation? animation,
- double life = 100,
- double speed = 100,
- Direction initDirection = Direction.right,
- ReceivesAttackFromEnum receivesAttackFrom = ReceivesAttackFromEnum.PLAYER_AND_ALLY,
Implementation
SimpleEnemy({
required Vector2 position,
required Vector2 size,
SimpleDirectionAnimation? animation,
double life = 100,
double speed = 100,
Direction initDirection = Direction.right,
ReceivesAttackFromEnum receivesAttackFrom =
ReceivesAttackFromEnum.PLAYER_AND_ALLY,
}) : super(
position: position,
size: size,
life: life,
speed: speed,
receivesAttackFrom: receivesAttackFrom,
) {
this.animation = animation;
lastDirection = initDirection;
lastDirectionHorizontal =
initDirection == Direction.left ? Direction.left : Direction.right;
}