platformer-game-test/src/Menu/MainMenu.gd

22 lines
564 B
GDScript

extends Node2D
func _ready() -> void:
$CanvasLayer/Control/VBoxContainer/NewGameBtn.grab_focus()
func _on_ExitGameBtn_pressed() -> void:
get_tree().quit(0)
pass # Replace with function body.
func _on_ControlsBtn_pressed() -> void:
print("Not working yet")
pass # Replace with function body.
func _on_NewGameBtn_pressed() -> void:
GameState.start_new_game(true)
queue_free()
func _input(event: InputEvent) -> void:
if Input.is_action_just_pressed("ui_up") or Input.is_action_just_pressed("ui_down"):
AudioManager.play_sfx(AudioManager.Sfx.UI_MOVE)