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

@ -1,5 +1,5 @@
@tool
class_name SpawnPatternRandomizer
class_name RandomizedSpawnPattern
extends BulletSpawnPattern
## Randomizes properties of a child [BulletSpawnPattern] each [member iteration].
##

View file

@ -1,5 +1,5 @@
@tool
class_name SpawnPatternStacker
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].

View file

@ -0,0 +1,15 @@
class_name TargettedSpawnPattern
extends BulletSpawnPattern
@export var pattern: BulletSpawnPattern
func _spawn_bullets(bullet_set: BulletSet, preset: BulletPreset) -> void:
var original_spawn_rotation = bullet_set.spawn_rotation
var player = bullet_set.get_tree().get_first_node_in_group(&"player") as Player
if player:
var local_player_pos = bullet_set.to_local(player.global_position)
bullet_set.spawn_rotation = local_player_pos.angle()
pattern.spawn_bullets(bullet_set, preset)
bullet_set.spawn_rotation = original_spawn_rotation

View file

@ -0,0 +1 @@
uid://b00hsbakgtsi0