Overview
Learning outcomesβ
- Build a web-based game (Hangman) that utilizes a variety of concepts and technologies.
- Demonstrate ability to make network HTTP Requests using Fetch API.
- Demonstrate ability to create graphics using Canvas.
- Demonstrate ability to create forms to and handling user input.
- Demonstrate understanding of event-oriented programming.
Guidelines and Tipsβ
- Remember to review the comments made for you in the code.
- Make a habit of committing and pushing your code frequently to github.
- Make sure to meaningful commit messages that describe what you did.
- Make sure the automated tests and checks (if exists) continue to pass after you make changes.
- Don't forget to fill out the self assessment on the README file, and the feedback form at the end of the instructions.
Instructionsβ
For this assignment you will be building Hangman. Your goal is to build this game using HTML, CSS, JavaScript, and the concepts/techniques covered to-date to build the game completely.
Game processβ
The process of the game should be:
- Allow the user to specify the difficulty:
easy
- for words of length 3-5medium
- for words of length 6-9hard
- for words of length 10-15
- On difficulty selection, we'll make a HTTP Request to https://it3049c-hangman.fly.dev/ to get a word for the game.
- You'll need to specify the difficulty in the query string of your url.
- Hint: Donβt hard-code all three URLs. Instead, use string template-ing to populate the query string.
- It may take a few seconds to load initially.
- Show the word's length as underscores in place of letters which have not yet been guessed.
- for the word
BOOK
where the LettersO
, andK
have been guessed, this would look like_ O O K
- for the word
- Show a display/paragraph/span containing previously guessed letters to the user
Previously Guessed: C, E, N, L
- Show a display/Canvas drawing of the βHangmanβ a. use canvas API for the hangman drawing
- Allow user to input a letter to guess. with the following form validations.
- Alert the user if they enter a letter they have already guessed
- Alert the user if the provided input wasn't a letter
- Alert the user if they hit the submit without providing any input (length == 0)
- Alert the user if they provided more than one character.
- If the guessed letter is correct, show it in the proper place for the word display (the underscored placeholder) a. check if the word has completely been guessed and announce winner if so.
- If the guessed letter is incorrect, draw the next body part on the hangman (whatever order and number of lines/body parts you wish) a. check if all the body parts have been drawn to announce the game as lost.
- When the game is over, alert the user if they won or lost and give an option to reset the game
- For 1 Extra Credit point, use tha animate.css library to animate the Hangman Title.
Starter Filesβ
.
βββ resources
β βββ css
β β βββ styles.css <== Your additional styles
β βββ js
β β βββ Hangman.js <== Hangman Game Logic
β β βββ index.js <== DOM Manipulation and Event Listeners
β βββ vendor <== External Libraries, such as Bootstrap and jQuery
β βββ bootstrap.min.css
β βββ bootstrap.min.js
β βββ fontawesome.min.css
β βββ jquery-3.5.1.slim.min.js
β βββ popper.min.js
βββ index.html <== The index.html - Built for you.
βββ README.md <== Don't Forget the self-reflection evaluation
Gradingβ
- The application runs with no errors.
- The user is presented with 3 difficulties to select from.
- The application can send HTTP requests passing a difficulty level in the query string and able to parse the response.
- The application obscures the word with underscores of same length as the original word.
- The application alerts the user if an already guessed letter was guessed again.
- The application draws the hangman (stick man) on wrong guesses.
Extra Credit Opportunitiesβ
- Add CSS animation on failed and successful guesses to any of the DOM elements.