diff --git a/Scenes/Unit/unit.gd b/Scenes/Unit/unit.gd new file mode 100644 index 0000000..a112da3 --- /dev/null +++ b/Scenes/Unit/unit.gd @@ -0,0 +1,77 @@ +extends Node2D + +class_name Unit + +### Marker +# For now the marker will be spawned and deleted by the unit. +# Later it will be handled by the main scene. +# Load marker scene. +var marker_scene = preload("res://Scenes/Unit/marker.tscn") +var marker + +@onready var _readyToSelectMarker = $ReadyToSelectMarker +@onready var _selectedMarker = $SelectedMarker + +var _selected = false +var _readyToSelect = false + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + marker = marker_scene.instantiate() + marker.hide() + + _readyToSelectMarker.hide() + _selectedMarker.hide() + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + pass + +func _input(event: InputEvent): + if event.is_action_pressed("Select"): + print_debug("Action is Select") + + # Can't select from myself since (global_)position is alway 0,0 + print("Event position: ", event.position) + print("My position is", position) + print("My global_position is", global_position) + + if event.position == global_position: + _setSelected(true) + print_debug("Unit selected") + + # We combine it with the fact that it is already marked (@see _markUnit) + if _readyToSelect: _selectUnit() + else: _deselectUnit() + + + if event.is_action_pressed("SetMarker") and _selected: + marker.global_position = event.position + marker.show() + print_debug("Setting marker") + +func _getUnitPosition(): + return $AnimatedSprite2D.global_position + +func _setSelected(selected: bool): + _selected = selected + +func _selectUnit(): + _setSelected(true) + _selectedMarker.show() + +func _deselectUnit(): + _setSelected(false) + _selectedMarker.hide() + +func _gets_selected(viewport: Node, event: InputEvent, shape_index: int): + if event.is_action_pressed("Select") and event.position == position: + _selectUnit() + +func _markUnit(): + _readyToSelect = true + _readyToSelectMarker.show() + +func _unMarkUnit(): + _readyToSelect = false + _readyToSelectMarker.hide() diff --git a/Scenes/Unit/unit.gd.uid b/Scenes/Unit/unit.gd.uid new file mode 100644 index 0000000..255a280 --- /dev/null +++ b/Scenes/Unit/unit.gd.uid @@ -0,0 +1 @@ +uid://dpu6c0bpm0dvl diff --git a/Scenes/Unit/unit.tscn b/Scenes/Unit/unit.tscn new file mode 100644 index 0000000..446a086 --- /dev/null +++ b/Scenes/Unit/unit.tscn @@ -0,0 +1,651 @@ +[gd_scene load_steps=91 format=3 uid="uid://dy7rltpxyqyw7"] + +[ext_resource type="Script" uid="uid://dpu6c0bpm0dvl" path="res://Scenes/Unit/unit.gd" id="1_15sed"] +[ext_resource type="Texture2D" uid="uid://cgvyfsuri6vmx" path="res://Graphics/TileMaps/kenney_rpgUrbanKit/Tilemap/tilemap.png" id="1_hgpyh"] +[ext_resource type="Texture2D" uid="uid://bprproedmlhtr" path="res://Graphics/TileMaps/kenney_rpgUrbanKit/Tiles/tile_0168.png" id="3_ladk0"] +[ext_resource type="Texture2D" uid="uid://b7ra2w7rdeqij" path="res://Graphics/TileMaps/kenney_rpgUrbanKit/Tiles/tile_0169.png" id="4_iuf4a"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_15sed"] +atlas = ExtResource("1_hgpyh") +region = Rect2(391, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ladk0"] +atlas = ExtResource("1_hgpyh") +region = Rect2(408, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_iuf4a"] +atlas = ExtResource("1_hgpyh") +region = Rect2(425, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ulevp"] +atlas = ExtResource("1_hgpyh") +region = Rect2(442, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_jbdwb"] +atlas = ExtResource("1_hgpyh") +region = Rect2(391, 17, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_kakeo"] +atlas = ExtResource("1_hgpyh") +region = Rect2(408, 17, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_2itl1"] +atlas = ExtResource("1_hgpyh") +region = Rect2(425, 17, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_uodik"] +atlas = ExtResource("1_hgpyh") +region = Rect2(425, 34, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_w60h1"] +atlas = ExtResource("1_hgpyh") +region = Rect2(442, 34, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_q5c6k"] +atlas = ExtResource("1_hgpyh") +region = Rect2(442, 17, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_y2hb5"] +atlas = ExtResource("1_hgpyh") +region = Rect2(408, 34, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_5vvm1"] +atlas = ExtResource("1_hgpyh") +region = Rect2(391, 34, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_0merg"] +atlas = ExtResource("1_hgpyh") +region = Rect2(391, 51, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_jahmd"] +atlas = ExtResource("1_hgpyh") +region = Rect2(408, 51, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_jtnns"] +atlas = ExtResource("1_hgpyh") +region = Rect2(425, 51, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_qcj6w"] +atlas = ExtResource("1_hgpyh") +region = Rect2(442, 51, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_pdgau"] +atlas = ExtResource("1_hgpyh") +region = Rect2(442, 68, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_1k30j"] +atlas = ExtResource("1_hgpyh") +region = Rect2(425, 68, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_qmqog"] +atlas = ExtResource("1_hgpyh") +region = Rect2(408, 68, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_prs0y"] +atlas = ExtResource("1_hgpyh") +region = Rect2(391, 68, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_qv1on"] +atlas = ExtResource("1_hgpyh") +region = Rect2(391, 85, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_0ov37"] +atlas = ExtResource("1_hgpyh") +region = Rect2(408, 85, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_m1pfp"] +atlas = ExtResource("1_hgpyh") +region = Rect2(425, 85, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_1jb5b"] +atlas = ExtResource("1_hgpyh") +region = Rect2(442, 85, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_iyq01"] +atlas = ExtResource("1_hgpyh") +region = Rect2(442, 102, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_qpfpn"] +atlas = ExtResource("1_hgpyh") +region = Rect2(425, 102, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_6evyw"] +atlas = ExtResource("1_hgpyh") +region = Rect2(408, 102, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_cuap2"] +atlas = ExtResource("1_hgpyh") +region = Rect2(391, 102, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_b4c2f"] +atlas = ExtResource("1_hgpyh") +region = Rect2(391, 119, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_dvpvl"] +atlas = ExtResource("1_hgpyh") +region = Rect2(408, 119, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_gf8c1"] +atlas = ExtResource("1_hgpyh") +region = Rect2(425, 119, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_pbs5w"] +atlas = ExtResource("1_hgpyh") +region = Rect2(442, 119, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_7t4o5"] +atlas = ExtResource("1_hgpyh") +region = Rect2(442, 136, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_1lkcx"] +atlas = ExtResource("1_hgpyh") +region = Rect2(425, 136, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_6fub5"] +atlas = ExtResource("1_hgpyh") +region = Rect2(408, 136, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_3wg47"] +atlas = ExtResource("1_hgpyh") +region = Rect2(391, 136, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_l0rrp"] +atlas = ExtResource("1_hgpyh") +region = Rect2(391, 153, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_skhnf"] +atlas = ExtResource("1_hgpyh") +region = Rect2(391, 170, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_alkvx"] +atlas = ExtResource("1_hgpyh") +region = Rect2(408, 170, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_o5opq"] +atlas = ExtResource("1_hgpyh") +region = Rect2(425, 170, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_2rcer"] +atlas = ExtResource("1_hgpyh") +region = Rect2(442, 170, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_bv4qt"] +atlas = ExtResource("1_hgpyh") +region = Rect2(442, 153, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_0amuh"] +atlas = ExtResource("1_hgpyh") +region = Rect2(425, 153, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_fd0xu"] +atlas = ExtResource("1_hgpyh") +region = Rect2(408, 153, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_pkh51"] +atlas = ExtResource("1_hgpyh") +region = Rect2(408, 187, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_5srdt"] +atlas = ExtResource("1_hgpyh") +region = Rect2(391, 187, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_caihi"] +atlas = ExtResource("1_hgpyh") +region = Rect2(425, 187, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_h1ku1"] +atlas = ExtResource("1_hgpyh") +region = Rect2(442, 187, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_i4ovk"] +atlas = ExtResource("1_hgpyh") +region = Rect2(442, 204, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_yqh1o"] +atlas = ExtResource("1_hgpyh") +region = Rect2(425, 204, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_xpvdx"] +atlas = ExtResource("1_hgpyh") +region = Rect2(408, 204, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_y2dgk"] +atlas = ExtResource("1_hgpyh") +region = Rect2(391, 204, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_4cp2e"] +atlas = ExtResource("1_hgpyh") +region = Rect2(391, 221, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_gkacr"] +atlas = ExtResource("1_hgpyh") +region = Rect2(408, 221, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_8bkpn"] +atlas = ExtResource("1_hgpyh") +region = Rect2(425, 221, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_geh57"] +atlas = ExtResource("1_hgpyh") +region = Rect2(442, 221, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_vhmln"] +atlas = ExtResource("1_hgpyh") +region = Rect2(442, 238, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_phgsf"] +atlas = ExtResource("1_hgpyh") +region = Rect2(425, 238, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_8c8dd"] +atlas = ExtResource("1_hgpyh") +region = Rect2(408, 238, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_567f6"] +atlas = ExtResource("1_hgpyh") +region = Rect2(391, 238, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_sh42c"] +atlas = ExtResource("1_hgpyh") +region = Rect2(391, 255, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_qrrk2"] +atlas = ExtResource("1_hgpyh") +region = Rect2(391, 272, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_jpfxb"] +atlas = ExtResource("1_hgpyh") +region = Rect2(408, 272, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ltdu6"] +atlas = ExtResource("1_hgpyh") +region = Rect2(425, 255, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_rpj10"] +atlas = ExtResource("1_hgpyh") +region = Rect2(442, 255, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_bw0qi"] +atlas = ExtResource("1_hgpyh") +region = Rect2(408, 255, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_shyl4"] +atlas = ExtResource("1_hgpyh") +region = Rect2(425, 272, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_v5ygc"] +atlas = ExtResource("1_hgpyh") +region = Rect2(442, 272, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ft25m"] +atlas = ExtResource("1_hgpyh") +region = Rect2(442, 289, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_uijqx"] +atlas = ExtResource("1_hgpyh") +region = Rect2(425, 289, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_kbxvt"] +atlas = ExtResource("1_hgpyh") +region = Rect2(408, 289, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_sy06n"] +atlas = ExtResource("1_hgpyh") +region = Rect2(391, 289, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_v64vj"] +atlas = ExtResource("1_hgpyh") +region = Rect2(408, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_hog1p"] +atlas = ExtResource("1_hgpyh") +region = Rect2(408, 17, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_5yx1v"] +atlas = ExtResource("1_hgpyh") +region = Rect2(408, 34, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_gt2o7"] +atlas = ExtResource("1_hgpyh") +region = Rect2(391, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_k11yt"] +atlas = ExtResource("1_hgpyh") +region = Rect2(391, 17, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_lwxxd"] +atlas = ExtResource("1_hgpyh") +region = Rect2(391, 34, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_df2x8"] +atlas = ExtResource("1_hgpyh") +region = Rect2(442, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_243qs"] +atlas = ExtResource("1_hgpyh") +region = Rect2(442, 17, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_d7bi7"] +atlas = ExtResource("1_hgpyh") +region = Rect2(442, 34, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_4yov4"] +atlas = ExtResource("1_hgpyh") +region = Rect2(425, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_o1svm"] +atlas = ExtResource("1_hgpyh") +region = Rect2(425, 17, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_jnhj3"] +atlas = ExtResource("1_hgpyh") +region = Rect2(425, 34, 16, 16) + +[sub_resource type="SpriteFrames" id="SpriteFrames_7f253"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_15sed") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ladk0") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_iuf4a") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ulevp") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_jbdwb") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_kakeo") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_2itl1") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_uodik") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_w60h1") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_q5c6k") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_y2hb5") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_5vvm1") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_0merg") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_jahmd") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_jtnns") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_qcj6w") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_pdgau") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_1k30j") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_qmqog") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_prs0y") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_qv1on") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_0ov37") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_m1pfp") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_1jb5b") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_iyq01") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_qpfpn") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_6evyw") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_cuap2") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_b4c2f") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_dvpvl") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_gf8c1") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_pbs5w") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_7t4o5") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_1lkcx") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_6fub5") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_3wg47") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_l0rrp") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_skhnf") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_alkvx") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_o5opq") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_2rcer") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_bv4qt") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_0amuh") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_fd0xu") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_pkh51") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_5srdt") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_caihi") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_h1ku1") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_i4ovk") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_yqh1o") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_xpvdx") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_y2dgk") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_4cp2e") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_gkacr") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_8bkpn") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_geh57") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_vhmln") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_phgsf") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_8c8dd") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_567f6") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_sh42c") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_qrrk2") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_jpfxb") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ltdu6") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_rpj10") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_bw0qi") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_shyl4") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_v5ygc") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ft25m") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_uijqx") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_kbxvt") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_sy06n") +}], +"loop": true, +"name": &"default", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_v64vj") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_hog1p") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_5yx1v") +}], +"loop": true, +"name": &"down", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_gt2o7") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_k11yt") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_lwxxd") +}], +"loop": true, +"name": &"left", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_df2x8") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_243qs") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_d7bi7") +}], +"loop": true, +"name": &"right", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_4yov4") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_o1svm") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_jnhj3") +}], +"loop": true, +"name": &"up", +"speed": 5.0 +}] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_15sed"] +size = Vector2(16, 16) + +[node name="Unit" type="Node2D"] +texture_filter = 1 +script = ExtResource("1_15sed") + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +sprite_frames = SubResource("SpriteFrames_7f253") +animation = &"down" + +[node name="ReadyToSelectMarker" type="Sprite2D" parent="."] +position = Vector2(-0.225, -8) +scale = Vector2(0.5, 0.5) +texture = ExtResource("3_ladk0") + +[node name="SelectedMarker" type="Sprite2D" parent="."] +position = Vector2(-0.225, -8) +scale = Vector2(0.5, 0.5) +texture = ExtResource("4_iuf4a") + +[node name="Area2D" type="Area2D" parent="."] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] +shape = SubResource("RectangleShape2D_15sed") + +[connection signal="mouse_entered" from="Area2D" to="." method="_markUnit"] +[connection signal="mouse_exited" from="Area2D" to="." method="_unMarkUnit"]