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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.