simpleAttackRange method
void
simpleAttackRange({
- required Future<
SpriteAnimation> animation, - required Vector2 size,
- Future<
SpriteAnimation> ? animationDestroy, - Vector2? destroySize,
- dynamic id,
- double speed = 150,
- double damage = 1,
- double? radAngleDirection,
- bool withDecorationCollision = true,
- VoidCallback? onDestroy,
- ShapeHitbox? collision,
- LightingConfig? lightingConfig,
- Vector2? centerOffset,
- double marginFromOrigin = 16,
Implementation
void simpleAttackRange({
/// use animation facing right.
required Future<SpriteAnimation> animation,
required Vector2 size,
Future<SpriteAnimation>? animationDestroy,
Vector2? destroySize,
dynamic id,
double speed = 150,
double damage = 1,
double? radAngleDirection,
bool withDecorationCollision = true,
VoidCallback? onDestroy,
ShapeHitbox? collision,
LightingConfig? lightingConfig,
Vector2? centerOffset,
double marginFromOrigin = 16,
}) {
double? angle = radAngleDirection ?? this.angle;
simpleAttackRangeByAngle(
angle: angle,
animation: animation,
animationDestroy: animationDestroy,
size: size,
id: id,
speed: speed,
damage: damage,
withDecorationCollision: withDecorationCollision,
onDestroy: onDestroy,
destroySize: destroySize,
collision: collision,
lightingConfig: lightingConfig,
centerOffset: centerOffset,
marginFromOrigin: marginFromOrigin,
attackFrom: AttackOriginEnum.PLAYER_OR_ALLY,
);
}