Cyclone-Tracker/cyclone_spawner.gd
2025-07-04 17:53:08 +10:00

20 lines
575 B
GDScript

extends Node2D
var loaded : bool = false
signal spawn(spawn_position : Vector2)
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
visible = loaded
if loaded:
global_position = get_global_mouse_position()
if(Input.is_action_just_pressed("spawn")):
loaded = false
spawn.emit(get_global_mouse_position())
if(Input.is_action_just_pressed("cancel_spawn")):
loaded = false