SimpleEnemy constructor
SimpleEnemy({
- required Vector2 position,
- required Vector2 size,
- SimpleDirectionAnimation? animation,
- double life = 100,
- double? speed,
- Direction initDirection = Direction.right,
- AcceptableAttackOriginEnum receivesAttackFrom = AcceptableAttackOriginEnum.PLAYER_AND_ALLY,
Implementation
SimpleEnemy({
required Vector2 position,
required Vector2 size,
SimpleDirectionAnimation? animation,
double life = 100,
double? speed,
Direction initDirection = Direction.right,
AcceptableAttackOriginEnum receivesAttackFrom =
AcceptableAttackOriginEnum.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;
}