24 lines
522 B
GDScript
24 lines
522 B
GDScript
extends Control
|
|
|
|
const PLANET_RUN_SCENE = preload("res://stages/planet_run/planet_run.tscn")
|
|
|
|
func _ready():
|
|
visible = false
|
|
|
|
func win(planet : Planet):
|
|
visible = true
|
|
get_tree().paused = true
|
|
%WinTitle.text = tr("SCORE_%d") % str(roundi(planet.garden.get_score()))
|
|
|
|
func _on_restart_pressed():
|
|
GameInfo.game_data.reset_all()
|
|
get_tree().paused = false
|
|
get_tree().change_scene_to_packed(PLANET_RUN_SCENE)
|
|
|
|
func _on_quit_pressed():
|
|
get_tree().quit()
|
|
|
|
|
|
func _on_planet_day_limit_exceed(planet : Planet):
|
|
win(planet)
|