Modified weapon scripts and resources with a simplified spread angle
variable.
This commit is contained in:
parent
4f90c82b8f
commit
4f3839448b
7 changed files with 75 additions and 3 deletions
|
|
@ -34,9 +34,15 @@ func shoot():
|
|||
# Final position combines symmetrical horizontal spread with symmetrical vertical spacing
|
||||
bullet.position = player.position + Vector2(bullet_horizontal_offset, weapon_data.origin + (vertical_offset + weapon_data.origin - total_projectiles))
|
||||
|
||||
# Calculate angle for this bullet (only when projectiles >= 3)
|
||||
var bullet_angle: float = 0.0
|
||||
if total_projectiles >= 3:
|
||||
bullet_angle = (index_from_center / center_index) * (weapon_data.spread_angle / 2.0)
|
||||
|
||||
# Set timing properties on the bullet
|
||||
bullet.time_offset = time_offset
|
||||
bullet.fire_time = current_time + time_offset
|
||||
bullet.angle = bullet_angle
|
||||
|
||||
# Set the bullet data
|
||||
bullet.set_weapon_data(weapon_data.bullet_scene, weapon_data)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue