mirror of
https://github.com/creyD/ludum_dare_46.git
synced 2026-06-12 13:32:23 +02:00
Traps updated, Live and Collactables added
This commit is contained in:
28
src/Overlap/Stats/Stats.gd
Normal file
28
src/Overlap/Stats/Stats.gd
Normal file
@@ -0,0 +1,28 @@
|
||||
extends Node
|
||||
|
||||
export(int) var max_health := 1
|
||||
onready var health := max_health setget set_health
|
||||
|
||||
export(float) var max_speed := 125.0
|
||||
onready var speed := max_speed setget set_speed
|
||||
|
||||
signal no_health
|
||||
|
||||
func set_health(value):
|
||||
|
||||
if value > max_health:
|
||||
health = max_health
|
||||
else:
|
||||
health = value
|
||||
if health < 1:
|
||||
emit_signal("no_health")
|
||||
|
||||
func set_speed(value):
|
||||
if value > max_speed:
|
||||
speed = max_speed
|
||||
elif value<0.0:
|
||||
speed = 0.0
|
||||
else:
|
||||
speed = value
|
||||
|
||||
|
||||
Reference in New Issue
Block a user