mirror of
https://github.com/PfandBoss/SemesterGameJam2022.git
synced 2025-11-12 12:16:14 +01:00
delete gitignore files
This commit is contained in:
@@ -1,38 +0,0 @@
|
||||
extends Module
|
||||
|
||||
class_name Cannon
|
||||
|
||||
enum STATE {INACTIVE, RELOADING, SHOOTING}
|
||||
|
||||
var CAN_ENGAGE = true
|
||||
var DAMAGE = 5
|
||||
@onready var train = get_parent() as Train
|
||||
|
||||
#------------Methods-------------#
|
||||
func _ready():
|
||||
maxStashValue = 1
|
||||
currentStashValue = 1
|
||||
currentState = STATE.INACTIVE
|
||||
#TODO: FINISH
|
||||
func interact():
|
||||
if currentState == STATE.INACTIVE:
|
||||
#TODO: RELOADING
|
||||
if currentStashValue < maxStashValue:
|
||||
currentState = STATE.RELOADING
|
||||
currentStashValue += 1
|
||||
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 currentState == STATE.INACTIVE:
|
||||
currentState = STATE.SHOOTING
|
||||
currentStashValue -= 1
|
||||
currentState = STATE.INACTIVE
|
||||
return true
|
||||
return false
|
||||
Reference in New Issue
Block a user