Main menu, ZX Spectrum-like font, Death screen, Fixed typo, Game Manager
This commit is contained in:
parent
602df1ed1d
commit
b0caf99373
24 changed files with 497 additions and 17 deletions
29
scripts/Menu.cs
Normal file
29
scripts/Menu.cs
Normal file
|
@ -0,0 +1,29 @@
|
|||
using Godot;
|
||||
|
||||
public partial class Menu : Node2D
|
||||
{
|
||||
private Timer _timer;
|
||||
private AudioStreamPlayer2D _thunderclap;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
_timer = (Timer)FindChild("Timer");
|
||||
_thunderclap = (AudioStreamPlayer2D)FindChild("Thunderclap");
|
||||
|
||||
GameManager.IsPlaying = false;
|
||||
}
|
||||
|
||||
public override void _Input(InputEvent @event)
|
||||
{
|
||||
if (@event.IsActionPressed("ui_confirm") && _timer.IsStopped())
|
||||
{
|
||||
_thunderclap.Play();
|
||||
_timer.Start();
|
||||
}
|
||||
}
|
||||
|
||||
public void ChangeScene()
|
||||
{
|
||||
GetTree().ChangeSceneToFile("res://scenes/main_scene.tscn");
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue