0 votes

In the editor when the project is played and the main scene starts everything is fine. The play button works and loads the scene which contains the level. But when i decide to export the project the button just shows the click animation but nothing happens. this is my script that controls the main menu:
extends Control

onready var highscoreLabel = get_node("HighScore")

var file = File.new()

func _ready(): if !file.file_exists("user://highscore.dat"): file.open("user://highscore.dat", File.WRITE) file.close() print("creating save file") else: file.open("user://highscore.dat", File.READ) var content = file.get_as_text() highscoreLabel.set_text("highscore: " + content) print("reading save file")

func _on_Aloita_Peli_pressed(): get_tree().change_scene("res://Levels/Level.tscn")

func _on_Lopeta_Peli_pressed(): get_tree().quit()

Any help would be appreciated!

asked Jan 15 in Projects by Kirottu (14 points)


Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.