Attempting to set up equidistant bullets based on player movement.

This commit is contained in:
Henry 2026-03-21 18:30:26 +00:00
parent 142bf87eca
commit 07c63f4122
4 changed files with 25 additions and 4 deletions

View file

@ -46,7 +46,7 @@ func _process(delta):
if is_shooting == false: return
func shield_set(_sdvalue: int):
func shield_set(_value: int):
return
@ -64,9 +64,22 @@ func shoot():
bullet.position = self.position + Vector2(0,-12)
get_tree().root.add_child(bullet)
weapon_rate = bullet.shot_data.rate
print(bullet.shot_data.shot_name, " weapon fired") #Print which weapon is firing
prints(bullet.shot_data.shot_name, "weapon fired") #Print which weapon is firing
#weapon_cooldown = $WeaponCooldown
#weapon_cooldown.wait_time = bullet.shot_data.cooldown
#weapon_cooldown.start()
#can_shoot = not can_shoot
#I track the vertical distance the last bullet traveled relative to the ship:
#
#travel += bulletSpeed*dt + (Ship.y - prevShipY)
#set prevShipY to Ship.y
#
#when travel > spacing -> fire bullet and
#
#set travel -= spacing
#
#(where spacing is the distance you want bullets to be apart, in pixels)