Class engine.Projectile

Projectile

Methods

engine.Projectile:move (x, y, force)

Moves a projectile on the map WARNING: changing x and y properties manually is WRONG and will blow up in your face.

engine.Projectile:enoughEnergy (val)

Do we have enough energy

engine.Projectile:useEnergy (val)

Use some energy

engine.Projectile: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

engine.Projectile:act ()

Called by the engine when the projectile can move

engine.Projectile:on_move (x, y, target)

Something moved in the same spot as us, hit ?

engine.Projectile:terminate (x, y)

Premature end

engine.Projectile:makeProject (src, display, def, do_move, do_act, do_stop)

Generate a projectile for a project() call

engine.Projectile:makeHoming (src, display, def, target, count, on_move, on_hit)

Generate a projectile for an homing projectile

engine.Projectile:getEntityKind ()

Return the kind of the entity



Methods

engine.Projectile:move (x, y, force)
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

Returns:

    true if a move was ATTEMPTED. This means the actor will probably want to use energy
engine.Projectile:enoughEnergy (val)
Do we have enough energy

Parameters:

  • val
engine.Projectile:useEnergy (val)
Use some energy

Parameters:

  • val
engine.Projectile: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
engine.Projectile:act ()
Called by the engine when the projectile can move
engine.Projectile:on_move (x, y, target)
Something moved in the same spot as us, hit ?

Parameters:

  • x
  • y
  • target
engine.Projectile:terminate (x, y)
Premature end

Parameters:

  • x
  • y
engine.Projectile: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
engine.Projectile: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
engine.Projectile:getEntityKind ()
Return the kind of the entity
generated by LDoc 1.4.3