player tracking
This commit is contained in:
parent
8eb39f4a70
commit
1e618d8cd4
7 changed files with 36 additions and 6 deletions
|
|
@ -1,5 +1,5 @@
|
|||
@tool
|
||||
class_name SpawnPatternRandomizer
|
||||
class_name RandomizedSpawnPattern
|
||||
extends BulletSpawnPattern
|
||||
## Randomizes properties of a child [BulletSpawnPattern] each [member iteration].
|
||||
##
|
||||
|
|
@ -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].
|
||||
15
systems/bullets/spawn_patterns/targetted_spawn_pattern.gd
Normal file
15
systems/bullets/spawn_patterns/targetted_spawn_pattern.gd
Normal 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
|
||||
|
|
@ -0,0 +1 @@
|
|||
uid://b00hsbakgtsi0
|
||||
Loading…
Add table
Add a link
Reference in a new issue