Skip to content

Instantly share code, notes, and snippets.

@brettchalupa
Created April 3, 2023 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brettchalupa/5d3d3b95dabf12907c855155816b8ae7 to your computer and use it in GitHub Desktop.
Save brettchalupa/5d3d3b95dabf12907c855155816b8ae7 to your computer and use it in GitHub Desktop.
Godot Timers Explained
extends Node2D
func _process(delta: float) -> void:
$TimeRemaining.text = "%s" % roundf($FlashTimer.time_left)
func _on_flash_timer_timeout() -> void:
toggle_icon_visibility()
func toggle_icon_visibility():
if $Icon.visible:
$Icon.hide()
else:
$Icon.show()
func _input(event: InputEvent) -> void:
if event.is_action_pressed("ui_accept"):
$FlashTimer.paused = !$FlashTimer.paused
# toggle_icon_visibility()
# $FlashTimer.start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment