My Game Loop

Here’s my game loop - I removed the part about matching the length of the word.

    if (bGameOver) 
    {
        ClearScreen();
        SetupGame();
    }
    else //check Player guess
    {
        if (Input == HiddenWord)
        {
            PrintLine(TEXT("Congratulations, you WIN!"));
            EndGame();
        }
        else 
        {
            PrintLine(TEXT("Wrong answer, you lose a life!"));
            PrintLine(TEXT("You now have %i lives left."), --Lives);

            if (Lives == 0)
            {
                PrintLine(TEXT("You have lost all your lives"));
                PrintLine(TEXT("-- GAME OVER --"));
                EndGame();
            }
        }
1 Like

Good game loop!

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms