mirror of
https://github.com/PfandBoss/SemesterGameJam2022.git
synced 2025-11-12 12:16:14 +01:00
Blub
This commit is contained in:
19
Cannon.gd
19
Cannon.gd
@@ -2,10 +2,23 @@ extends Module
|
|||||||
|
|
||||||
class_name Cannon
|
class_name Cannon
|
||||||
|
|
||||||
|
enum STATE {INACTIVE, RELOADING, SHOOTING}
|
||||||
|
|
||||||
#------------Methods-------------#
|
#------------Methods-------------#
|
||||||
|
func _ready():
|
||||||
|
var root = get_tree().root.get_child(0)
|
||||||
|
root.timeout.connect("shooting",self,"_on_signal_shooting")
|
||||||
|
maxStashValue = 1
|
||||||
|
currentStashValue = 0
|
||||||
|
currentState = STATE.INAKTIVE
|
||||||
#TODO: FINISH
|
#TODO: FINISH
|
||||||
func interact():
|
func interact():
|
||||||
|
if currentState == STATE.INACTIVE:
|
||||||
|
if currentStashValue < maxStashValue:
|
||||||
|
currentState = STATE.RELOADING
|
||||||
|
currentStashValue = maxStashValue
|
||||||
|
return
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
func _on_signal_shooting():
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ var currentState = null : set = _set_state, get = _get_state
|
|||||||
var level = 0 : set = _set_level, get = _get_level
|
var level = 0 : set = _set_level, get = _get_level
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
enum MODULE_TYPE {CANNON, STEERING, ENGINE, STORAGE}
|
enum MODULE_TYPE {CANNON, STEERING, ENGINE, STORAGE}
|
||||||
|
|
||||||
|
|
||||||
@@ -22,6 +24,8 @@ func interact():
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
emit_signal("MODULE")
|
||||||
|
|
||||||
|
|
||||||
#-----------Setter and Getter---------------#
|
#-----------Setter and Getter---------------#
|
||||||
|
|||||||
Reference in New Issue
Block a user