Standalone
You can download the game(~23.3MB) from my site. Tried uploading it here, it fails at 50%. Or checkout the WebGL version of it here or here. I noticed having the Exit
(Application.Quit button) breaks the game on WebGL, so I replaced that version with an About
button instead. Feedback is always appreciated.
Mobile Version
I had earlier designed a mobile look for the game, but later into the lectures I realized @Rick_Davidson wanted us to build a standalone. That version looked so awful on desktop but a bit neat viewed on mobile.
Some tweaks.
I figured the game looked pointless on continuing to click Younger
or Older
buttons when the player was “lying” about their guess which was already guessed correctly. So I tweaked our Number Guessing script to generate random feedback text. See code below.
using TMPro;
using UnityEngine;
public class NumberGuess : MonoBehaviour {
[SerializeField] private int minGuess;
[SerializeField] private int maxGuess;
[SerializeField] TextMeshProUGUI ageDisplay;
[SerializeField] TextMeshProUGUI feedbackText; // Text to be randomised.
int guess;
int guessCount;
void StartGame() {
NextGuess();
}
void NextGuess() {
if (maxGuess >= minGuess) {
guess = Random.Range(minGuess, maxGuess + 1);
} else {
string[] msg = { "Alright", "Mheen", "Darling", "Well", "See!", "Woo", "Please" };
string[] msgLong = { "Slow Down", "Serioulsy!!", "No way! Arrgg", "Realllllly", "Come on!", "Please be nice", "Never wrong! Am sure" };
int msgSpawn = Random.Range(0, msg.Length);
if (guessCount % 2 == 0) {
feedbackText.text = ("Wo, Wooo, " + msgLong[msgSpawn] + "! \n It should be ...");
} else {
feedbackText.text = (msg[msgSpawn] + " told you already! \n You are thinking \n that's it!");
}
guessCount += 1;
}
ageDisplay.text = guess.ToString();
}
public void OnPressOlder() {
minGuess = guess + 1;
NextGuess();
}
public void OnPressYounger() {
maxGuess = guess - 1;
NextGuess();
}
void Start() {
StartGame();
}
}
#PS: I tested the Standalone Game Windows 8 x86 PC and it wasn’t working, but rocks on Windows 10 x64. Hoping to see such compatibility fixes along the course on publishing.
Thanks for reading through.
Be blessed.