From 218748f67a6a6b35efc4a732ad11426d0f528709 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Wed, 12 Feb 2025 20:05:59 +0100 Subject: next commit --- unit/unit.tscn | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'unit/unit.tscn') diff --git a/unit/unit.tscn b/unit/unit.tscn index 39de6e6..b69e717 100644 --- a/unit/unit.tscn +++ b/unit/unit.tscn @@ -1,7 +1,16 @@ -[gd_scene load_steps=4 format=3 uid="uid://dglv8ajgj4i4c"] +[gd_scene load_steps=7 format=3 uid="uid://dglv8ajgj4i4c"] [ext_resource type="Texture2D" uid="uid://blanietpri1be" path="res://icon.svg" id="1_0d47j"] [ext_resource type="Script" uid="uid://rbk7n3puwr3q" path="res://unit/unit.gd" id="1_5uy8y"] +[ext_resource type="Script" uid="uid://bs4wgt1curlf7" path="res://unit/unit_data.gd" id="2_japly"] +[ext_resource type="Script" uid="uid://drs01qvt6fnrx" path="res://area_2d.gd" id="3_hs7ws"] + +[sub_resource type="Resource" id="Resource_japly"] +script = ExtResource("2_japly") +health = 2 +attack = 2 +defense = 1 +metadata/_custom_type_script = "uid://bs4wgt1curlf7" [sub_resource type="RectangleShape2D" id="RectangleShape2D_4xd6x"] size = Vector2(8, 8) @@ -9,14 +18,23 @@ size = Vector2(8, 8) [node name="Unit" type="Node2D"] z_index = 2 script = ExtResource("1_5uy8y") +unit_data = SubResource("Resource_japly") [node name="Icon" type="Sprite2D" parent="."] scale = Vector2(0.063, 0.063) texture = ExtResource("1_0d47j") -[node name="Area2D" type="Area2D" parent="."] +[node name="Area2D" type="Area2D" parent="." node_paths=PackedStringArray("root_node")] collision_layer = 2 collision_mask = 0 +script = ExtResource("3_hs7ws") +root_node = NodePath("..") [node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] shape = SubResource("RectangleShape2D_4xd6x") + +[node name="Label" type="Label" parent="."] +offset_left = -5.0 +offset_right = 5.0 +offset_bottom = 23.0 +text = "0" -- cgit v1.2.3