-
Notifications
You must be signed in to change notification settings - Fork 1
/
hud.gd
46 lines (30 loc) · 1.03 KB
/
hud.gd
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
35
36
37
38
39
40
41
42
43
44
45
46
extends Control
var input_states = preload("res://input_states.gd")
var enter = input_states.new("ui_accept")
var esc = input_states.new("ui_cancel")
func _ready():
# Called every time the node is added to the scene.
# Initialization here
set_process(true)
func _process(delta):
var cScore = get_parent().get_node("mouse").score
get_node("score").set_text(str(cScore))
if esc.check() == 3 and get_parent().get_node("mouse").death == false:
get_node("Popup").set_exclusive(true)
get_node("Popup").popup()
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
get_tree().set_pause(true)
# get_tree().set_pause(true)
# if enter.check() == 3:
# get_tree().set_pause(false)
# if esc.check() == 3:
# get_tree().change_scene("res://spash.scn")
func _on_continue_pressed():
get_tree().set_pause(false)
get_node("Popup").set_exclusive(false)
get_node("Popup").hide()
Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)
func _on_exit_pressed():
get_tree().set_pause(false)
get_tree().change_scene("res://spash.scn")
print("e")