bullets bullets bullets bullets
This commit is contained in:
parent
846040c0e4
commit
55059788b2
25 changed files with 139 additions and 91 deletions
|
|
@ -16,11 +16,11 @@ func spawn_bullets(bullet_set: BulletSet, preset: BulletPreset) -> void:
|
|||
preset.face_direction
|
||||
)
|
||||
|
||||
var line = line_normal.orthogonal()
|
||||
var line = line_normal.orthogonal().rotated(bullet_set.spawn_rotation)
|
||||
var weight = float(i) / float(bullet_count - 1)
|
||||
weight -= 0.5
|
||||
if bullet_count == 1:
|
||||
weight = 0.0
|
||||
bullet.position = line * weight * line_width
|
||||
bullet.position = bullet_set.spawn_offset + line * weight * line_width
|
||||
|
||||
bullet_set.add_bullet(bullet)
|
||||
|
|
|
|||
|
|
@ -10,12 +10,12 @@ extends BulletSpawnPattern
|
|||
|
||||
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 angle = (float(i) / float(bullet_count)) * TAU + angle_offset + bullet_set.spawn_rotation
|
||||
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.position = bullet_set.spawn_offset + Vector2.from_angle(angle) * distance_offset
|
||||
bullet_set.add_bullet(bullet)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue