Hangman Generator
Save Steve and reunite him with his family! A 2D Point-And-Click in-browser take on the classic Hangman game. Game was solo-developed in Unity with C# (Visual Studio) and featured artwork was drawn in Adobe Illustrator.
Role: Lead Game Designer / Game Programmer
Team Size: 1
Time frame: 1 Week
Engine: Unity (C#)
Play The Game
Design
Adobe Illustrator Artwork
Artwork used for the menu screens, win state screens, and the stickman in the main game were drawn using a trackpad in Adobe Illustrator. The goal of the project was to create a clone of a classic pre-existing game. With this, I wanted to use opportunities like the menu screens to add unique elements and story that would make the final product standout regardless.
Keeping a hand-drawn theme felt fitting for the game because of it's traditional nature on pen and paper. This also influenced the aesthetics of the itch.io publication, which, for example, uses a notebook-like backdrop pictured below. The design was also created in Adobe Illustrator.
Programming - C# with Visual Studio
How The Game Is Generating The Secret Word
In order to generate a word the game pulls from an array of strings. A major priority when choosing to go this route was so that the code was optimized for reusability. This way, the code is the exact same for comparing the guess regardless the length of the word, and a word can be added to the array any time, with only needing to add it at one location.
Comparing Player's Guess to Correct Word
The function pictured above is used to compare the letter guess (taken in as a string from the button press in Unity) to the guess stored in the array.
The code is using a "blank word" that is a list to display the word with the guesses. blankWord[] begins as an array of strings, set up in the SetUp function, containing a "_" for each letter in the secret word.
When the player makes a guess the selectedWord is checked to see if it contains the passed in letter. If it does, the "_" in blankWord[] corresponding with the index of the letter in selectedWord is replaced with the letter. The code also checks to see if the letter is present, whether upper or lower case, so that the first letter of the word can easily be displayed as upper case. Then, the display in Unity is updated and a method to compare the blankWord to the selectedWord is ran.
If the blankWord and the selectedWord become equal when blankWord is put ToString(), the player wins and the display message is shown.