Module engine.Projectile
Functions
_M:act () | Called by the engine when the projectile can move |
_M:enoughEnergy (val) | Do we have enough energy |
_M:getEntityKind () | Return the kind of the entity |
_M:makeHoming (src, display, def, target, count, on_move, on_hit) | Generate a projectile for an homing projectile |
_M:makeProject (src, display, def, do_move, do_act, do_stop) | Generate a projectile for a project() call |
_M:move (x, y, force, map) | Moves a projectile on the map *WARNING*: changing x and y properties manually is *WRONG* and will blow up in your face. |
_M:moveDirection (x, y) | Move one step to the given target if possible This tries the most direct route, if not available it checks sides and always tries to get closer |
_M:on_move (x, y, target) | Something moved in the same spot as us, hit ? |
_M:useEnergy (val) | Use some energy |
Functions
- _M:act ()
- Called by the engine when the projectile can move
- _M:enoughEnergy (val)
-
Do we have enough energy
Parameters
- val:
- _M:getEntityKind ()
- Return the kind of the entity
- _M:makeHoming (src, display, def, target, count, on_move, on_hit)
-
Generate a projectile for an homing projectile
Parameters
- src:
- display:
- def:
- target:
- count:
- on_move:
- on_hit:
- _M:makeProject (src, display, def, do_move, do_act, do_stop)
-
Generate a projectile for a project() call
Parameters
- src:
- display:
- def:
- do_move:
- do_act:
- do_stop:
- _M:move (x, y, force, map)
-
Moves a projectile on the map *WARNING*: changing x and y properties manually is *WRONG* and will blow up in your face. Use this method. Always.
Parameters
- x: coord of the destination
- y: coord of the destination
- force: if true do not check for the presence of an other entity. *Use wisely*
- map: the map to move onto
Return value:
true if a move was *ATTEMPTED*. This means the actor will probably want to use energy - _M:moveDirection (x, y)
-
Move one step to the given target if possible This tries the most direct route, if not available it checks sides and always tries to get closer
Parameters
- x:
- y:
- _M:on_move (x, y, target)
-
Something moved in the same spot as us, hit ?
Parameters
- x:
- y:
- target:
- _M:useEnergy (val)
-
Use some energy
Parameters
- val: