Attempting to refactor the previously working self contained equidistent

code in the player.gd.
This commit is contained in:
Henry 2026-04-06 12:46:36 +01:00
parent 5d2efe9983
commit d419635d7f
15 changed files with 153 additions and 46 deletions

View file

@ -28,7 +28,7 @@ var weapon_spacing: float = 0.1
func _process(delta):
var input = Input.get_vector("left", "right", "up","down")
ship_displacement = position.y - previous_position.y
travel += bullet_speed * delta + (ship_displacement)
travel += bullet_speed * delta + abs(ship_displacement)
travel = clamp(travel, 0, 1.9 * weapon_spacing)
# Sprite feedback based one player input
@ -100,7 +100,7 @@ func shoot():
# Get weapon speed and spacing for equidistant calculations
weapon_rate = bullet.shot_data.rate
weapon_spacing = bullet.shot_data.projectile_spacing
bullet_speed = abs(bullet.shot_data.speed)
bullet_speed = bullet.shot_data.speed
# Print which weapon is firing
prints(bullet.shot_data.shot_name, "weapon fired")