A modern desktop Hangman game built with C++ and Raylib, featuring multiple categories and a clean graphical interface.
-
Multiple Categories: Choose from 5 different word categories:
- Marvel Characters
- Movies
- Books
- Palindromes
- Countries
-
Visual Hangman Art: Progressive hangman drawings that update with each wrong guess
-
Interactive Keyboard: Click on letters or use your physical keyboard to make guesses
-
Score Tracking: Keep track of wins and losses throughout your gaming session
-
Smooth Gameplay: 60 FPS performance with responsive controls
-
Game Statistics: View your performance at the end of each game
The game features a colorful interface with:
- Category selection screen
- Interactive word display with letter chips
- On-screen keyboard with visual feedback
- Progressive hangman artwork
- Win/loss statistics
- Install a C++ compiler (e.g., GCC or MinGW for Windows).
- Install Raylib (a simple and easy-to-use library for game development).
- Ensure you have a terminal or command prompt to run commands.
- Clone or download the project
- Navigate to project directory
- Run the following command to compile the game:
make all- Or use this command to compile and run the game in one step:
make runTo remove compiled files and clean the project, run:
make clean- Start the Game: Launch the executable to see the main menu
- Choose Category: Select one of the five available categories
- Guess Letters:
- Click letters on the on-screen keyboard, or
- Use your physical keyboard to type letters
- Win Condition: Guess all letters in the word before the hangman is complete
- Game Over: You have 6 wrong guesses before losing the round
- Continue Playing: After each round, choose to continue or end the game
- Mouse: Click on keyboard letters or buttons
- Physical Keyboard: Type letters A-Z to make guesses
- Enter: End the current game session
- Any Key: Continue to next round after winning/losing
hangman-game/
├── src/ # Source code files
│ ├── main.cpp # Main game loop and logic
│ ├── Artwork.cpp # Hangman drawing management
│ ├── Button.cpp # Button interaction system
│ ├── Chip.cpp # Letter display chips
│ ├── Key.cpp # Individual keyboard keys
│ ├── Keyboard.cpp # Virtual keyboard system
│ ├── Utils.cpp # Utility functions
│ └── Word.cpp # Word display and management
├── include/ # Header files
├── assets/
│ ├── data/
│ │ └── word_bank.txt # Word database with categories
│ └── images/ # Hangman artwork (art0.png - art6.png)
├── bin/ # Compiled executable and assets
├── obj/ # Object files
├── Makefile # Build configuration
└── .gitignore # Git ignore rules
The game includes over 200 words across 5 categories:
- Marvel: 60+ superhero names and terms
- Movies: 40+ popular movie titles
- Books: 30+ famous book titles
- Palindromes: 40+ words that read the same forwards and backwards
- Countries: 45+ country names from around the world
- Language: C++17
- Graphics: Raylib
- Build System: GNU Make
- Platform: Windows (with potential for cross-platform compilation)
- Resolution: 900x650 pixels
- Frame Rate: 60 FPS
Edit assets/data/word_bank.txt to add new words:
Category,Word
MOVIES,YOUR NEW MOVIE
BOOKS,YOUR NEW BOOK
- Add words with a new category name in
word_bank.txt - Update the
categoryNamesarray inmain.cpp - Adjust the category button creation loop
Colors are defined in include/Constants.hpp:
PEACH: Main UI colorAPRICOT: Accent colorRICH_GOLD: Title color- And more...