From 24f5e910dd8f575adc483f768422ab51fdf905cc Mon Sep 17 00:00:00 2001 From: altaf-creator Date: Sat, 13 Apr 2024 14:55:31 +0700 Subject: Initial commit. Exists: NumberNode, Player, dragging and dropping, joining NumberNodes --- Scripts/NumberArea.gd | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Scripts/NumberArea.gd (limited to 'Scripts/NumberArea.gd') diff --git a/Scripts/NumberArea.gd b/Scripts/NumberArea.gd new file mode 100644 index 0000000..443fada --- /dev/null +++ b/Scripts/NumberArea.gd @@ -0,0 +1,20 @@ +extends Area2D + +var parent : NumberNode + +func _ready(): + parent = $".." + +func _on_mouse_entered(): + if !parent.do_scanning: + return + + if GlobalVariables.is_snapping && GlobalVariables.player.legal: + GlobalVariables.player.target = parent + +func _on_mouse_exited(): + if !parent.do_scanning: + return + + if GlobalVariables.is_snapping: + GlobalVariables.player.target = null -- cgit v1.2.3