Class EnemyData

Stores enemy data for spawning enemies.

Functions

EnemyData.new (name) Creates a new enemy data object.

Methods

EnemyData:add_ai (ai) Adds an ai behaviour to an enemy type.
EnemyData:set_segments (length) Sets the length of an enemy type.
EnemyData:set_hp (length) Sets the hp of an enemy type.
EnemyData:set_pack_size (pack) Sets the size of a pack of the enemy type.
EnemyData:set_speed (pack) Sets the speed of an enemy type.
EnemyData:set_spawn (pattern) Sets the spawn type of an enemy type.
EnemyData:register () registers an enemy data object as spawnable.


Functions

Methods
EnemyData.new (name)
Creates a new enemy data object.

Parameters:

  • name string The name of the enemy

Returns:

    EnemyData The new enemy data object

Methods

EnemyData:add_ai (ai)
Adds an ai behaviour to an enemy type.

Parameters:

  • ai integer The ai behaviour

See also:

EnemyData:set_segments (length)
Sets the length of an enemy type.

Parameters:

  • length integer The new length of the enemy
EnemyData:set_hp (length)
Sets the hp of an enemy type.

Parameters:

  • length float The new hp of the enemy.
EnemyData:set_pack_size (pack)
Sets the size of a pack of the enemy type.

Parameters:

  • pack integer The new size of a pack.
EnemyData:set_speed (pack)
Sets the speed of an enemy type.

Parameters:

  • pack float The new speed of a pack.
EnemyData:set_spawn (pattern)
Sets the spawn type of an enemy type.

Parameters:

  • pattern integer The new spawn pattern.

See also:

EnemyData:register ()
registers an enemy data object as spawnable.

Returns:

    integer The id of the newly registered enemy type.
generated by LDoc 1.5.0 Last updated 2024-05-23 11:40:37