Improved network communication

This commit is contained in:
2024-01-24 20:57:31 +01:00
parent 26c52a00b3
commit 2738895efe
49 changed files with 427 additions and 625 deletions

@ -0,0 +1,14 @@
class_name HealthComponent
extends Node
@export var max_health: float
var health: float
func _ready():
pass
func take_damage(attack: Attack):
health -= attack.damage
if health <= 0:
get_parent().queue_free()

@ -0,0 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://2bbycjulf00g"]
[ext_resource type="Script" path="res://character/health/HealthComponent.gd" id="1_403dm"]
[node name="HealthComponent" type="Node"]
script = ExtResource("1_403dm")