Module ...

Handles actors life and death

Functions

_M:attack (target) Actor is being attacked! Module authors should rewrite it to handle combat, dialog, ...
_M:block_move (x, y, e, can_attack) Checks if something bumps in us If it happens the method attack is called on the target with the attacker as parameter.
_M:die (src) Called when died
_M:heal (value, src) Heal some
_M:regenLife () Regenerate life, call it from your actor class act() method
_M:takeHit (value, src) Remove some HP from an actor If HP is reduced to 0 then remove from the level and call the die method.
When an actor dies its dead property is set to true, to wait until garbage collection deletes it


Functions

_M:attack (target)
Actor is being attacked! Module authors should rewrite it to handle combat, dialog, ...

Parameters

  • target: the actor attacking us
_M:block_move (x, y, e, can_attack)
Checks if something bumps in us If it happens the method attack is called on the target with the attacker as parameter. Do not touch!

Parameters

  • x:
  • y:
  • e:
  • can_attack:
_M:die (src)
Called when died

Parameters

  • src:
_M:heal (value, src)
Heal some

Parameters

  • value:
  • src:
_M:regenLife ()
Regenerate life, call it from your actor class act() method
_M:takeHit (value, src)
Remove some HP from an actor If HP is reduced to 0 then remove from the level and call the die method.
When an actor dies its dead property is set to true, to wait until garbage collection deletes it

Parameters

  • value:
  • src:

Valid XHTML 1.0!