SpellSystem Class
System responsible for casting and handling spells.
Constructor
SpellSystem
-
entitySystemManager
-
assetManager
-
healthSystem
-
physicsSystem
-
forceGeneratorRegistry
-
collisionMasks
Parameters:
-
entitySystemManager
ManagerThe entity system manager whose entities this system will be working on.
-
assetManager
AssetManagerThe manager is required, because spell assets are retrieved at runtime.
-
healthSystem
HealthSystem -
physicsSystem
PhysicsSystem -
forceGeneratorRegistry
ForceGeneratorRegistry -
collisionMasks
ObjectAn object holding bit masks used for determining collision categories.
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
destroy
()
update
-
deltaTime
Parameters:
-
deltaTime
NumberThe time that passed since last update.