RestartAdded
This commit is contained in:
parent
211eac278c
commit
4386e9db8b
3 changed files with 14 additions and 11 deletions
|
@ -23,7 +23,7 @@ internal class DeathGUI : AbstractGui
|
|||
Elements.Add(butMenu);
|
||||
butMenu.LeftButtonPressed += () =>
|
||||
{
|
||||
AppManager.Instance.ChangeGameState(GameState.Menu);
|
||||
AppManager.Instance.Restart("lvl");
|
||||
};
|
||||
foreach (var item in Elements)
|
||||
{
|
||||
|
|
|
@ -25,14 +25,15 @@ namespace DangerousD.GameCore.GameObjects.PlayerDeath
|
|||
|
||||
private void PlayDeath(string deathName)
|
||||
{
|
||||
if (GraphicsComponent.GetCurrentAnimation != "DeathFromZombie")
|
||||
{
|
||||
GraphicsComponent.StartAnimation("DeathFromZombie");
|
||||
}
|
||||
if (GraphicsComponent.GetCurrentAnimation != "DeathFromSilasHand")
|
||||
{
|
||||
GraphicsComponent.StartAnimation("DeathFromSilasHand");
|
||||
}
|
||||
//if (GraphicsComponent.GetCurrentAnimation != "DeathFromZombie")
|
||||
//{
|
||||
// GraphicsComponent.StartAnimation("DeathFromZombie");
|
||||
//}
|
||||
//if (GraphicsComponent.GetCurrentAnimation != "DeathFromSilasHand")
|
||||
//{
|
||||
// GraphicsComponent.StartAnimation("DeathFromSilasHand");
|
||||
//}
|
||||
GraphicsComponent.StartAnimation(deathName);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -208,7 +208,7 @@ namespace DangerousD.GameCore
|
|||
case GameState.Lobby:
|
||||
break;
|
||||
case GameState.Game:
|
||||
GameManager.mapManager.LoadLevel("lvl");
|
||||
GameManager.mapManager.LoadLevel(currentMap);
|
||||
GameManager.FindBorders();
|
||||
break;
|
||||
case GameState.Death:
|
||||
|
@ -326,7 +326,9 @@ namespace DangerousD.GameCore
|
|||
}
|
||||
public void Restart(string map)
|
||||
{
|
||||
|
||||
GameManager = new();
|
||||
ChangeGameState(GameState.Menu);
|
||||
currentMap = map;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue