Share your repls and programming experiences

← Back to all posts
Multiplayer Battleship!
CoderGautamYT

Hello!!

hello HELLo Helloooo replers, here i have....

BATTLESHIP MULTIPLAYER

made through my hard work for one WHOLE WEEK :o

made this when i was on vacation in India, so the wifi was really S L O W

what the frick even is battleship

ok ok calm down im getting there

Battleship is a 2player board game (actually played on paper but i guessthat still counts as a board game)

I recreated it using PHP and js

okaaayy but whats the point lmao:

the objective of battleship is to sink all of the opponents ships before they sink yours.

how do you get ships?

at the start of the game, each player will place 5 ships anywhere they want on the game board.

how do you sink ships?

once both players are done placing their ships, they will be able to guess points on the opponents board. if you hit a ship, you will see the point turn green. if you miss, the point turns into an asterick (*).

how do you know if the opponent hits your ship

the game is arranged into a side by side view. one is your board, where you can see your ships,and which points your enemy hit you, and the other is the enemies board, where you can see which points you have missed and which points you have hit.

ok i hope you get how to play

you can play with computer (which is really bad btw) or you can play with a real person

if you want to see game source code....

https://github.com/codergautam/battleship

and also if you want to see a youtube video of the game, here it is:

https://www.youtube.com/watch?v=4yzZ8UonvDI

PLAY NOW!!!!

https://bit.ly/PhpBattleship

go go go what are you waiting for play!!! :DDD

Voters
GautamSudarshan
Akrix
CoderGautamYT
Comments
hotnewtop
Akrix

I have a suggestion. How about a public lobby where once 2 people join they are both put into a game. (For people who don't have a friend to play with but wanna play multiplayer)

CoderGautamYT

Good idea, like a matchmaking queue so it finds an opponent for you. @TheDragonWiz

Akrix

The AI is kinda bad... I won 5-0 by randomly clicking. It seemed to be just picking random positions on the board to click. Maybe make it so that when it hits a ship it hits both sides of the place where it hit the ship?

CoderGautamYT

yeah, i should probably do that @TheDragonWiz

Akrix

@CoderGautamYT Besides that its working pretty well. I'm surprised that no one else has upvoted this. Right now, I'm trying to make an MMORPG in python (yes I know bad idea) but I'm afraid no one will upvote it and it will die :/

CoderGautamYT

Aw, wellgood luck with it and I will upvote :D @TheDragonWiz

Akrix

@CoderGautamYT Thanks! It probably won't be out for another month though.

CoderGautamYT

mkay, tell me when its done @TheDragonWiz

Akrix
Akrix

@CoderGautamYT So it's not done yet, but I thought I would publish it for anyone who wants to see progress. (right now there is a huge error that I have no idea how to fix so yeah. if you wanna see what error I ran into the stack overflow page is here: https://stackoverflow.com/questions/69330304/value-error-circular-reference-detected-in-python-mmorpg)

Link to game: https://replit.com/@TheDragonWiz/Alterpolis?v=1

GautamSudarshan

huh, pretty cool, seems to be working [email protected]

Akrix