7-8-25 00:017-8-25 00:017-8-25 00:017-8-25 00:017-8-25 00:017-8-25

00:017-8-25 00:01
This commit is contained in:
2025-07-08 00:00:31 -04:00
parent cdf94c4bdf
commit 6171b8eda2
34 changed files with 558 additions and 158 deletions

10
Main.cs
View File

@@ -12,13 +12,14 @@ public partial class Main : Node
public override void _Ready()
{
NewGame();
//NewGame();
}
public void GameOver()
{
GetNode<Timer>("MobTimer").Stop();
GetNode<Timer>("ScoreTimer").Stop();
GetNode<Hud>("HUD").ShowGameOver();
}
public void NewGame()
@@ -30,12 +31,19 @@ public partial class Main : Node
player.Start(startPosition.Position);
GetNode<Timer>("StartTimer").Start();
var hud = GetNode<Hud>("HUD");
hud.UpdateScore(_score);
hud.ShowMessage("Get Ready!");
GetTree().CallGroup("mobs", Node.MethodName.QueueFree);
}
// We also specified this function name in PascalCase in the editor's connection window.
private void OnScoreTimerTimeout()
{
_score++;
GetNode<Hud>("HUD").UpdateScore(_score);
}
// We also specified this function name in PascalCase in the editor's connection window.