Giter Club home page Giter Club logo

warship's Introduction

Warship

mockup

Warship is a Python terminal game, which runs in the Code Institute mock terminal on Heroku.

Users answer questions in the game, which will determine the users next path. The game, whilst terminal-based, is aimed to use the players imagination to envision the scenario.

Here is the live version of my project.

start menu

How to play

Warship is a text-based game which have been documented to go back since the 1960's. You can read more about them and their paths through history on Wikipedia.

In this game we use multiple choice questions to lead the user down a path either further into the ship, with or without friends.

There is no winning or losing, but more the users want to go further into the Warship.

Features

Existing Features

  • Use of colorama
    • The use of colorama has been implemented to enable quick and easy viewing if something is incorrect in RED
    • Using BLUE for the use of information for the user
    • Using YELLOW for standout information like, the selection choice

Use of Colorama

  • The Story behind Warship

Warship Story

  • Use of the clear() function to clear the users terminal during the game play
import os

def clear():
    """
    Clear function to clear up the terminal
    """
    os.system('cls' if os.name == 'nt' else 'clear')

Clear Function

  • Refactoring of code
    • Removing the five End Game Function and combining into one function
    • Adding the Final End game function into the End Game function

Refactoring of Code

  • Displaying Errors when the user inputs the wrong information

Displaying Errors

Future Features

  • To allow users to set usernames
  • Adding in Terminal Based Graphics

Terminal Based Graphics

Data Model

I decided to use a Adventure game for my model, meaning that when the user answers the questions they have different paths, leading to different outcomes.

The number of questions I wanted to limit, to keep the game quick and fun, but also have multiple outcomes so it can be played more than once.

Flowcharts

  • Used a flowchart of the questions to follow the path through with the answers of the questions.

flowchart

  • The questions where set out with the answers, color coded to link through:

questions and answers 1 questions and answers 2 questions and answers 3 questions and answers 4

Testing

To view all testing documentation, please refer to the TESTING.md file.

Deployment

This project was deployed using Code Institute's mock terminal for Heroku.

  • Steps for deployment:
    • Fork or clone this repository
      • git clone https://github.com/benjimansutton/warship.git
    • Create a new Heroku app
    • Set the buildpacks to Python and NodeJS in that order
    • Link the Heroku app to the GitHub repository
    • Click on Deploy
    • Make sure to freeze the requirements.txt file
      • pip3 freeze --local > requirements.txt

Local Deployment

In order to make a local copy of this project, you can clone it. In your IDE Terminal, type the following command to clone my repository:

  • git clone https://github.com/benjimansutton/warship.git

You will also need to install the required packages from the requirements.txt, and you can do that using this command:

  • pip3 install -r requirements.txt

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

Open in Gitpod

Credits

Thank You! - Benjiman Sutton

warship's People

Contributors

benjimansutton 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.