mirror of
https://github.com/PfandBoss/SemesterGameJam2022.git
synced 2025-11-12 04:16:12 +01:00
merge
This commit is contained in:
@@ -23,12 +23,14 @@ func interact(player):
|
||||
if currentStashValue < maxStashValue:
|
||||
currentStashValue += 1
|
||||
player.clearInventory()
|
||||
$AudioStreamPlayer2.play()
|
||||
return
|
||||
|
||||
if player.getResource() == 1:
|
||||
if currentPowderStashValue < maxPowderStashValue:
|
||||
currentPowderStashValue += 1
|
||||
player.clearInventory()
|
||||
$AudioStreamPlayer2.play()
|
||||
return
|
||||
return
|
||||
|
||||
@@ -38,6 +40,6 @@ func shoot():
|
||||
currentStashValue -= 1
|
||||
currentPowderStashValue = 0
|
||||
currentState = STATE.INACTIVE
|
||||
print("pew")
|
||||
$AudioStreamPlayer.play(0)
|
||||
return true
|
||||
return false
|
||||
|
||||
@@ -22,6 +22,7 @@ func interact(player):
|
||||
if (train.current_speed + refuelRate) <= maxSpeed:
|
||||
train.current_speed += refuelRate
|
||||
player.clearInventory()
|
||||
$AudioStreamPlayer.play()
|
||||
if train.current_speed >= maxSpeed:
|
||||
train.current_speed = maxSpeed
|
||||
|
||||
|
||||
@@ -8,18 +8,20 @@ enum TYPE {AMMO, GUNPOWDER, COAL}
|
||||
@export var currentType: TYPE
|
||||
|
||||
|
||||
|
||||
@export var audioClip : AudioStreamWAV
|
||||
#------------Methods-------------#
|
||||
func _ready():
|
||||
var root = get_tree().root.get_child(0)
|
||||
#root.ammo_pickup.connect(_on_signal_storing)
|
||||
maxStashValue = 10
|
||||
currentStashValue = 10
|
||||
$AudioStreamPlayer.stream = audioClip
|
||||
|
||||
func interact(player):
|
||||
if currentStashValue >= 1:
|
||||
currentStashValue -= 1
|
||||
player.fill_inventory(currentType)
|
||||
$AudioStreamPlayer.play()
|
||||
return
|
||||
|
||||
func _on_signal_storing():
|
||||
|
||||
Reference in New Issue
Block a user