A version of the popular and classic game The Hangman created and played using the command line and the Python programming language which has been deployed with Heroku.
Visit the live site: The Hangman
This section provides insight into the UX process, with a focus on the people who this game has been created for, the main aims of the project and how it can help users to meet their needs.
Project goals:
-
To encourage people to play the hangman game.
-
To provide an easy and user-friendly command line game.
- As a first-time visitor, I want to start a new game using the command line.
- As a first-time visitor, I want to see how many attempts I have left when playing.
- As a first-time visitor, I want to see the words I guessed so far displayed.
- As a first-time visitor, I want the app to ask me if I want to play again or not when finishing.
- As a returning visitor, I want to see my results.
- As a frequent visitor, I want to be able to play the game using different categories.
Logo
- The game Hangman visual identity.
Welcome screen
- The user is welcomed to the game, the logo displays and they can input their name and ensure they are happy with their selected option.
Category selection
- The user can choose a word category to play the game. When the user selects to start the game, the terminal displays options to select between different word categories which are grouped by theme.
Play
- After selecting a category and confirming that they are happy to play the user is prompted to a screen with the hangman stage 1, different stages are displayed as the player progresses through the game.
Score counter
- This counts the score obtained by the player, it adds 25 per letter guessed and 200 if the player guesses the word in full, it displays this data to the terminal for user feedback.
Game over
- When losing a game, the name of the player, score and game over ASCII Art are displayed.
End Game screen
- When finishing a game the user is prompted with a screen in which they can decide whether to start a new game, have a look at the leader board, or exit the game.
Leader board
- When finishing the game the user can see the leader board showing the top 10 scores achieved by previous players.
- The scores get stored in google sheets, the game returns the top 10 player name and scores from this database. This sheet is connected to the code through the Google Drive and Google Sheet API by the Google Cloud Platform.
- This code connects google sheets and the game.
In the future, I would like to:
-
Refine the score counter so it would add more points the earlier the full word is guessed.
-
Refine the word display so no words would be repeated when a player selects the same category in consecutive games.
-
Refine the leader board, so the same name cannot be repeated with the same scores, to avoid duplicate entries.
-
Add colours to the terminal.
-
Add more ASCII art and formatting to the terminal.
-
Add a feature in which the user can select words sorted by length.
-
Add a multiplayer feature.
The language used is Python
Lucid chart - Used to create flowcharts.
Git - For version control.
GitHub - To save and store the files for the website.
Code from anywhere - To write, edit and save code.
Shields - To add badges to the readme file.
Amiresponsive - To generate a mockup in different screen sizes.
Bandicam - To screen record bugs and features.
Windows photo feature - To trim screen recording.
Veed - To convert mp4 to gif
Heroku - To deploy the App.
Code Institute template - To run the game in the terminal using Heroku.
ASCII Art Generator - To generate ASCII Art
- This site was deployed by completing the following steps:
- Log in to Heroku or create an account
- On the main page click the button labeled New in the top right corner and from the drop-down menu select Create New App
- You must enter a unique app name
- Next select your region
- Click on the Create App button
- The next page is the project’s Deploy Tab. Click on the Settings Tab and scroll down to Config Vars
- Click Reveal Config Vars and enter port into the Key box and 8000 into the Value box and click the Add button
- Click Reveal Config Vars again and enter CREDS into the Key box and the Google credentials into the Value box
- Next, scroll down to the Build pack section click Add Build pack select Python and click Save Changes
- Repeat step 8 to add node.js. o Note: The Build packs must be in the correct order. If not click and drag them to move into the correct order
- Scroll to the top of the page and choose the Deploy tab
- Select Github as the deployment method
- Confirm you want to connect to GitHub
- Search for the repository name and click the connect button
- Scroll to the bottom of the deploy page and select the preferred deployment type
- Click either Enable Automatic Deploys for automatic deployment when you push updates to GitHub
To fork the Zest-studi-o/P03-Hangman repository:
- Log in (or sign up) to Github.
- Go to the repository for this project, Zest-studi-o/P03-Hangman.
- Click the Fork button in the top right corner.
To clone the Zest-studi-o/P03-Hangman repository:
- Log in (or sign up) to GitHub.
- Go to the repository for this project, Zest-studi-o/Zest-studi-o/P03-Hangman.
- Click on the code button, select whether you would like to clone with HTTPS, SSH or GitHub CLI and copy the link shown.
- Open the terminal in your code editor and change the current working directory to the location you want to use for the cloned directory.
- Type 'git clone' into the terminal and then paste the link you copied in step 3. Press enter.
Please refer to TESTING.md file for all testing carried out.
-
How to build HANGMAN with Python in 10 MINUTES - I used this tutorial to help me with understanding how to create a basic hangman game to build upon it using Python.
-
I used other student examples as a reference to understand how to build my own game and what is expected for the app and readme, Hangman 1, Hangman 2 those projects were also helpful to find resources that helped me build the game, such as the use of ASCII Art, Lucid Chart, or other reference material.
All the words in the different categories are taken from:
- Derek MCAuley, my Code Institute Mentor.