Somewhat working prototype

This commit is contained in:
2025-10-20 18:05:23 -06:00
parent 309591a9b6
commit a82f3ac09e
7 changed files with 90 additions and 2 deletions

31
src/empty_space_thing.gd Normal file
View File

@@ -0,0 +1,31 @@
extends Control
class_name SpaceNode
var initial_pos: Vector2
var offset: Vector2
var draggable: bool = false
func _ready() -> void:
draggable = true
return
func _process(delta: float) -> void:
if draggable:
if Input.is_action_pressed("click", true):
self.global_position = Vector2(get_global_mouse_position().x, self.global_position.y)
elif Input.is_action_just_released("click"):
is_dragging.is_dragging = false
var tween = get_tree().create_tween()
tween.tween_property(self, "global_position", Vector2(get_global_mouse_position().x, self.global_position.y), 0.5).set_ease(Tween.EASE_IN_OUT)
else:
return
func reset_draggable():
if not is_dragging.is_dragging:
is_dragging.is_dragging = false
draggable = false