Godot Version
4.4
Question
so im making a jetpack joyride clone game and struggling with the lasers I can get them to spawn at the same x axis at random y axis but not slightly ahead lemme just show the entire code to get that out the way
extends Node
@onready var Laser: PackedScene = preload("res://Scenes/Laser.tscn")
var x = 469
func spawn(pos):
var laser_instance = Laser.instantiate()
laser_instance.position = pos
add_child(laser_instance)
func _process(delta: float) -> void:
pass
func _on_timer_timeout() -> void:
spawn(Vector2(Global.player_position.x,randf_range(93, -200)))
so what i want to do is have the global player position to have 469 as a base then increasing indepentantly to 469 so at any given frame its 469 + current position but 469 doesnt add onto its self it just adds every position and not its entire number there also might be a better method of this which I am very open to