Stats script introduced

This commit is contained in:
Jan Schuffenhauer
2020-04-18 16:19:45 +02:00
parent 7a22b9e0ec
commit 40ea76cc7c
2 changed files with 17 additions and 0 deletions

11
src/Overlap/Stats.gd Normal file
View File

@@ -0,0 +1,11 @@
extends Node
export(int) var max_health := 1
onready var health := max_health setget set_health
signal no_health
func set_health(value):
health = value
if health < 1:
emit_signal("no_health")

6
src/Overlap/Stats.tscn Normal file
View File

@@ -0,0 +1,6 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://Overlap/Stats.gd" type="Script" id=1]
[node name="Stats" type="Node"]
script = ExtResource( 1 )