Skip to main content

Graphical Hangman - v1

This is a graphical hangman game I'm building to get used to PyGame and to become a better coder.

GRAPHICAL HANGMAN v1 9 - 17 - 2018 UPDATE: I won't be updating this so if someone wants to have at it and make it their own they are more than welcome. It isn't set up for any kind of packaging at all and I assume that if someone wants to play it they'll install python and pygame and use these resources to run it themselves. I'm just not advanced enough to package a game myself yet. This game is a simple Hangman game made with Python, the pygame library, and a few free tools for making art and sound. For the art I mostly used Piskel which is an easy way to make pixel art for sprites. For the sound I used a mixture of bfxr and Bosca Ceoil, both of which are free and easy to use. Notes on tinkering with my code: It's way overly complicated and someone willing to take the time and just refactor it would have a neat little something on their hands, although it might just be easier to make one from scratch. I simply did not use good coding practices in most of this code, but it works and that might be useful to someone. Enjoy! MANDATORY DISCLAIMER: This is just a game of hangman. It is not controversial. If anyone finds it controversial please let me know and I will immediately take it down. It seemed like a cool first thing to code to completion with pygame.


v1 Complete: Finished v1, which means it is no longer tantalizing the player with menu options that don't work. The options menu is fully functional and all of the menus are now clickable. I chose not to do a high score system this time, but there is a win streak counter. It will keep track of your win streak until you lose, at which point it is reset. Graphics and Sound are still very basic and there's definitely a better way to do the background sprite but I went with what I was comfortable with for this version. Sprites were made with GIMP and Piskel, sound was made with bfxr and Bosca Ceoil. I re-wrote the game loop and organized the classes differently than in v0, and while they are still probably not ideal they are a lot better than before. I'm still working on modular organization but this one doesn't have as much spaghetti as I feared it would. Still has a lot though. The update function is monstrous. An area in need of improvement is the way I handled the background sprite. I could not get pygame.transform() to do what I wanted with scaling, so I had to re-size the spritesheet manually and just use it that way. The animation is definitely a work in progress. They definitely need work, and should probably be moved to the built in sprite classes. This project needs to be refactored very badly, and it couldn't hurt to improve the art and sound, but other than that the little game is "feature complete." It is trivial to add more words and categories at this point and is a little intense when you can't figure out what last letter and your little hangman is on his last penalty, and your streak is on the line. For a simple project I'm pretty happy with this, hopefully someone else finds some use for it too.


Home Page


Graphical Hangman v0 — 19 Aug, 2018

Graphical Hangman v1 — 25 Aug, 2018

Graphical Hangman updated — 22 Sep, 2018 account Comments