extends Node

func _input(event):
	if event.type == 1 and not event.pressed:
		var key = event.scancode
		if key == KEY_ESCAPE:
			if global.final:
				get_tree().change_scene("res://scenes/main_menu.scn")
			elif global.game != null: 
				global.toogle_pause()
			else:
				get_tree().quit()
		elif key == KEY_F2:
			global.toogle_fullscreen()

func _ready():
	set_pause_mode(Node.PAUSE_MODE_PROCESS)
	set_process_input(true)