Ententerminator 9de159accd escape button
2020-02-02 14:30:51 +01:00

28 lines
632 B
GDScript

extends Spatial
export(NodePath) var escPath
var _esc_button
var _esc_visible : bool = false
signal main_menu()
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
InGameState.set_player_count(2)
_esc_button = get_node(escPath) as Button
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta: float) -> void:
# pass
func _input(event):
if event is InputEventKey and event.pressed and event.scancode == KEY_ESCAPE:
_esc_visible = !(_esc_visible)
_esc_button.visible = _esc_visible
func _on_ESC_Menu_pressed():
emit_signal ("main_menu")