mirror of
https://github.com/PfandBoss/SemesterGameJam2022.git
synced 2025-11-12 04:16:12 +01:00
Changes on Cannon.gd
This commit is contained in:
@@ -4,6 +4,8 @@ class_name Cannon
|
||||
|
||||
enum STATE {INACTIVE, RELOADING, SHOOTING}
|
||||
|
||||
var CAN_ENGAGE = true
|
||||
|
||||
#------------Methods-------------#
|
||||
func _ready():
|
||||
var root = get_tree().root.get_child(0)
|
||||
@@ -23,10 +25,14 @@ func interact():
|
||||
return
|
||||
|
||||
func _on_signal_shooting():
|
||||
print("hit")
|
||||
if not CAN_ENGAGE:
|
||||
return
|
||||
CAN_ENGAGE = false
|
||||
create_tween().tween_callback(func(): CAN_ENGAGE = true).set_delay(2)
|
||||
|
||||
if currentStashValue >= 1 and currentState == STATE.INACTIVE:
|
||||
currentState = STATE.SHOOTING
|
||||
currentStashValue -= 1
|
||||
#TODO: SHOOTING
|
||||
print("hit")
|
||||
currentState = STATE.INACTIVE
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user