I have created this hangman game project using "Python Programming language". I have used certain libraries like pygame and random. Basically we all know what the Hangman Game actually is Still I give a brief intro about this game, In this game there is a randomly generated word and the user tries to make guesses about the letters that the game can have. If the user guesses all the letters in a given word CORRECTLY, the user is the WINNER!. Otherwise the user loses the game.
First created a words.txt file that will be used by our program to parse through and then from that file a randomised word will be generated and stored in a dictionary then we will find the total length of the word and add len(word) number of dashes("-") then the GAME BEGINS!!
We have also initialized some amounts of fonts variables or some colours that we will use in our pygame window.
Now the user starts guessing the letters of the randomly generated word one by one the correct letters will fill up the blank spaces or the dashes and the wrong words will lead to formation of our hangman body.
If the user correctly guesses all the letters that are present in the randomly generated word and fill up all the black spaces or dashes("-"), the user is the WINNER!!
If the user makes 6 to 7 incorrect guesses and unable to correctly guess the word the user loses the game!
Thank You
Now Lets start Playing!! Can You guess it CORRECTLY??