fix: check for ghost before rendering field
This commit is contained in:
parent
eda62c7c6d
commit
2076219c8c
1 changed files with 4 additions and 3 deletions
7
Game.cpp
7
Game.cpp
|
@ -74,9 +74,6 @@ namespace game // Namespace = Scope with name and no features
|
|||
// Durchlaufe die Hauptschleife des Spiels
|
||||
while (true)
|
||||
{
|
||||
// Zeige dem Spieler das Spielfeld
|
||||
maze.render(player);
|
||||
|
||||
// Kontrolliere, ob der Spieler an einem Geist gestorben ist
|
||||
if (maze.was_player_killed_by_ghost(player))
|
||||
{
|
||||
|
@ -84,6 +81,10 @@ namespace game // Namespace = Scope with name and no features
|
|||
break;
|
||||
}
|
||||
|
||||
// Zeige dem Spieler das Spielfeld
|
||||
maze.render(player);
|
||||
|
||||
|
||||
// Kontrolliere, ob der Spieler schon das Ziel erreicht hat
|
||||
if (maze.is_player_at_goal(player))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue