player tracking

This commit is contained in:
Haze Weathers 2026-01-03 12:04:49 -06:00
parent 8eb39f4a70
commit 1e618d8cd4
7 changed files with 36 additions and 6 deletions

View file

@ -0,0 +1,32 @@
@tool
class_name StackedSpawnPattern
extends BulletSpawnPattern
## Spawns a pattern in a "stack". The pattern will be spawned multiple
## times at once with a varying [code]bullet_speed[/code].
## The subpattern to stack.
@export var pattern: BulletSpawnPattern
## The number of times to "stack" up the pattern.
@export_range(1, 1, 1, "or_greater") var stack_count: int = 1
## The minimum speed of the stacked patterns.
@export var min_speed: float:
set(value):
if min_speed != value:
min_speed = value
max_speed = maxf(min_speed, max_speed)
## The maximum speed of the stacked patterns.
@export var max_speed: float:
set(value):
if max_speed != value:
max_speed = value
min_speed = minf(min_speed, max_speed)
func _spawn_bullets(bullet_set: BulletSet, preset: BulletPreset) -> void:
for i in stack_count:
pattern.set(
&"bullet_speed",
remap(float(i), 0.0, float(stack_count - 1), min_speed, max_speed)
)
pattern.spawn_bullets(bullet_set, preset)