Battleship

I am releasing a battleship game I started writing in high school. It was a Visual Basic 6 project I was working on in school, when I was a junior. I haven’t worked on it since then, and it is not yet finished. You can download it here. I will eventually post the source code too. And if I ever get a copy ov VB6, I will try to finish it up.

The game is played with normal battleship rules. You have 4 ships: a battleship, cruiser, submarine, and destroyer. They each have different sizes. To start the game click in the right grid to place your ships. Left click to place the ship horizontally and right click to place the ship vertically. When you have setup all your ships, click squares in the left grid to shoot at the computer opponent.

battleship screenshot

The computer has no intelligence and will shoot randomly at your ships. This is one feature, that I never finished setting up. Obviously this makes the game pretty boring and easy to win. Except that you can never really win. I hard coded in the paths to several of the image files, and there are a couple I never fixed. So when you sink the computers cruiser, you will get a nice error:

battleship error

and the game will crash. Obviously I was not a very good programmer when I wrote this game.

And what is a computer game without cheat codes. Just press ‘T’ and enter “monkey” to change the background! There may be other codes that I put in, but I would have to check the source code. Another error comes when you click file new game. Maybe someday I will get around to finishing the game. Of course VB6 isn’t the best language to write it in, and I would like to convert it to something better. I know there is some pretty terrible code that I wrote for this game. Any suggestions would be welcome.

0 Responses to “Battleship”


  1. No Comments

Leave a Reply