Modified weapon scripts and resources with a simplified spread angle

variable.
This commit is contained in:
Henry Faber 2026-06-25 02:06:28 +01:00
parent 4f90c82b8f
commit 4f3839448b
7 changed files with 75 additions and 3 deletions

View file

@ -10,6 +10,9 @@ var time_offset: float = 0.5
# When this bullet should fire (absolute time)
var fire_time: float = 0.0
# Angle offset for spread shots (in degrees)
var angle: float = 0.0
# Track if this bullet is currently active in the shot
var is_active: bool = false
@ -20,8 +23,9 @@ func _process(delta):
if !is_active and current_time >= fire_time:
activate()
# Move the bullet
position.y -= shot_data.speed * delta
# Move the bullet, factoring in spread angle
var velocity = Vector2.UP.rotated(deg_to_rad(angle)) * shot_data.speed
position += velocity * delta
func activate():
is_active = true