further elaboration on bullets

This commit is contained in:
Haze Weathers 2025-12-30 23:34:19 -06:00
parent da9111bcf2
commit 393c3b670a
16 changed files with 218 additions and 29 deletions

View file

@ -3,10 +3,30 @@ class_name BulletBehavior
extends Resource
## Called when a bullet is spawned with this behavior in order to set up
## behavior-specific state.
@warning_ignore("unused_parameter")
func init_bullet(bullet: Bullet) -> void: pass
## Performs behavior-specific initialization for a [Bullet].
func init_bullet(bullet: Bullet) -> void:
bullet.recycled.connect(deinit_bullet.bind(bullet), CONNECT_ONE_SHOT)
_init_bullet(bullet)
## Called to process a tick of a bullet's movement.
@abstract func process_bullet(bullet: Bullet, delta: float) -> void
## Cleans up behavior-specific state for a [Bullet].
func deinit_bullet(bullet: Bullet) -> void:
_deinit_bullet(bullet)
## Processes one tick of a [Bullet]'s movement.
func process_bullet(bullet: Bullet, delta: float) -> void:
_process_bullet(bullet, delta)
## Called when a [Bullet] is spawned with this behavior in order to set up
## behavior-specific state.
@abstract func _init_bullet(bullet: Bullet) -> void
## Called when a [Bullet] is recycled in order to clean up behavior-specific state.
@abstract func _deinit_bullet(bullet: Bullet) -> void
## Called to process a tick of a [Bullet]'s movement.
@abstract func _process_bullet(bullet: Bullet, delta: float) -> void