SunOfABeach

Battleship - raw HTML game

Recommended Posts

I made a classic battleship game that you can play against others or an AI.

To challenge myself, I did it without any game framework, not even canvas. Just raw HTML5 element manipulation. It's also fully responsive and mobile first.

http://www.battleship-online.com

The code:

https://github.com/Sun0fABeach/battleship_online

Share this post


Link to post
Share on other sites

I feel like having single square ships is a mistake. Part of the decision making in battleships is judging the likelihood of where a ship might be... meaning you can try different shot patterns, and skip certain squares/corners, because you know it won't fit there.

Now it's just blind luck with one square ships.

Otherwise, works well. :) If this was made as a challenge, how long did it take to make, may  I ask?

Share this post


Link to post
Share on other sites
13 hours ago, Matty77 said:

Samsung S4 Galaxy - standard default inbuilt browser.

On my S5 using the standard builtin browser (Samsung Internet v7.4), it works. I transpile my ES6 to support the last 3 major versions of each browser, except IE. Are you running the latest version?

 

12 hours ago, Wolfsbane said:

I feel like having single square ships is a mistake. Part of the decision making in battleships is judging the likelihood of where a ship might be... meaning you can try different shot patterns, and skip certain squares/corners, because you know it won't fit there.

Now it's just blind luck with one square ships.

Otherwise, works well. :) If this was made as a challenge, how long did it take to make, may  I ask?

I totally hear you. Most games I played ended with searching for those last single square ships, which is a total guessing game. It might be better to make two squares the smallest variant and introduce a 5 or 6 square carrier or something.

It took me about two months to complete, spending 2-3h per day. I had to learn Node/Express, socket.io, Webpack and Bootstrap for this project, so that slowed things down a little.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.