SpellCasting Class
A component class which allows an entity to cast spells.
Constructor
SpellCasting
-
rightCastPointX
-
rightCastPointY
-
friendCollideWith
-
foeCollideWith
Parameters:
-
rightCastPointX
NumberThe x component of the cast point. The cast point is a position relative to the entity's position from which a spell will be fired. This point is for when an entity casts while facing to the right, the left variant is calculated automatically.
-
rightCastPointY
NumberThe y component of the cast point. The cast point is a position relative to the entity's position from which a spell will be fired. This point is for when an entity casts while facing to the right, the left variant is calculated automatically.
-
friendCollideWith
NumberA bit mask used when querying the physics engine for friendly entities.
-
foeCollideWith
NumberA bit mask used when querying the physics engine for enemy entities.
Item Index
Methods
canCastSpell
-
spellName
Checks whether the spell is ready to be cast again.
Parameters:
-
spellName
String
Returns:
getFoeCollideWith
()
Number
Returns:
getFriendCollideWith
()
Number
Returns:
getRightCastPoint
-
vector
Parameters:
-
vector
Vector2DVector to which the cast point will be copied.
getSpellCooldown
-
spellName
Parameters:
-
spellName
String
Returns:
setFoeCollideWith
-
foeCollideWith
Parameters:
-
foeCollideWith
NumberA bit mask used when querying the physics engine for enemy entities.
setFriendCollideWith
-
friendCollideWith
Parameters:
-
friendCollideWith
NumberA bit mask used when querying the physics engine for friendly entities.
setRightCastPoint
-
rightCastPointX
-
rightCastPointY
Parameters:
-
rightCastPointX
NumberThe x component of the cast point. The cast point is a position relative to the entity's position from which a spell will be fired. This point is for when an entity casts while facing to the right, the left variant is calculated automatically.
-
rightCastPointY
NumberThe y component of the cast point. The cast point is a position relative to the entity's position from which a spell will be fired. This point is for when an entity casts while facing to the right, the left variant is calculated automatically.
setSpellCooldown
-
spellName
-
cooldown
Parameters:
-
spellName
String -
cooldown
NumberThis value needs to be in seconds.