feat: ability to share dragons
This commit is contained in:
parent
3919df1805
commit
029ad6d45f
15 changed files with 203 additions and 30 deletions
|
@ -6,7 +6,7 @@ class_name Dragon
|
|||
|
||||
@onready var _actual_position: Vector2 = position
|
||||
var main_window_rect: Rect2i
|
||||
@onready var draggable: Draggable = $DragDropDetector
|
||||
@export var draggable: Draggable
|
||||
|
||||
var _walking: bool = false
|
||||
var _thinking_path: bool = false
|
||||
|
@ -15,15 +15,16 @@ var rng: RandomNumberGenerator = RandomNumberGenerator.new()
|
|||
|
||||
signal place_back(dragon: Dragon)
|
||||
|
||||
var id: int
|
||||
|
||||
|
||||
func on_place_back() -> void:
|
||||
place_back.emit(self)
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
func start_dragon_drag()-> void:
|
||||
draggable.initial_drag()
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if draggable.dragging:
|
||||
_actual_position = position
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
[ext_resource type="Script" uid="uid://ch7d3wo8ucskb" path="res://scenes/window/draggable.gd" id="2_2r6si"]
|
||||
[ext_resource type="PackedScene" uid="uid://baa8gpicw2yg0" path="res://scenes/dragons/dragon_sprite.tscn" id="3_ctdir"]
|
||||
|
||||
[node name="DragonPopup" type="Window" node_paths=PackedStringArray("dragon")]
|
||||
[node name="DragonPopup" type="Window" node_paths=PackedStringArray("dragon", "draggable")]
|
||||
disable_3d = true
|
||||
transparent_bg = true
|
||||
size = Vector2i(128, 128)
|
||||
|
@ -14,6 +14,7 @@ transparent = true
|
|||
script = ExtResource("1_ctdir")
|
||||
dragon_speed = 100.0
|
||||
dragon = NodePath("Dragon")
|
||||
draggable = NodePath("DragDropDetector")
|
||||
|
||||
[node name="DragDropDetector" type="Control" parent="."]
|
||||
layout_mode = 3
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue