Improved network communication
This commit is contained in:
client
server
stresstest
tools/server
14
client/character/health/HealthComponent.gd
Normal file
14
client/character/health/HealthComponent.gd
Normal file
@ -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()
|
6
client/character/health/HealthComponent.tscn
Normal file
6
client/character/health/HealthComponent.tscn
Normal file
@ -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")
|
Reference in New Issue
Block a user