mirror of
https://github.com/creyD/ludum_dare_46.git
synced 2026-06-11 21:22:22 +02:00
Stats script introduced
This commit is contained in:
11
src/Overlap/Stats.gd
Normal file
11
src/Overlap/Stats.gd
Normal 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
6
src/Overlap/Stats.tscn
Normal 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 )
|
||||
Reference in New Issue
Block a user