RangedAttack Class
An object describing a ranged attack. A ranged attack can spawn multiple projectiles at once.
Constructor
RangedAttack
()
Item Index
Methods
Methods
addProjectile
-
damageAmount
-
damageType
-
shape
-
speed
-
angleOffset
-
flyingAnimationHandle
-
[impactAnimationHandle]
-
[forceGenerator]
Parameters:
-
damageAmount
NumberThe amount of damage dealt by the projectile.
-
damageType
StringThe type of damage dealt by the projectile. This type can be 'c' for cyan, 'm' for magenta, 'y' for yellow and 'w' for white.
-
shape
Box | Circle | PolygonObject representing the physical shape of the projectile.
-
speed
NumberThe speed of the projectile.
-
angleOffset
NumberThis value needs to be in degrees. It describes the difference between the direction of attack and the direction a projectile is fired. For example, if this value is 30, the projectile will be fired slightly higher than the attack direction, if it's -30, the projectile will be fired slightly lower.
-
flyingAnimationHandle
AssetHandleA handle to the animation to be played while the projectile is flying.
-
[impactAnimationHandle]
AssetHandle optionalA handle to the animation to be played once the projectile hits something.
-
[forceGenerator]
Object optionalA force generator that will affect this projectile. This can be for example a GravityGenerator.