Bare Medium

  • Home
  • About
  • Portfolio
  • Contact

Hangman Game

October 30, 2018 by admin

Image of lady sitting with laptop in her lap playing my hangman web app.

Visit Site

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.

Filed Under: development

About Me

I'm a freelance Wordpress developer located in Brea, CA. No job is too big or small. Find out more about me here.

Find Out

Start a Project

I would love to help with any upcoming projects that you might have. Give me a shout on the contact form and we can discuss it further.

Contact

Let’s Connect

Want to keep up with what's going on at the shop? Follow me across my Social Networks.
  • Email
  • Instagram
  • LinkedIn

© Copyright 2018 Bare Medium · All Rights Reserved · Powered by WordPress on Genesis Framework