Be sure to write what inspired you, what you learned, how you built your project, and the challenges you faced. Format your story in Markdown.


Tavis and I are HUGE game fans. However, during the pandemic, we found ourselves very bored as most games required participating in person. Many of the online games we played were able to provide us with some fun; however they all seemed to be missing something.

So, in effort to find a solution we brainstormed games that we liked online. Our list was quite long including Terraria, Zelda Games, and Mario. It was then we realized that the one thing missing from these online board games was graphics.

With our basic knowledge of programming and graphic design implementations in C++ and Java, we came up with the idea of Battleship 2: combining one of our favorite board games with graphics to simulate being in a control room launching bombs and feeling the explosions.

What it does

This program has two main parts: allows multiple players to play Battleship as well as simulate different parts of the game. The program starts by each player choosing where each ship should be placed. Once done, players take turns guessing where their opponent ships are located. If the guess is correct, the program includes a graphical representation of a ship being bombed (displaying a missile launch and hitting the opponent’s ship with added sound effects). If the guess is incorrect, the program displays a missile launched but hitting the water.

Graphics are also included for ships that are completely bombed and for additional features like radar and simulating control rooms.

Additionally, the board changes accordingly per player. Players can see their own ships and what has been bombed so far. Additionally, each player sees their guesses (red tiles for correct and white tiles for incorrect guesses).

How we built it

We used Visual Studio Code, specifically Java’s built-in graphics library. Using our prior knowledge from previous CS classes, we implemented classes like MouseListener, KeyListener, to create our program. We didn’t manage to complete much of the game logic, but we did get the game to load images, and we got the game board to draw onto the screen.

Challenges we ran into

At first, our goal was to build this game in C++ using the SFML graphics library. However, we soon realized that only one of us had much experience with SFML and the C++ language in general. In order to ensure both group members were able to work on the project, we eventually decided to switch to Java graphics. Unfortunately, this realization was last minute; thus, we were not able to complete as much as we had previously intended.

Accomplishments that we're proud of

As we both have not much experience in competing in Hackathons, (this is actually the first hackathon for one of the members) we are very proud of our idea and how it went. With more time, we feel that it could be a great addition to the online gaming community.

Although we both had not worked with Java in a while, our experience in our prior computer science classes proved useful. Switching last minute from C++ to Java was not fun, but we were able to make up a good amount of lost ground. In the end, we were not able to get too much actual coding done, but we learned a lot about managing a team, planning out a big project, and working together.

What we learned

As mentioned previously, this project was a big learning experience for both of us. We both hadn’t really attempted something like this before, and so a big mistake we made was not planning the code out very well, leading to us needing to start over halfway through. After working on our project over the course of HooHacks, we gained a new appreciation for just how hard game development can be, and we believe that on our next game attempt we’ll be at a much better starting point.

What's next for Battleship 2

We would like to finish more of the program and add in those graphical features previously planned. Additionally, it would be fun to simulate captains in charge of ships or mini-quests, and other aspects of the game to make it feel more real and exciting. In the future, we plan to work on more projects together, including Battleship 2. HooHacks was a lot of fun for us, and we hope to continue coding together, either during another hackathon or on our own time.

Built With

  • java
  • visualstudiocode
Share this project: