summaryrefslogtreecommitdiff
path: root/unit
diff options
context:
space:
mode:
Diffstat (limited to 'unit')
-rw-r--r--unit/area_2d.gd5
-rw-r--r--unit/area_2d.gd.uid1
-rw-r--r--unit/unit.gd18
-rw-r--r--unit/unit.gd.uid1
-rw-r--r--unit/unit.tscn4
5 files changed, 28 insertions, 1 deletions
diff --git a/unit/area_2d.gd b/unit/area_2d.gd
new file mode 100644
index 0000000..15b6a72
--- /dev/null
+++ b/unit/area_2d.gd
@@ -0,0 +1,5 @@
+extends Area2D
+
+
+func get_entity() -> Unit:
+ return get_parent()
diff --git a/unit/area_2d.gd.uid b/unit/area_2d.gd.uid
new file mode 100644
index 0000000..7d11abc
--- /dev/null
+++ b/unit/area_2d.gd.uid
@@ -0,0 +1 @@
+uid://u5kpy6jybqon
diff --git a/unit/unit.gd b/unit/unit.gd
new file mode 100644
index 0000000..e0f9025
--- /dev/null
+++ b/unit/unit.gd
@@ -0,0 +1,18 @@
+class_name Unit
+extends Node2D
+
+
+@export var max_hp := 0
+@export var current_hp := 0
+
+@export var current_team: String
+
+
+# Called when the node enters the scene tree for the first time.
+func _ready() -> void:
+ pass # Replace with function body.
+
+
+# Called every frame. 'delta' is the elapsed time since the previous frame.
+func _process(_delta: float) -> void:
+ pass
diff --git a/unit/unit.gd.uid b/unit/unit.gd.uid
new file mode 100644
index 0000000..6e96e3b
--- /dev/null
+++ b/unit/unit.gd.uid
@@ -0,0 +1 @@
+uid://rbk7n3puwr3q
diff --git a/unit/unit.tscn b/unit/unit.tscn
index 9b152c1..39de6e6 100644
--- a/unit/unit.tscn
+++ b/unit/unit.tscn
@@ -1,12 +1,14 @@
-[gd_scene load_steps=3 format=3 uid="uid://dglv8ajgj4i4c"]
+[gd_scene load_steps=4 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"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_4xd6x"]
size = Vector2(8, 8)
[node name="Unit" type="Node2D"]
z_index = 2
+script = ExtResource("1_5uy8y")
[node name="Icon" type="Sprite2D" parent="."]
scale = Vector2(0.063, 0.063)