mirror of
https://github.com/PfandBoss/SemesterGameJam2022.git
synced 2025-11-12 04:16:12 +01:00
Merge branch 'main' of https://github.com/PfandBoss/SemesterGameJam2022
This commit is contained in:
23
scripts/Modules/Storage.gd
Normal file
23
scripts/Modules/Storage.gd
Normal file
@@ -0,0 +1,23 @@
|
||||
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.shooting.connect(_on_signal_storing)
|
||||
maxStashValue = 5
|
||||
currentStashValue = 0
|
||||
func interact():
|
||||
if currentStashValue >= 1:
|
||||
currentStashValue -= 1
|
||||
return
|
||||
func _on_signal_storing():
|
||||
if currentStashValue < maxStashValue:
|
||||
currentStashValue += 1
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user