simpleAttackMelee method
void
simpleAttackMelee({
- required double damage,
- required double height,
- required double width,
- int? id,
- int interval = 1000,
- bool withPush = false,
- double? sizePush,
- Direction? direction,
- Future<
SpriteAnimation> ? animationRight, - Future<
SpriteAnimation> ? animationDown, - Future<
SpriteAnimation> ? animationLeft, - Future<
SpriteAnimation> ? animationUp, - VoidCallback? execute,
Execute simple attack melee using animation
Implementation
void simpleAttackMelee({
required double damage,
required double height,
required double width,
int? id,
int interval = 1000,
bool withPush = false,
double? sizePush,
Direction? direction,
Future<SpriteAnimation>? animationRight,
Future<SpriteAnimation>? animationDown,
Future<SpriteAnimation>? animationLeft,
Future<SpriteAnimation>? animationUp,
VoidCallback? execute,
}) {
if (!this.checkInterval('attackMelee', interval, dtUpdate)) return;
if (isDead) return;
Direction direct = direction ?? getComponentDirectionFromMe(gameRef.player);
this.simpleAttackMeleeByDirection(
damage: damage,
direction: direct,
height: height,
width: width,
id: id,
withPush: withPush,
sizePush: sizePush,
animationUp: animationUp,
animationDown: animationDown,
animationLeft: animationLeft,
animationRight: animationRight,
);
execute?.call();
}