A not so simple hangman game
- Customizable hangman's body parts with JSON
- Words, categories and dictionaries stored in a database, easily extendable
- Multi-language support
Pre-requisites
You need these libraries installed on your system in order to run the game:
Build
1 - Download source code
2 - Extract it to a folder
3 - In a shell, go to the folder where you extracted the source code and run:
$ make
Run
1 - Run the game:
$ ./bin/hangman
In order to customize hangman's body parts you need to edit the JSON file located at: ./assets/json/default-body.json, this file describes how hangman's body will be constructed.
- "texture": Texture file which contains the hangman's body part sprites. (Only one texture is allowed)
The default texture which has been used to take the screenshots below looks like this:
- "bodypart": A hangman's body part
- "order": The order of creation of the body part. A body part with order = 0 is needed because it will be the root node from which the other body parts will be created. The hangman's body parts are shown sorted by their order, starting at 0.
- "txCoords": Coordinates of the texture file that contains that body part.
- "joints": An array of joints.
1. "joint": Connection with another body part.
- "order": Body part order to connect to.
- "coords": Body part coordinates where to place the joint.
- "h-align": Horizontal alignment of the joined body part.
- "v-align": Vertical alignment of the joined body part.
The default hangman JSON looks like this:
{
"texture" : "assets/images/hangman.png",
"bodypart" :
{
"order" : 0,
"txCoords" : "0 0 28 28",
"joints" :
{
"joint" :
{
"order" : 1,
"coords" : "14 28",
"h-align" : "center",
"v-align" : "top"
}
}
},
"bodypart" :
{
"order" : 1,
"txCoords" : "0 28 5 50",
"joints" :
{
"joint" :
{
"order" : 2,
"coords" : "3 14",
"h-align" : "right",
"v-align" : "bottom"
},
"joint" :
{
"order" : 3,
"coords" : "3 14",
"h-align" : "left",
"v-align" : "bottom"
},
"joint" :
{
"order" : 4,
"coords" : "3 48",
"h-align" : "right",
"v-align" : "top"
},
"joint" :
{
"order" : 5,
"coords" : "3 48",
"h-align" : "left",
"v-align" : "top"
}
}
},
"bodypart" :
{
"order" : 2,
"txCoords" : "6 28 30 19"
},
"bodypart" :
{
"order" : 3,
"txCoords" : "35 28 30 19"
},
"bodypart" :
{
"order" : 4,
"txCoords" : "6 47 30 19"
},
"bodypart" :
{
"order" : 5,
"txCoords" : "35 47 30 19"
}
}
The database utility allows the player to extend the word, category and dictionary bases. It can read files that contains new words, categories and dictionaries and store them in the database.
NOTE: The database utility is under development. Usage information will be added at completion.
NOTE: The screenshots were taken from the current development state. The final game will not look like this.