GameComponentExtensions extension
Methods
-
addParticle(Particle particle, {Vector2? position, Vector2? size, Vector2? scale, double? angle, Anchor? anchor, int? priority})
→ void
-
Used to add particles in your component.
-
directionThePlayerIsIn()
→ Direction?
-
-
generateValues(Duration duration, {double begin = 0.0, double end = 1.0, Curve curve = Curves.linear, bool autoStart = true, VoidCallback? onFinish, ValueChanged<double>? onChange})
→ ValueGeneratorComponent
-
Used to generate numbers to create your animations or anythings
-
getComponentDirectionFromMe(GameComponent? comp)
→ Direction
-
-
isObjectCollision()
→ bool
-
Method that checks if this component contain collisions
-
overlaps(Rect other)
→ bool
-
-
showDamage(double damage, {TextStyle? config, double initVelocityTop = -5, double gravity = 0.5, double maxDownSize = 20, DirectionTextDamage direction = DirectionTextDamage.RANDOM, bool onlyUp = false})
→ void
-
Add in the game a text with animation representing damage received
-
simpleAttackMeleeByAngle({dynamic id, Future<SpriteAnimation>? animation, required double damage, required double angle, required AttackFromEnum attackFrom, required Vector2 size, bool withPush = true, double marginFromOrigin = 16, Vector2? centerOffset})
→ void
-
Execute simple attack melee using animation
-
simpleAttackMeleeByDirection({Future<SpriteAnimation>? animationRight, dynamic id, required double damage, required Direction direction, required Vector2 size, required AttackFromEnum attackFrom, bool withPush = true, double? sizePush, Vector2? centerOffset})
→ void
-
Execute simple attack melee using animation
-
simpleAttackRangeByAngle({required Future<SpriteAnimation> animation, required Vector2 size, required double angle, required double damage, required AttackFromEnum attackFrom, Vector2? destroySize, Future<SpriteAnimation>? animationDestroy, dynamic id, double speed = 150, bool withDecorationCollision = true, VoidCallback? onDestroy, CollisionConfig? collision, LightingConfig? lightingConfig, double marginFromOrigin = 16, Vector2? centerOffset})
→ void
-
Execute the ranged attack using a component with animation
-
simpleAttackRangeByDirection({required Future<SpriteAnimation> animationRight, required Vector2 size, required Direction direction, required AttackFromEnum attackFrom, Vector2? destroySize, dynamic id, double speed = 150, double damage = 1, bool withCollision = true, bool enableDiagonal = true, VoidCallback? onDestroy, CollisionConfig? collision, LightingConfig? lightingConfig, Future<SpriteAnimation>? animationDestroy, double marginFromOrigin = 16, Vector2? centerOffset})
→ void
-
Execute the ranged attack using a component with animation