Skip to content

BrunoPinheirofe/Jogo_da_Forca

Repository files navigation

Hangman Game

This is a classic Hangman game developed in Python using the Pygame library. The game randomly selects a secret word from a text file, and the player has to guess the word letter by letter within a limited number of attempts.

Main Technologies

  • Python: The core programming language used for the game logic.
  • Pygame: A cross-platform set of Python modules designed for writing video games.

File Structure

  • jogo_da_forca.py: The main entry point of the application. It contains the primary game loop, handles user input, and manages the overall game state.
  • funcoes.py: This file contains helper functions for the game, including:
    • Functions to draw the hangman figure.
    • A function to select a random word from the palavras_secretas.txt file.
    • Functions to manage the game's logic, such as camouflaging the secret word and tracking the player's attempts.
  • palavras_secretas.txt: A text file that stores the secret words and their corresponding hints. The format for each line is WORD;HINT.
  • requirements.txt: This file lists the project's dependencies. In this case, it only contains pygame.

Building and Running

To run this project, you need to have Python and pip installed.

  1. Install dependencies:

    pip install -r requirements.txt
  2. Run the game:

    python jogo_da_forca.py

Development Conventions

  • The code is written in Portuguese.
  • The palavras_secretas.txt file can be easily modified to add or change the secret words and hints. The format is one word and hint per line, separated by a semicolon (e.g., PYTHON;PROGRAMMING LANGUAGE).

About

Jogo desenvolvido com biblioteca pygame

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages