Hang Man Name your file: final.py You will start by creating a hangman game. Create a file to hold a set of words When the game is launched, you will be picking a random word, from the file. Display...


Hang Man




  • Name your file: final.py

  • You will start by creating a hangman game.



  1. Create a file to hold a set of words

  2. When the game is launched, you will be picking a random word, from the file.

  3. Display _'s for each letter in the word

  4. When the user mouse clicks the screen:


    1. Ask them to enter a letter:

    2. If the letter is in the word, display it in the word, where the underscore was

    3. Otherwise, display a piece of the hangman.

    4. If all the pieces of the hangman are displayed, the user loses (Display a sad message)

    5. if the user guesses all the right letters before the whole hangman is displayed, they win (Display a happy message)


  5. Make sure to effectively use functions to make this program, as it is not trivial.


HangMan:
The hangman has 7 pieces:




  • head

  • body

  • left arm

  • right arm

  • left leg

  • right leg


Create a class for the hangman.




  • You will likely want attributes for x, y, width, and the number of pieces of the body currently showing

  • Then you will want a draw method.



Sample:


Beginning Screen:



hangman1



User clicks the screen:



hangman2




User entered a letter not in the word, and the hangman started to get built

hangman3



If they enter a letter in the word, all instances of that letter show up:

hangman4

Winning:

hangman5



When You lose:

hangman6

May 04, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here