func _ready():
timer.connect("timeout", self, "_on_timer_timeout")
Добавьте этот код в функцию _ready(), чтобы автоматически подключить сигнал, и тогда функция _on_timer_timeout() будет вызвана после истечения времени таймера. extends Node
var score = 0
@onready var nMidWorld = $"../TileMapN1"
@onready var label = $"../Labels/Label3"
@onready var timer = $Timer
func _ready():
# Подключаем сигнал timeout к функции _on_timer_timeout
timer.connect("timeout", self, "_on_timer_timeout")
func add_pointR():
score += 1
func add_pointY():
score += 1
func add_pointB():
score += 1
func _process(delta: float) -> void:
if score == 1:
pass
elif score == 2:
pass
elif score == 3:
timer.start()
func _on_timer_timeout() -> void:
print("It's Working!")
label.z_index = -100
nMidWorld.position.x = 0
extends Node
var score = 0
@onready var nMidWorld = $"../TileMap"
@onready var label = $"../Label"
@onready var timer = Timer
func _ready():
# Создаём таймер
timer = Timer.new()
add_child(timer)
# Подключаем сигнал
timer.timeout.connect(_on_timer_timeout)
func add_pointA():
score += 1
func add_pointY():
score += 1
func add_pointB():
score += 1
func _process(delta: float) -> void:
if score == 1:
pass
elif score == 2:
pass
elif score == 3:
timer.start()
func _on_timer_timeout() -> void:
print("It's Working!")
label.z_index = -100
nMidWorld.position.x = 0