API Docs for:
Show:

SpellSystem Class

System responsible for casting and handling spells.

Constructor

SpellSystem

(
  • entitySystemManager
  • assetManager
  • healthSystem
  • physicsSystem
  • forceGeneratorRegistry
  • collisionMasks
)

Parameters:

  • entitySystemManager Manager

    The entity system manager whose entities this system will be working on.

  • assetManager AssetManager

    The manager is required, because spell assets are retrieved at runtime.

  • healthSystem HealthSystem
  • physicsSystem PhysicsSystem
  • forceGeneratorRegistry ForceGeneratorRegistry
  • collisionMasks Object

    An object holding bit masks used for determining collision categories.

Item Index

Methods

castSpell

(
  • castingEntity
  • spellName
)

Causes the entity to cast the specified spell. This function requires that the Position, SpellCasting and FacingDirection components are present. Additionally, if a WallGrappling component is present, the entity will cast the spell away from the wall it's grappling independently of the facing direction. This function plays animations. 'castSpellLeft.spellName' or 'castSpellRight.spellName' animation will play depending on the direction the spell was cast in. The 'spellName' after the dot in the animation name is the name of the spell cast.

Parameters:

  • castingEntity Entity
  • spellName String

update

(
  • deltaTime
)

Parameters:

  • deltaTime Number

    The time that passed since last update.