// Fill out your copyright notice in the Description page of Project Settings.
#include "BullCowCartridge.h"
void UBullCowCartridge::BeginPlay() // When the game starts
{
Super::BeginPlay();
// Welcoming the player
PrintLine(TEXT("Hi There! Welcome to the Bull Cow Game!"));
PrintLine(TEXT("Guess the 4 letter word!")); // Magic number remove!
PrintLine(TEXT("Press Enter to continue..."));
// Setting up game
HiddenWord = TEXT("cake"); // Set the HiddenWord
// Set lives
// Prompt player for guess
}
void UBullCowCartridge::OnInput(const FString& Input) // When the player hits enter
{
ClearScreen();
// Checking player guess
if (Input == HiddenWord)
{
PrintLine(TEXT("You win!"));
}
else
{
PrintLine(TEXT("You lose"));
}
// Check if isogram
// Check right number of characters
// Remove life
// If all lives lost, prompt for guess again
// Show lives left
// Else print game over and HiddenWord
// Prompt to play again, Press enter to play again?
// If yes, set hidden word and lives
// Else quit game
}```
2 Likes
Looking good!