Module ...

A game type that gives each entities energy When an entity reaches an energy level it is allowed to act (it calls the entity"s "act" method)

Functions

_M:addEntity (e) Adds an entity to the game This differs from Level:addEntity in that it's not specific to actors and the entities are not bound to the current level.
_M:init (keyhandler, energy_to_act, energy_per_tick) Setup the game
_M:removeEntity (e) Removes an entity from the game
_M:tick () Gives energy and act if needed


Functions

_M:addEntity (e)
Adds an entity to the game This differs from Level:addEntity in that it's not specific to actors and the entities are not bound to the current level. Also they are stored in a *WEAK* table, so this wont hold them from garbage collecting if they are not

Parameters

  • e:
_M:init (keyhandler, energy_to_act, energy_per_tick)
Setup the game

Parameters

  • keyhandler: the default keyhandler for this game
  • energy_to_act:
  • energy_per_tick:
_M:removeEntity (e)
Removes an entity from the game

Parameters

  • e:
_M:tick ()
Gives energy and act if needed

Valid XHTML 1.0!