mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 10:35:34 +00:00
Possession handling
This commit is contained in:
parent
681510d75c
commit
31ffe6156e
9 changed files with 305 additions and 22 deletions
|
|
@ -96,7 +96,7 @@ public partial class GameManager : Node2D
|
|||
// Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
if (Input.IsActionJustPressed("pause"))
|
||||
if (GameState is GameState.Playing && Input.IsActionJustPressed("pause"))
|
||||
{
|
||||
TogglePause();
|
||||
}
|
||||
|
|
@ -288,6 +288,19 @@ public partial class GameManager : Node2D
|
|||
}
|
||||
}
|
||||
|
||||
public GameState ToggleControlMode() {
|
||||
if (GameState is GameState.Playing)
|
||||
{
|
||||
ChangeState(GameState.Controlling);
|
||||
}
|
||||
else if (GameState is GameState.Controlling)
|
||||
{
|
||||
ChangeState(GameState.Playing);
|
||||
}
|
||||
|
||||
return GameState;
|
||||
}
|
||||
|
||||
public void ChangeState(GameState state)
|
||||
{
|
||||
if (state == GameState) return;
|
||||
|
|
@ -302,5 +315,6 @@ public enum GameState
|
|||
Menu,
|
||||
Paused,
|
||||
Playing,
|
||||
Dialogue
|
||||
Dialogue,
|
||||
Controlling
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue