Init Tambour
This commit is contained in:
parent
5cf819a4ba
commit
b5a9a54f94
15 changed files with 370 additions and 21 deletions
20
scripts/Instrument/onde.gd
Normal file
20
scripts/Instrument/onde.gd
Normal file
|
@ -0,0 +1,20 @@
|
|||
extends CharacterBody2D
|
||||
|
||||
var cooldown_timer = null
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if cooldown_timer == null:
|
||||
cooldown_timer = Timer.new()
|
||||
cooldown_timer.name = "OndeCooldownTimer"
|
||||
cooldown_timer.one_shot = true
|
||||
cooldown_timer.connect("timeout", Callable(self, "_on_cooldown_timeout"))
|
||||
get_tree().root.add_child(cooldown_timer)
|
||||
|
||||
# Démarrer le timer pour le cooldown
|
||||
func start_cooldown() -> void:
|
||||
cooldown_timer.start()
|
||||
|
||||
func _on_cooldown_timeout() -> void:
|
||||
cooldown_timer.queue_free()
|
||||
cooldown_timer = null
|
||||
queue_free()
|
Loading…
Add table
Add a link
Reference in a new issue