Files
SemesterGameJam2022/scripts/Modules/Storage.gd
PfandBoss 701f0bfee9 idc
2022-12-10 03:18:55 +01:00

24 lines
455 B
GDScript

extends Module
class_name Storage
enum TYPE {AMMO, GUNPOWDER, FUEL}
@export var currentType: TYPE
#------------Methods-------------#
func _ready():
var root = get_tree().root.get_child(0)
root.ammo_pickup.connect(_on_signal_storing)
maxStashValue = 5
currentStashValue = 0
func interact():
if currentStashValue >= 1:
--currentStashValue
return
func _on_signal_storing():
if currentStashValue < maxStashValue:
++currentStashValue
return