-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathending.gd
More file actions
34 lines (23 loc) · 1.04 KB
/
ending.gd
File metadata and controls
34 lines (23 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
extends Control
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
$write_file_button.text = "Write File (%s)" % Data.file_name
$average_speed.text = "Average Speed: %ss" % Data.player_data.get("average_time")
$correct_questions.text = "Correct Questions: %s/%s" % [Data.player_data.get("correct_count"),Data.question_count]
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
#var file = FileAccess.open("user://last.json", FileAccess.WRITE)
#var json_string = JSON.stringify(temp)
#file.store_string(json_string)
#file.close()
#func _on_button_pressed() -> void:
func _on_write_file_button_pressed() -> void:
var file = FileAccess.open("user://%s"%Data.file_name, FileAccess.WRITE)
var json_string = JSON.stringify(Data.player_data)
file.store_string(json_string)
file.close()
func _on_restart_button_pressed() -> void:
Data.player_data = {}
get_tree().change_scene_to_file("res://intro_scene.tscn")