Constructor


WorldBullet(x: number, y: number, texture: (string|love.Image)?)

Arguments:

x: number
y: number
texture: (string|love.Image)?




Methods










WorldBullet: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


WorldBullet:onAdd(parent: any)

Arguments:

parent: any


WorldBullet:onCollide(soul: OverworldSoul)

(Override) Called when the bullet collides with the player's soul, before invulnerability checks.

Arguments:

soul: OverworldSoul

The soul of the player used when in the Overworld.
The Overworld soul defines the player's hitbox against bullets in the Overworld and controls taking damage from them - as such it is only visible if inside a battle area.



WorldBullet:onDamage(soul: OverworldSoul)

(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: OverworldSoul

The soul of the player used when in the Overworld.
The Overworld soul defines the player's hitbox against bullets in the Overworld and controls taking damage from them - as such it is only visible if inside a battle area.



WorldBullet:onRemove(parent: any)

Arguments:

parent: any


WorldBullet: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 true)

on_finished: fun( any)?

A function that is called when the animation finishes.

Returns:

1: Sprite?





Fields








WorldBullet.world: World

The current World instance. Not defined until after WorldBullet:init(), and only if it is parented to a World instance.



Undocumented