bullets bullets bullets bullets
This commit is contained in:
parent
846040c0e4
commit
55059788b2
25 changed files with 139 additions and 91 deletions
12
systems/bullets/set_behaviors/bullet_set_behavior.gd
Normal file
12
systems/bullets/set_behaviors/bullet_set_behavior.gd
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
@abstract
|
||||
class_name BulletSetBehavior
|
||||
extends Resource
|
||||
|
||||
|
||||
## Process one physics tick for a [BulletSet].
|
||||
func process_set(bullet_set: BulletSet, delta: float) -> void:
|
||||
_process_set(bullet_set, delta)
|
||||
|
||||
|
||||
## Called once ever physics tick for the [BulletSet].
|
||||
@abstract func _process_set(bullet_set: BulletSet, delta: float) -> void
|
||||
1
systems/bullets/set_behaviors/bullet_set_behavior.gd.uid
Normal file
1
systems/bullets/set_behaviors/bullet_set_behavior.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://cu4iq25sb3y5f
|
||||
11
systems/bullets/set_behaviors/multi_set_behavior.gd
Normal file
11
systems/bullets/set_behaviors/multi_set_behavior.gd
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
class_name MultiSetBehavior
|
||||
extends BulletSetBehavior
|
||||
## Processes multiple [BulletSetBehavior]s in order for the [BulletSet].
|
||||
|
||||
|
||||
@export var behaviors: Array[BulletSetBehavior] = []
|
||||
|
||||
|
||||
func _process_set(bullet_set: BulletSet, delta: float) -> void:
|
||||
for behavior in behaviors:
|
||||
behavior.process_set(bullet_set, delta)
|
||||
1
systems/bullets/set_behaviors/multi_set_behavior.gd.uid
Normal file
1
systems/bullets/set_behaviors/multi_set_behavior.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://cijy4yedxklfd
|
||||
11
systems/bullets/set_behaviors/rotation_set_behavior.gd
Normal file
11
systems/bullets/set_behaviors/rotation_set_behavior.gd
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
class_name RotationSetBehavior
|
||||
extends BulletSetBehavior
|
||||
|
||||
|
||||
@export_custom(0, "radians_as_degrees,suffix:°/s") var rotation_speed: float = 0.0
|
||||
@export_custom(0, "radians_as_degrees,suffix:°/s") var spawn_rotation_speed: float = 0.0
|
||||
|
||||
|
||||
func _process_set(bullet_set: BulletSet, delta: float) -> void:
|
||||
bullet_set.rotation += rotation_speed * delta
|
||||
bullet_set.spawn_rotation += spawn_rotation_speed * delta
|
||||
|
|
@ -0,0 +1 @@
|
|||
uid://5scjonwmg8tw
|
||||
Loading…
Add table
Add a link
Reference in a new issue