16 lines
208 B
GDScript3
16 lines
208 B
GDScript3
|
extends Node
|
||
|
|
||
|
|
||
|
export(int) var max_health = 1
|
||
|
onready var health = max_health setget set_health
|
||
|
|
||
|
func set_health(v):
|
||
|
if v <= 0:
|
||
|
emit_signal("no_health")
|
||
|
health = 0
|
||
|
else:
|
||
|
health = v
|
||
|
|
||
|
|
||
|
signal no_health
|