gd: added input addon
This commit is contained in:
15
guide_examples/touch/godot_head.gd
Normal file
15
guide_examples/touch/godot_head.gd
Normal file
@ -0,0 +1,15 @@
|
||||
extends Node2D
|
||||
|
||||
@export var lifetime_seconds:float = 5.0
|
||||
var _remaining_time_seconds:float = 0
|
||||
|
||||
func _ready():
|
||||
_remaining_time_seconds = lifetime_seconds
|
||||
|
||||
func _process(delta:float) -> void:
|
||||
_remaining_time_seconds -= delta
|
||||
if _remaining_time_seconds <= 0:
|
||||
queue_free()
|
||||
return
|
||||
|
||||
modulate.a = _remaining_time_seconds / lifetime_seconds
|
Reference in New Issue
Block a user