Saturday, March 10, 2012

Hangman in Java



    We all have played  Hangman at some point of time in our lives. This is a basic implementation of Hangman game in Java using Canvas. In this implementation, the word to guess is chosen randomly from a file. Hangman diagram is represented by a series of images. Each time player makes a false guess a new image is loaded containing one more element of the hangman than in the previous image. Images are loaded using Java Image I/O API. Rest of the logic can be understood by reading the code and comments. The entire code and required resources can be downloaded from here. Also, I have uploaded the source file on pastebin for quick reference.

Happy Coding! 


Screenshot

No comments:

Post a Comment