Updated the bullet spawning position to beging from the sprite height

modified by the weapon's origin variable.
This commit is contained in:
Henry Faber 2026-06-28 08:05:30 +01:00
parent 64e685a3c1
commit 9554af183c
7 changed files with 38 additions and 27 deletions

View file

@ -15,11 +15,11 @@ func compute_standard_props(weapon_data: WeaponShot, projectile_index: int, spaw
# Timing: center-first, pairs outward
var time_offset: float = abs(index_from_center) * weapon_data.stagger_offset
# Vertical spacing creates the ^ (inverted-V) geometry: outer projectiles fire higher
# than the center projectile. Negate the offset so outer bullets are pushed upward
# (lower y values in Godot), creating a ^ pattern relative to the origin.
# Vertical spacing creates the ^ (inverted-V) geometry: outer projectiles fire lower
# (higher Y values, further from the player) than the center projectile, which sits
# higher on screen (lower Y values). This creates a ^ pattern relative to the origin.
var vertical_offset: float = (abs(index_from_center) * weapon_data.projectile_vertical_spacing) / 2.0
var position: Vector2 = spawn_position + Vector2(bullet_horizontal_offset, -vertical_offset)
var position: Vector2 = spawn_position + Vector2(bullet_horizontal_offset, +vertical_offset)
# Angle (only when projectiles >= 3, division-by-zero guard)
var bullet_angle: float = 0.0
@ -68,8 +68,11 @@ func compute_grouped_props(group: WeaponProjectileGroup, weapon_data: WeaponShot
else:
bullet_angle += spread_contribution
# Position: horizontal offset only (vertical position comes from spawn_position)
var position: Vector2 = spawn_position + Vector2(bullet_horizontal_offset, 0)
# Vertical spacing creates the ^ (inverted-V) geometry: outer projectiles fire lower
# (higher Y values, further from the player) than the center projectile, which sits
# higher on screen (lower Y values). This creates a ^ pattern relative to the origin.
var vertical_offset: float = (abs(index_from_center) * weapon_data.projectile_vertical_spacing) / 2.0
var position: Vector2 = spawn_position + Vector2(bullet_horizontal_offset, +vertical_offset)
# Timing: group delay + within-group stagger
var time_offset: float = group.group_delay + abs(index_from_center) * group.stagger_offset