API Docs for:
Show:

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 Number

    The amount of damage dealt by the projectile.

  • damageType String

    The 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 | Polygon

    Object representing the physical shape of the projectile.

  • speed Number

    The speed of the projectile.

  • angleOffset Number

    This 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 AssetHandle

    A handle to the animation to be played while the projectile is flying.

  • [impactAnimationHandle] AssetHandle optional

    A handle to the animation to be played once the projectile hits something.

  • [forceGenerator] Object optional

    A force generator that will affect this projectile. This can be for example a GravityGenerator.