mirror of
https://github.com/PfandBoss/SemesterGameJam2022.git
synced 2025-11-12 04:16:12 +01:00
Merge branch 'main' of github.com:PfandBoss/SemesterGameJam2022
This commit is contained in:
@@ -6,4 +6,4 @@ class_name Bin
|
||||
|
||||
#------------Methods-------------#
|
||||
func interact(player):
|
||||
player.inventory = 0
|
||||
player.clearInventory()
|
||||
|
||||
@@ -22,19 +22,17 @@ func interact(player):
|
||||
if player.getResource() == 0:
|
||||
if currentStashValue < maxStashValue:
|
||||
currentStashValue += 1
|
||||
player.clearInventory()
|
||||
return
|
||||
return
|
||||
|
||||
if player.getResource() == 1:
|
||||
if currentPowderStashValue < maxPowderStashValue:
|
||||
currentPowderStashValue += 1
|
||||
player.clearInventory()
|
||||
return
|
||||
return
|
||||
|
||||
func shoot():
|
||||
if not CAN_ENGAGE:
|
||||
return false
|
||||
CAN_ENGAGE = false
|
||||
create_tween().tween_callback(func(): CAN_ENGAGE = true).set_delay(2)
|
||||
if currentStashValue >= 1 and currentPowderStashValue >= 1 and currentState == STATE.INACTIVE:
|
||||
currentState = STATE.SHOOTING
|
||||
currentStashValue -= 1
|
||||
|
||||
@@ -16,18 +16,24 @@ func _ready():
|
||||
currentState = STATE.RUNNING
|
||||
#TODO: FINISH
|
||||
func interact(player):
|
||||
if player.getResource() != 2:
|
||||
return
|
||||
if currentState == STATE.RUNNING:
|
||||
if (train.current_speed + refuelRate) <= maxSpeed:
|
||||
train.current_speed += refuelRate
|
||||
player.clearInventory()
|
||||
if train.current_speed >= maxSpeed:
|
||||
train.current_speed = maxSpeed
|
||||
|
||||
return
|
||||
#TODO: Repair Train
|
||||
currentState = STATE.RUNNING
|
||||
|
||||
#
|
||||
|
||||
|
||||
|
||||
func _process(delta):
|
||||
if not train.is_dead():
|
||||
train.current_speed -= 0.1 * delta
|
||||
print(train.current_speed)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -34,9 +34,9 @@ func _set_currentStashValue(newValue):
|
||||
func _get_currentStashValue():
|
||||
return currentStashValue
|
||||
func _set_maxStashValue(newValue):
|
||||
currentStashValue = newValue
|
||||
maxStashValue = newValue
|
||||
func _get_maxStashValue():
|
||||
return currentStashValue
|
||||
return maxStashValue
|
||||
func _set_level(newValue):
|
||||
level = newValue
|
||||
func _get_level():
|
||||
|
||||
Reference in New Issue
Block a user