When I compile the code in Unreal, this is the error in the logs.
This is my full code:
#include “BullCowCartridge.h”
void UBullCowCartridge::BeginPlay() // When the game starts
{
Super::BeginPlay();
InitGame();
PrintLine(TEXT("the Hidden Word is: %s"), *HiddenWord); // debug messages
}
void UBullCowCartridge::OnInput(const FString& Input) // When the player hits enter
{
// if the game is over than do ClearScreen() and Initgame() the game
// else checking PlayerGuess
if (bGameOver)
{
ClearScreen();
InitGame();
}
else
{
if (Input == HiddenWord)
{
PrintLine(TEXT("You have won!"));
bGameOver = true;
}
else
{
if (Input.Len() != HiddenWord.Len())
{
PrintLine(TEXT("oooo, that's too many or too little words dumbass, try again"));
}
PrintLine(TEXT("You're trash kid, go home!"));
bGameOver = true;
}
// Check if isogram
// prompt to guess again
// Check right number of characters
// prompt to guess again
// Remove Life
// Check if Lives > 0
// If yes GuessAgain
// show lives left
// if no show gameover and HiddenWord?
// prompt to play again, press enter to play again?
// check user input
// PlayAgain or Quit
}
void UBullCowCartridge::InitGame()
{
// welcoming the player
PrintLine(TEXT("Welcome to Ezra's bullcow game!"));
PrintLine(TEXT("guess the %i letter word."), HiddenWord.Len());
PrintLine(TEXT("type in your guess and press enter to"));
PrintLine(TEXT("continue...")); // prompt player for guess
HiddenWord = TEXT("cakes");
Lives = 5;
bGameOver = false;
}