Skip to content

darraghmurphy1/PP3

Repository files navigation

Battleship PP3

chrome_L6IUxkJtnP

Live Version - https://pp3battleship-3dbac7446df0.herokuapp.com/

How to Play

Battleship is a classic game traditionally played as a board game. This is a slightly manipulated version of the classic rules.

The player will see a blank grid or gameboard with the x and y axis labeled A-E and 1-5. The player will enter the coordinated they think an enemy ship is located and drop a bomb on that location. The user will have 15 attempts to take out 5 enemy battleships. If the user locates an enemy ship it will show up as "X" on the grid. If the user takes a shot and misses all enemy ships a "O" will be displayed on the grid.

If the user takes out 5 enemy ships in less than 15 attempts then they are victorious. If the user runs out of bombs before taking out 5 ships they will lose.

Flowchart

bQ9gWuWCDJ

Project Goals

The goal of this project is to create an entertaining and challenging game with a decent amount of replayability and to display the creator's understanding of python essentials.

User Goals:

First Time Goals

On my first visit to the game I want to

  • be entertained by the game
  • see rules clearly displayed at the beginning
  • beat the game
  • be visually stimulated by the game
  • be able to use the game without any errors

On my second visit I would like to defeat the game if I was unsuccessful the first time.

If I was a repeat user I would like to see new features added to keep me stimulated.

Features

Greeting message

chrome_h6YngRPR0t

Difficulty Levels

chrome_amQThUAnuV

Random ship generation and placement.

Hidden grid with ships on it and displayed empty grid for guessing

chrome_5qvcerms2Z

Valiadation for input for coordinates

chrome_3qbAkYZXDm chrome_0Yb5fRBfgO

A counter to tell the user how many bombs are left

chrome_3uN34tKVT9

A success message

chrome_8fe29FjfcS

A defeat message

chrome_pNO6RDVCak

ASCII art

chrome_6AqSDGJKfq

Testing

To test the input validation I deliberately entered invalid data. A successful result would be a prompt to the user to enter a valid option.

chrome_3qbAkYZXDm chrome_0Yb5fRBfgO

This was a success.

The project was tested in Heroku as can be seen in the features section.#

Also tested different difficulty levels successfully.

Validator Testing

I used Pep8 online validator to test my python code.

chrome_EjQFuzO5xK

After fixing these errors I recieved a success message.

chrome_BVwA1QjMeT

Deployment

As was required by this project I had to deploy my project to Heroku. I done this by following these steps:

  1. Commit and push final code to GitHub
  2. Open Heroku
  3. Open a new app in Heroku
  4. Select a name for the app and select region as Europe
  5. Add buildpacks to the app. Add Python and NodeJS in that order. Make sure Python is on top.
  6. Add config vars. Fill in PORT as the key and 8000 as the value.
  7. Go to Deploy tab
  8. Connect GitHub account and select repository
  9. Manually deploy the main branch
  10. Success

Credits

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published