My code 😊

void UBullCowCartridge::OnInput(const FString& Input) // When the player hits enter
{
 if (bGameOver)
 {
  ClearScreen();
  SetupGame();
 }
else
 {
   if(Input == HiddenWord)
   {
    PrintLine(TEXT("You Win"));
    EndGame();
   }
   else
    {
        if (Input.Len() != HiddenWord.Len())
        {
         PrintLine(TEXT("THe Hidden Word not %i Characters "),Input.Len());
         PrintLine(TEXT("Try Again with %i Characters "),HiddenWord.Len());
         
         
        }
        else
        {
          -- Lives;
          if (Lives>0)
          {
            PrintLine(TEXT("Wrong Answer"));
            PrintLine(TEXT("You lost a life \n You have now %i "),Lives); 
           
          }
          else
          {
            PrintLine(TEXT("Wrong Answer")); 
            PrintLine(TEXT("You lost game"));
            EndGame();
          }
          
        }
    }
 }
   
}

Privacy & Terms