Technologies used: HTML5, CSS, JavaScript, Canvas
This is my adaptation of the classic game, Hangman. For this project, I relied heavily on vanilla JavaScript for the logic. This game starts out by asking Player 1 to enter in the word they would like their opponent to guess. Once a valid response is entered, Player 2 gets chances to guess what the word is by entering one letter at a time. If Player 2 guesses the wrong letter, then a body part of Hangman is drawn on the board. This equates to 6 chances for Player 2 to guess the incorrect letter. Player 2 also gets 1 chance to guess the entire word, but if it is incorrect then the game is over. Likewise, once all guesses are used then the game is over. Player 2 wins by either guessing the correct word or guessing letters until the correct word is revealed.
This project taught me how to handle form validation. This included displaying an error if non-alpha characters were entered or more than one character was entered for a guess (excluding guessing the entire word). This project also taught me how to dynamically generate HTML elements based on user input. Finally, I was able to learn how to use the HTML5 canvas element to draw the Hangman figure.