Skip to content

KaiLangen96/hangman

Repository files navigation

Animal Hangman Game in Python

Screenshot of the main screen in the terminal

Welcome to my animal themed hangman game. View the live project here

Table of Contents

User Experience (UX)

  • User stories

    • First Time User Goals

      1. As a First Time User, I want to easily understand the main purpose of the site.
      2. As a First Time User, I want to be able to easily interact with the site.
      3. As a First Time User, I want to be able to easily play another game or quit.
    • Returning User Goals

      1. As a Returning User, I want to be able to access and view the game quickly and easily.
      2. As a Returning User, I want to be able to guess new animals.
    • Frequent User Goals

      1. As a Frequent User, I want to be able to find different categories and/or difficulties to keep the game interesting.
      2. As a Frequent User, I want to be able to save my score and compete against others in the leader board.

Features

Existing Features

  • F01 Main Screen

    • At the start of the game you will be directed to the main menu.
    • From here you have three options to choose from.

Screenshot of the main menu

  • F02 Menu

    • The user must choose an option from the menu to continue.
    • The user will see an error if they do not enter a valid option.

Screenshot of the options with a faulty input resulting in an error

  • F03 Ingame screen

    • The user can see how many letters the randomly chosen animal contains.
    • The user can see which letters they have already used.
    • The user can see which letters have been guessed correctly
    • The user can see a hangman graphic indicating the current lives left.

Screenshots of the ingame screen after the input of all vowels

  • F04 End game screen

    • The game ends on a victory or loss screen.
    • Underneith the current hangman picture the user can see the animal they were guessing.
    • From here the user can choose to play again or go back to the main menu.

Screenshot of the victory screen

  • F05 Submitting users score

    • After playing a full game the user has the chance to submit their score.
    • The score will be saved to an external google spread sheet.
    • After a short delay of 3 seconds the user gets send back to the main menu.

Screenshot of user submitting their score

  • F06 The leader board

    • From the main manu the user can open the Highscores with the input "2"
    • Only the top ten players will be shown in the Highscores.

Screenshot of the current Highscores

Future Features

  • Categories and levels can be added for future development to ensure return users are getting value and finding new things to keep them interested.

Design

  • Imagery

    • The hangman images and screen layouts are all done by myself with the help of ChatGPT. The layout needed adjustments later on. Screenshot of the chat with ChatGPT
  • Color

    • To choose a color directly from python I asked ChatGPT to give me all possible colors.
    • I chose red for error messages and the Game Over in the end screen. Red is, because of its long wavelength, one of the most visible colors in the spectrum and therefore often used for warnings.
    • I chose yellow to reveal the animal in the end screen because next to red it stands out the most.
    • I chose green for the Congratulations message in the end screen since the color usually represents good things. Screenshot of the chat with ChatGPT
  • Flow chart

    Screenshot of the Flowchart

Technologies Used

Languages Used

Python Modules

  • random - to select random words

  • sleep from time - to add a short timer into the clear function so the screen pauses for 2 seconds before clearing the terminal.

  • os - to add a clear function to refresh the terminal output.

  • gspread - to add an external spread sheet in which the user scores are saved.

  • Credentials from google.oauth2.service_account - to be able to edit the external sheet.

Frameworks, Libraries & Programs Used

This project used:

  • Git for version control.

  • GitHub to store the project files.

  • Codeanywhere as the IDE for development.

  • Heroku to deploy the website.

  • Lucidchart to create the flow chart.

  • ChatGPT to create layout and colors for the display.

Testing

Automated Validator Testing

Additional Testing Comments

  • Special letters like an umlaut (ä,ö,ü,å etc.) are valid letters from the alphabet and don't raise any error. This could be seen as validation error.

Deployment

How this site was deployed

  • Login to Heroku.

  • On the Dashboards page click 'New' and select 'Create New App'.

  • Enter a unique app name and select your region. Then click 'Create App' .

  • On the next page displayed, click on the Settings tab.

  • Click 'Reveal Config Vars' and enter PORT as key and 8000 as the value. Click 'Add'.

  • In the Buildpack section, select Python from 'Add Buildpack' and Save.

  • In the same Buildpack section, select Node.js from 'Add Buildpack' and Save.

  • Node.js needs to be below Python! If it isn't, drag it on the icon to the left.

  • Go to the Deploy tab and choose Gibhub as the deployment method.

  • Find the repository name and connect.

  • At the bottom of the page select to deploy manually or automatically.

  • A link to the deployed page can be seen once deployment is complete.

    The live link can be found here - Hangman

How to clone the repository

  • Go to the hangman repository on GitHub
  • Click the "Fork" button in the top right corner

How to clone the repository

  • Go to the hangman repository on GitHub
  • Click the "Code" button to the right of the screen, click HTTPs and copy the link there
  • Open a GitBash terminal and navigate to the directory where you want to locate the clone
  • On the command line, type "git clone" then paste in the copied url and press the Enter key to begin the clone process

Credits

Code research

Special Thanks

Code Institude, for teaching me the language needed to create this page.

w3schools, for so many helpful pages and tools to support learning python.

Lucidchart, helping me to create the flow chart.

Antonio Rodríguez, as my mentor. He is an absolute legend and an immense help in creating my projects.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published