Skip to content

ciarangriffin93/Hangman-game

Repository files navigation

Hangman Game

The Hangman game is a Python terminal deployed to Heroku.

This game is to guess a random word letter by letter. If the player makes too many incorrect guesses, the man is a hangman. If the player correctly guesses the word, the man survives.

Click here to see the live site.

Image of Dvice responsivneness


How to play

This game is based on the hangman game:

  • The hangman will select a word related to European countries.

  • The hangman draws a line for each letter in the word.

  • The guesser will guess one letter at a time. If the letter is in the word, the hangman will fill in the blanks with the correct guesses.

  • If the letter is not in the word, the hangman will draw one body part for each incorrect guess: head, body, and leg.


User Stories

  • As a user, I want to start a new game so that I can begin playing Hangman from scratch.

  • As a user, I want the hangman game to be more user-friendly.

  • As a user, I want to visit hangman game to learn more.

  • As a user, I want the option to play again after completing or lose a game that I can continue enjoying the Hangman experience.


Features

  • The game show.
    • Welcome to the Hangman game!
    • The player has read the game rules.

Image of game show

  • Name request input.
    • When the player enters their name, they will receive a welcome message.

Image of name request

  • Name invalid
    • Enter a Number and space is not a valid name.

Space-Invalid

Number-Invalid

  • Show the instructions.
    • The game starts by showing live stages and a word, and then it starts the game.

Image of instructions

  • Guess a letter.
    • Players can press any letter of the alphabet on their keyboard to start the game.

Image of guess a letter

  • Guess correct.
    • If the guessed letter is correct, a message is sent confirming its placement in the word.

Image of correct

  • Guess incorrect.
    • If the guessed letter is incorrect, players will receive a message indicating that the letter is not in the word.

Image of incorrect

  • Letter and number invalid
    • Two than one letter or number is not vnvalid

letters-number-invalid

  • Game win.
    • Players win the game by correctly guessing all the letters in the word. Once they do this, they receive a message informing them that they have guessed the word and won the game.

Image of game win

  • Game lose.
    • Players lose the game when they exhaust all incorrect guesses and the full graphic is displayed. In this scenario, they receive a message stating that they have lost.

Image of game lose

  • Play again.
    • If the player want to play "start_over == 'y'"
    • If the player chooses not to "play start_over == 'n'"

Image of game again

  • End game.
    • If they don't want to play again, a "Thank you for play and hope you enjoyed it. BYE!" message will be displayed.

Image of game end


Future Feature

  • Implement different difficulty levels easy, medium, hard" with word lengths to cater to players of different skill levels.

  • Players to choose from different themes or categories for the words, such as animals, movies, history, or sports.


Flowchart

I used Canva to plan and map out the core processes.

Canva


Testing

  • For all testing, please refer to the following TESTING.md file

Deployment

Code Institute has provided a template to display the terminal view of this backend application in a modern web browser. This is to improve the accessibility of the project to others.

The live deployed application can be found deployed on Heroku.

Heroku Deployment

This project uses Heroku, a platform as a service (PaaS) that enables developers to build, run, and operate applications entirely in the cloud.

Heroku needs three additional files in order to deploy properly.

  • requirements.txt
  • Procfile
  • runtime.txt

You can install this project's requirements (where applicable) using:

  • pip3 install -r requirements.txt

If you have your own packages that have been installed, then the requirements file needs updated using:

  • pip3 freeze --local > requirements.txt

The Procfile can be created with the following command:

  • echo web: node index.js > Procfile

The runtime.txt file needs to know which Python version you're using:

  1. type: python3 --version in the terminal.
  2. in the runtime.txt file, add your Python version:
    • python-3.9.18

For Heroku deployment, follow these steps to connect your own GitHub repository to the newly created app:

Local Deployment

This project can be cloned or forked in order to make a local copy on your own system.

For either method, you will need to install any applicable packages found within the requirements.txt file.

  • pip3 install -r requirements.txt.

If using any confidential credentials, such as CREDS.json or env.py data, these will need to be manually added to your own newly created project as well.

Cloning

You can clone the repository by following these steps:

  1. Go to the GitHub repository
  2. Locate the Code button above the list of files and click it
  3. Select if you prefer to clone using HTTPS, SSH, or GitHub CLI and click the copy button to copy the URL to your clipboard
  4. Open Git Bash or Terminal
  5. Change the current working directory to the one where you want the cloned directory
  6. In your IDE Terminal, type the following command to clone my repository:
    • git clone https://github.com/ciarangriffin93/Hangman-game.git
  7. Press Enter to create your local clone.

Alternatively, if using Gitpod, you can click below to create your own workspace using this repository.

Open in Gitpod

Please note that in order to directly open the project in Gitpod, you need to have the browser extension installed. A tutorial on how to do that can be found here.

Forking

By forking the GitHub Repository, we make a copy of the original repository on our GitHub account to view and/or make changes without affecting the original owner's repository. You can fork this repository by using the following steps:

  1. Log in to GitHub and locate the GitHub Repository
  2. At the top of the Repository (not top of page) just above the "Settings" Button on the menu, locate the "Fork" Button.
  3. Once clicked, you should now have a copy of the original repository in your own GitHub account!

Technologies Used

languages used:

  • Python: Used to provide functionality to the site.

  • Git: Used write Git to commit and push the code for the development of the website.

  • Gitpod: Cloud IDE was used to write, commit, and push code to GitHub.

  • Github: Used frequently to commit and push code.

  • Heroku: Deploy a live version of the terminal.

  • Fancy text pro: Used to create art with text.

  • Canva: Used create a flowchart for project preparation.

  • CI Python Linter: Used display warnings and errors to assess code quality.

Python Packages Used:

  • Colorama: Used to add color for visual feedback.

  • Import os: Used to clear function for keeping the terminal clean.

Tools:


Credits

content:

  • Youtube: This is used for learning how to create a hangman game in Python.

  • Colorama youtube: This is used to how do import Colorama into Python.

  • W3schools: This site was created using information W3Schools.

  • OS: This is how to use the OS module to clear the terminal.

  • Code Institute: This is from code institute to learn how to create love sandwiches project.

  • Git Commit: I learn how to writing better commit messages.


Acknowledgements

  • I would like to thank to my mentor, Tim Nelson and Rory Sheridan for his help and unwavering support.

  • I would like to thank to my tutor at Code Institute for their help and unwavering support.

  • I would like to thank to my family for their patience, support, and understanding.

  • I would like to Code Institute's Slack community,and Deaf group for their support.


About

2nd Project - Use HTML, CSS & JavaScript to create a website for a hangman game.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors