The RPGFigurine behavior is present on Objects that are figurines with built-in animations i.e. RPG Kit objects.
RPGFigurine member variable which can be assigned a function that will be executed in response to an even
|onAttack( hitObjects)||Executed when an attack is performed by the RPGFigurine Object.|
|onHit( attacker)||Executed when the RPGFigurine Object is attacked.|
Make an RPG figurine attack.
Callback Member Details¶
Executed when an attack is performed by the RPGFigurine Object.
An attack is triggered via the context menu or by pressing the appropriate number key. If another RPGFigurine is within its attack arc, then onHit will be executed on the other figurine.
onAttack callback that prints the name of each object attacked.
function object.RPGFigurine.onAttack(hitObjects) for _, v in ipairs(hitObjects) do print(v.getName() .. " was hit!") end end
Executed when the RPGFigurine Object is hit by another attacking RPGFigure Object.
An attack is triggered via the context menu or by pressing the appropriate number key. If this RPGFigurine Object is within the attack radius of an attacker, this function will be executed.
onHit callback that prints the name of the object that performed the attack.
function object.RPGFigurine.onHit(attacker) print(attacker.getName() .. " attacked the Cyclops!") end