yes, they canjj st!
This commit is contained in:
parent
6b92473eeb
commit
a6421235f8
22 changed files with 510 additions and 14 deletions
21
systems/bullets/spawn_patterns/ring_pattern.gd
Normal file
21
systems/bullets/spawn_patterns/ring_pattern.gd
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
class_name RingPattern
|
||||
extends BulletSpawnPattern
|
||||
|
||||
|
||||
@export var bullet_count: int
|
||||
@export var distance_offset: float
|
||||
@export_custom(0, "radians_as_degrees") var angle_offset: float
|
||||
@export_custom(0, "radians_as_degrees") var direction_rotation: float
|
||||
|
||||
|
||||
func spawn_bullets(bullet_set: BulletSet, preset: BulletPreset) -> void:
|
||||
for i in bullet_count:
|
||||
var angle = (float(i) / float(bullet_count)) * TAU + angle_offset
|
||||
var bullet = Bullet.create(
|
||||
preset.textures.pick_random(),
|
||||
preset.hitbox_size,
|
||||
Vector2.from_angle(angle + direction_rotation),
|
||||
preset.face_direction
|
||||
)
|
||||
bullet.position = Vector2.from_angle(angle) * distance_offset
|
||||
bullet_set.add_bullet(bullet)
|
||||
Loading…
Add table
Add a link
Reference in a new issue