Attempting to translate pseudocode to useable code…

This commit is contained in:
Henry 2026-03-23 00:49:03 +00:00
parent e5eea103ab
commit 4015e1c719
2 changed files with 12 additions and 1 deletions

View file

@ -7,7 +7,16 @@ extends Area2D
func _process(delta):
position += transform.y * (shot_data.speed + player.velocity.y) * delta #This works normally
#var player_position: float = player.position.y
var spacing: int = 5
var travel: float
travel += shot_data.speed * delta + (player.position.y - player.previous_location)
player.previous_location = player.position.y
if travel > spacing:
position += shot_data.speed * delta #This works normally
travel -= spacing
#position += (transform.y + player.velocity) * shot_data.speed * delta #This doesn'tt
func _on_visible_on_screen_notifier_2d_screen_exited() -> void:
queue_free()