Add initial game code
This commit is contained in:
parent
f80a60e208
commit
1383997ebf
55 changed files with 1355 additions and 0 deletions
28
scripts/MainMenu/MainMenuController.cs
Normal file
28
scripts/MainMenu/MainMenuController.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
using Godot;
|
||||
|
||||
public partial class MainMenuController : Node
|
||||
{
|
||||
public Button StartGameButton { get; private set; }
|
||||
public Button ExitGameButton { get; private set; }
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
base._Ready();
|
||||
|
||||
this.StartGameButton = GetNode<Button>("CenterContainer/VBoxContainer/StartGameButton");
|
||||
this.ExitGameButton = GetNode<Button>("CenterContainer/VBoxContainer/ExitGameButton");
|
||||
|
||||
this.StartGameButton.Pressed += OnStartGame;
|
||||
this.ExitGameButton.Pressed += OnExitGame;
|
||||
}
|
||||
|
||||
public void OnStartGame()
|
||||
{
|
||||
GetTree().ChangeSceneToFile("res://scenes/game.tscn");
|
||||
}
|
||||
|
||||
public void OnExitGame()
|
||||
{
|
||||
GetTree().Quit();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue