giraffe/scripts/World.gd

22 lines
427 B
GDScript
Raw Normal View History

extends Node2D
var score = 0
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
func _on_Tree_eaten():
score += 1
func _on_Tree_death():
get_tree().paused = true
$DeathScreen/Box/Score.text = "Score: " + str(score)
$DeathScreen.popup_centered()