Constructor
Bullet(x: number, y: number, texture: (string|love.Image)?)
Arguments:
x: number | |
y: number | |
texture: (string|love.Image)? |
Methods
Bullet:getGrazeTension()
Get the graze tension for this bullet. If this bullet doesn't specify graze tension, it'll use the attacker's default value. If that can't be found either, then it will be the default of 1.6.
@return tension
— The tension to gain when this bullet is grazed.
Returns:
tension: number | The tension to gain when this bullet is grazed. |
Bullet:isBullet(id: string)
Checks whether this bullet is an instance or extension of a specific bullet type, specified by id
.
Arguments:
id: string |
Returns:
1: boolean |
Bullet:onCollide(soul: Soul)
(Override) Called when the bullet collides with the player's soul, before invulnerability checks.
Arguments:
soul: Soul | The Soul is the object the player controls in battle. |
Bullet:onDamage(soul: Soul)
(Override) Called when the bullet hits the player's soul without invulnerability frames.
Not calling super.onDamage()
here will stop the normal damage logic from occurring.
Arguments:
soul: Soul | The Soul is the object the player controls in battle. |
Returns:
battlers_hit: table<PartyBattler> |
Bullet:onGraze(first: boolean)
(Override) Called when the soul grazes a bullet.
@param first
— Whether the bullet has been grazed before or not.
Arguments:
first: boolean | Whether the bullet has been grazed before or not. |
Bullet:onWaveSpawn(wave: Wave)
Arguments:
wave: Wave | Waves are the bullet patterns that enemies use in battle. |
Bullet:setSprite(texture: (string|love.Image)?, speed: number?, loop: boolean?, on_finished: fun( any)?)
@param texture
— The new texture or path to the texture to set on the sprite (Removes the bullet's sprite if undefined)
@param speed
— The time between frames of the sprite, in seconds (Defaults to 1/30th second)
@param loop
— Whether the sprite should continuously loop. (Defaults to true
)
@param on_finished
— A function that is called when the animation finishes.
Arguments:
texture: (string|love.Image)? | The new texture or path to the texture to set on the sprite (Removes the bullet's sprite if undefined) |
speed: number? | The time between frames of the sprite, in seconds (Defaults to 1/30th second) |
loop: boolean? | Whether the sprite should continuously loop. (Defaults to |
on_finished: fun( any)? | A function that is called when the animation finishes. |
Returns:
1: Sprite? |
Fields
Bullet.attacker: EnemyBattler
The attacker that owns the wave which created this bullet. Not defined until after Bullet:init()
.
Bullet.wave: Wave
The wave that this bullet was created by. Not defined until after Bullet:init()
.