🎲 Hangman Game

Classic word guessing game built with Python

Back to Python Page

🎯 Overview

Hangman Game is a modern take on the classic word guessing game, implemented in Python using Pygame for graphics and Pygbag for web deployment. The player must guess a hidden word by suggesting letters, with a limited number of incorrect guesses before the game ends.

This project demonstrates:

🚀 Features & Mechanics

Random Word Selection

Each round uses a randomly chosen word from a customizable list.

Guess Tracking

Tracks correct and incorrect guesses, displaying missed letters.

Graphical Hangman

Shows hangman stages with Pygame graphics, updating with each error.

Virtual Keyboard

Supports mouse/touch input for mobile and desktop play.

Stats & Replay

Displays victories/defeats and allows instant restart after each round.

Input Validation

Handles invalid, repeated, or non-letter guesses gracefully.

Game Flow

🛠️ Technologies & Deployment

Pygbag Web Deployment

# Example build command python -m pygbag --build .

🎮 How to Play

Start Game

Run main.py locally or open index.html (web build) in your browser.

Guess Letters

Use your keyboard or click/tap the on-screen virtual keyboard to guess letters.

Track Progress

Correct guesses reveal letters; incorrect guesses add to the hangman drawing and error count.

Win or Lose

Win by guessing all letters before the hangman is completed. Lose if you reach the max errors.

Restart

Press any key or click the restart button to play again after a round ends.

Controls

🌟 Highlights & Customization

🚦 Project Status

✅ Completed ✅ Tested ✅ Responsive ✅ Web-ready ✅ Educational

All features implemented and tested. Play locally or in your browser. Clean, secure, and optimized code for learning and fun!

Back to Python Page