battleship

Welcome to my Project 3 README page

My Project 3 - Battleship Game

Hi! My name is Graham. In this README page were you will find out a little about me, my website, my coding journey, my projects and who has influenced me in the development of this website.

This is my third course project, by now I have gained a little more experience but still very much a novice. Of the options for this project I thought a Battleship would be fun with the challenging as this is one of my favourite games.

I hope you have fun.


Aims

My aim or goal with this project is to not only complete my course objective but to also create a game, my very first, that is both functional and fun to play. As a big fan of the game battleships, I was eager to prove to myself that i could achieve my goal and hope that with further development of my coding skills, I cam add to this game and it can evolve with me.


Flow-Chart

A flow chart for this game created with the help of Lucid Web-Site

<img title="flow-chart" alt="flow-chart image" src="assets/images/flow_chart.PNG";>

Design.

My design for this battleship game in Python is a very basic game, it follows the traditional rules and layout. I went for a numbers layout both horizontal and vertical as I found it a easy and simple of game operation based on the idea of naval coordinates.


Starting-Point

The start of the game the players name is requested then the player is welcomed to the game and given the rank of Fleet Commander and that there ships await orders, then a countdown starts, adding some animation to contact the ships.

<img title="start" alt="battleship game welcome page" src="assets/images/start.jpeg";>

How-to-Play

At this point the declaration of war is made, below that the player will see a grid map of the game. The player is requested to get there navy ready for battle by requesting the coordinates for the ships. Each player has 6 ships in different length, firstly the player is asked for the coordinates for ship of length 5 meaning thats the size of that ship, after the player enters these coordinates the player will be requested the coordinates of the next ship until all 6 ships have there coordinates set.

<img title="Rules" alt="game set-up layout" src="assets/images/its_war.jpeg";>

Your-Ships

After you enter the coordinates for all the ships, the player will be show a grid map of there ships indicated with the letter (o). And now the game begins. The player is now asked for there first firing coordinates.

player ships map

Firing

From now, both the player and computer will takes turns firing at the others board until all one player hits all the others ships.

The top grid is the players and the bottom is the computers, you can see that the player entered the coordinate 25, which was a miss and is now marked with an (o). if it was a hit it will be marked (X).

playing the game

Location

All my projects are also available to view on my portfolio website. www.grahamwilliamson.ie


Testing

Code continuously tested my throught the process.

code testing
code testing

Bugs

As each bit of code was tested throughout, any bugs found were corrected. To ensure this tasks efficiency, the functionality of the code was check regularly.

There is an end of game error that I couldnt fix, I reached out on Slack but got no reply/help. This error wont reset the game fully, slack link to question below:

This bug remains.


Deployment

The site was deployed to Github. The step are as follows:

  1. In the Github repository, go to setting.
  2. In settings go to the pages tab, located on the left.
  3. Under source, select the branch to master and click save.
  4. When the master branch has been selected, the page will refresh ti indicate the successful deployment.
  5. Create a Heroku app.
  6. Set buildpacks to Python and Nodejs in that order.
  7. Click on deploy.

Clone-Repository

The project started to be developed by cloning the mock terminal repository provided by the Code Institute. The cloning phase of the project is as follows:

Go to the GitHub repository to be cloned. Click the ‘Use this template’ text and and then click ‘Create a new repository’ in the dropdown menu that opens.

The following will open on a new page. After specifying the repository name, you can create the repository without writing a description. The new repository will be created automatically.

Then, if you want, you can open with the GitPod or clone it to your computer and work on locally. Since I am running locally, I will explain how I cloned it to the computer. As in the first step, we press the ‘Code’ button, open the dropdown menu and copy the link indicated by the arrow.

Then, we open the terminal application we use from the computer and clone the repository to our computer with the ‘git clone -link to be cloned-‘ command. Then you can develope your work using the source-code editor of your choice.


Fork-Repository

To fork a GitHub repo, see the Fork a GitHub repo documentation.


Course

Professional Diploma in Full Stack Software Development

University College Dublin Website

Code Institute Website


Influences & Credit

Mike Dane Website YouTube

W3 School Website

Github Website

Slack Website


Acknowledgement

I hope I have achieved my objective on this project and created a game of my own work and design but I cant be 100% certain as I have watched several tutorials on youtube and read a lot of articles online for which I may have taken an idea or two. To ensure proper credit is given to all, I have listed the youtube channels I followed for this project below:

Dr Codie Youtube

Code Academy Youtube

Tech With Tim Youtube

CHOOBYORIALS Youtube


Books

Mike McGrath - Python - in easy steps.(2nd Edition) Amazon