Proper firing logic handling
This commit is contained in:
parent
b58c740e06
commit
6a317d1913
12 changed files with 44 additions and 20 deletions
|
@ -24,6 +24,8 @@ func _process() -> void:
|
|||
if _fire():
|
||||
on_fire()
|
||||
|
||||
func _on_fire_end() -> void:
|
||||
fire_allowed.emit()
|
||||
|
||||
## Invoked when cooldown has ended
|
||||
func on_cooldown_timeout() -> void:
|
||||
|
|
|
@ -7,6 +7,9 @@ class_name BaseFireMode
|
|||
var barrel : Barrel
|
||||
var tree : SceneTree
|
||||
|
||||
## Emits when it's possible to request fire from outside
|
||||
signal fire_allowed
|
||||
|
||||
func _init() -> void:
|
||||
resource_local_to_scene = true
|
||||
|
||||
|
|
|
@ -26,3 +26,4 @@ func _on_fire_begin() -> void:
|
|||
## Invoked when cooldown has ended
|
||||
func on_cooldown_timeout() -> void:
|
||||
cooldown = false
|
||||
fire_allowed.emit()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue