Giter VIP home page Giter VIP logo

hangman-revolution's Introduction

Hangman Revolution

View the live project here

GitHub Repo

Hangman Revolution is a classic hangman game based on movies. The game aims to create an engaging and entertaining environment for the players. It is coded with Python and is played on the terminal on Heroku. The aim of the game is to guess the hidden movie title before 6 lives run out and the hangman drawing is completed.

The target audience for this game are people from 18 years and over who have an interest in movies and playing simple classic games. It challenges and tests the players' knowledge of popular movies.

Hangman Revolution


Index - Table of Contents


User Experience (UX)

User Stories

Reasons to play the game

  • A user looking for a simple and classic game to play.
  • A user wanting to play a game based on movies.
  • A user looking for entertainment and enjoyment.

Aim of the game

  • Provide an entertaining and engaging game for players

Responsiveness

The image below illustrates the game application's responsiveness on different screen sizes.

Hangman Responsiveness


Scope

User expectations

  • Being able to easily navigate through the game
  • Being able to easily understand how to play the game
  • Have an entertaining experience

As a developer, I want to provide

  • A simple and easy to play game with all game functionality working as expected
  • Simple and easy to follow instructions
  • Entertain and engage the player

Flow Chart

A flow chart was created using Lucidchart to explain the game flow and logic:

Flow Chart


Features and Design

Logo

The logo has been created with ASCII art, using the website Patorjk. It appears at the top of the game and remains there throughout the course of the game.

Logo

Emojis

Several emojis have been included to add playfulness and fun in the game. These appear next to the game messages.

Welcome message

To maintain simplicity, the welcome message displays "Let's play Hangman!" "Guess the movie!"

Welcome Message

Game area

The game area includes a drawing of hangman with ASCII art, which is updated as the player loses lives.

The movie title is represented with empty underscores / dashes. These will be updated as the player guesses correct letters corresponding to their position in the movie title.

The player is prompted to guess a letter, which is displayed under the prompt.

Game Area

Game messages

As the game progresses, the welcome message is updated with the following messages:

Correct Guess

When the player guesses a correct letter: "Well done! The letter (guessed letter) is in the movie!"

Incorrect Guess

When the player guesses an incorrect letter: "The letter (guessed letter) is not in this movie!"

Already Guessed

When the player enters a letter already guessed: "You already guessed the letter (guessed letter) guess another letter!"

Game Won

When the player guesses the movie: "Congratulations! You guessed the correct movie!"

Game Lost

When the player loses the game: "You lost the game! The movie was (movie title)!

Invalid Guess

When the player enters an invalid guess: "Invalid guess, please enter one letter from A to Z only!

Result

The game ends once the player guesses the correct movie title, and the game is won.

The game ends if the player enters 6 incorrect guesses, and the game is lost.

Play Again

The player is asked if they would like to play again with displaying the following message: "Do you want to play again? Y/N:"

If the player enters "Y", the game restarts with a different random movie.

Thank you for playing

If the player enters "N", the following message is displayed: "Thank you for playing Hangman Revolution!"

Invalid Input

If the player enters an invalid response, the following message is displayed: "Invalid input ... enter Y to play again or N to exit"


Technologies Used

  • Python
  • Am I Responsive: Checking responsive of the game on different secreen sizes.
  • Python Checker: Checking code for Python requirements.
  • Lucidchart: To create the game flow chart.
  • Git Gitpod is used to write code, make commits, and push code to GitHub.
  • GitHub: GitHub is used to create a project repository.
  • Heroku: Used to deploy the project.

Testing

Python Checker Code Validator

Python Checker was used to check the validity of the code. The code passed the validator with 99%. The image below displays the result:

Python Checker

Further Testing

Testing by game developer:

  • Game area display is as expected with all elements appearing where and when expected.
  • The game follows a logical flow with all functionality working as and when expected.
  • The game messages are displayed clearly and appear according to game logic.
  • Underscore blanks appear corresponding to a random chosen movie.
  • Underscore blanks are updated with correct letters when player enters a correct guess.
  • Hangman is updated with correct drawings when player enters an incorrect guess.
  • Game ends when the player wins or loses the game.
  • Player is asked if they would like to play again when game ends.

Bugs

Currently, there are no known bugs within the game.


Deployment

The project has been deployed to Heroku: The Hangman Revolution.

  1. Sign-up for a free account on Heruko.
  2. Login to Heroku.
  3. Click on "Create new app".
  4. Enter an app/project name and choose a region.
  5. Click on "Create app".
  6. Navigate to 'Settings' tab.
  7. Click on "Reveal Config Vars".
  8. Add Config Var in Heroku's Settings - Key: PORT, Value: 8000.
  9. Scroll to "Buildpacks".
  10. Click on "Add Buildpack".
  11. First add "Python", click on 'Save'.
  12. Second add "Nodejs", click 'Save'. (Ensure 'Python' is before (first) 'Nodejs' (second) - drag and rearrange if required)
  13. Navigate to 'Deploy' tab.
  14. Select 'GitHub' from 'Deployment method'
  15. Click on 'Connect to GitHub'
  16. Search for the GitHub repository name, and click on 'Connect'
  17. Click on 'Deploy Branch'
  18. Click on 'View' - this will open a new tab with the deployed app / project

Enable automatic deployment to Heroku

Follow the steps below to enable automatic deployment to Heroku from Gitpod:

  • Open the terminal
  • command: heroku login -i
  • Enter your credentials - email and password
  • Get your app name from heroku
  • command: heroku apps
  • Set the heroku remote. (Replace <app_name> with your actual app name and remove the <> characters)
  • command: heroku git:remote -a <app_name>
  • Add and commit any changes to your code if applicable
  • command: git add . && git commit -m "Deploy to Heroku via CLI"
  • Push to both GitHub and Heroku
  • command: git push origin main
  • command: git push heroku main

Adding and Committing files in GitPod

To add files to the repository: Type ‘git add .’ in the command line Type ‘git commit -m “This is the commit message” Type ‘git push’

The git commit message should clearly describe the changes made.

Pushing will send all work to the GitHub repository.


Acknowledgements

Credit

Brian Macharia - I would like to thank my mentor Brian Macharia for his valuable feedback and suggestions. His guidance enabled me to plan and execute the project.

Media

Dr. Angela Yu – Udemy Course - 100 Days of Code: The Complete Python Pro Bootcamp for 2022 – for providing valuable videos on various Python topics

Programming with Mosh – YouTube Channel – for providing informative videos on various Python topics

Lucidchart - used to create game flow chart

Am I Responsive - checking responsive of the game on different secreen sizes.

Stack Overflow – for trouble shooting and resolving code issues

W3school – for Python coding information and trouble shooting

Python Checker - for checking Python code validity

Patorjk - for creating logo ASCII art

Chris Horton - GitHub - for hangman ASCII art


Content

Code and Content (not already attributed): Michelle Griffiths

hangman-revolution's People

Contributors

michellegri avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.