mirror of
https://github.com/PfandBoss/SemesterGameJam2022.git
synced 2025-11-12 12:16:14 +01:00
idc
This commit is contained in:
7
Storage.tscn
Normal file
7
Storage.tscn
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
[gd_scene load_steps=2 format=3 uid="uid://1sr52olklfyy"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://scripts/Modules/Storage.gd" id="1_guwoh"]
|
||||||
|
|
||||||
|
[node name="Storage" type="Node"]
|
||||||
|
script = ExtResource("1_guwoh")
|
||||||
|
currentType = 0
|
||||||
@@ -9,15 +9,15 @@ enum TYPE {AMMO, GUNPOWDER, FUEL}
|
|||||||
#------------Methods-------------#
|
#------------Methods-------------#
|
||||||
func _ready():
|
func _ready():
|
||||||
var root = get_tree().root.get_child(0)
|
var root = get_tree().root.get_child(0)
|
||||||
root.shooting.connect(_on_signal_storing)
|
root.ammo_pickup.connect(_on_signal_storing)
|
||||||
maxStashValue = 5
|
maxStashValue = 5
|
||||||
currentStashValue = 0
|
currentStashValue = 0
|
||||||
func interact():
|
func interact():
|
||||||
if currentStashValue >= 1:
|
if currentStashValue >= 1:
|
||||||
currentStashValue -= 1
|
--currentStashValue
|
||||||
return
|
return
|
||||||
func _on_signal_storing():
|
func _on_signal_storing():
|
||||||
if currentStashValue < maxStashValue:
|
if currentStashValue < maxStashValue:
|
||||||
currentStashValue += 1
|
++currentStashValue
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user