Added autoshooting

This commit is contained in:
2025-11-29 21:32:36 +03:00
parent 67342c82cc
commit f42139ef9c
7 changed files with 12 additions and 42 deletions
+5
View File
@@ -75,6 +75,11 @@ func accelerate(direction: Vector2, delta: float) -> void:
velocity = velocity.normalized() * max_speed
func shoot() -> void:
for weapon in _weapons:
weapon.shoot(velocity)
func _get_new_speed(accel: float, decel: float, current_speed: float) -> float:
if is_zero_approx(accel):
if absf(current_speed) < decel: