mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-11 10:55:55 +00:00
Main Menu and Game Over
This commit is contained in:
parent
360b4dfe6a
commit
9b7a426deb
5 changed files with 187 additions and 14 deletions
46
Scripts/MainMenu.cs
Normal file
46
Scripts/MainMenu.cs
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
using Godot;
|
||||
using System;
|
||||
|
||||
public partial class MainMenu : Control
|
||||
{
|
||||
|
||||
[Export]
|
||||
public PackedScene GameScene { get; set; }
|
||||
|
||||
[Export]
|
||||
public PackedScene MainMenuScene { get; set; }
|
||||
|
||||
// Called when the node enters the scene tree for the first time.
|
||||
public override void _Ready()
|
||||
{
|
||||
}
|
||||
|
||||
// Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
}
|
||||
|
||||
private void _on_start_button_pressed()
|
||||
{
|
||||
if (GameScene != null) {
|
||||
GetTree().ChangeSceneToPacked(GameScene);
|
||||
}
|
||||
}
|
||||
|
||||
private void _on_debug_button_pressed()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void _on_mainmenu_button_pressed()
|
||||
{
|
||||
if (MainMenuScene != null) {
|
||||
GetTree().ChangeSceneToPacked(MainMenuScene);
|
||||
}
|
||||
}
|
||||
|
||||
private void _on_exit_button_pressed()
|
||||
{
|
||||
GetTree().Quit();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue