Skip to content

Programmer25X/Battleships

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Battleships Project

Overview

As part of my Computer Science A-Level, I completed an extended programming project from June 2024 to March 2025. This involved me having to conduct research about already existing products and then formulate my own designs.

I decided to create a version of Battleships, which could be played on desktop PCs. By using a variety of different data structures, file handling and an Insertion Sort algorithm - I was able to create a version of Battleships.

The program allows:

  • Players are able to play against the computer (CPU) or against another player (via local co-op)
  • Players can compete to try to earn the highest score to earn their place on the leaderboard
  • Players can save and load their games to continue unfinished games later

Technical Details

  • Data Structures: Implemented different data structures (including 2D arrays, lists and records) to manage the players' ships, grids and turns
  • File Handling: Created a saving and loading system for each game mode and storing the leaderboard data
  • Sorting Algorithms: Implemented an Insertion Sort to sort the players' scores, which are stored in .txt files and displayed on the leaderboard
  • Game Logic: The game logic consists of: turn-based gameplay, firing hit and miss checking and tracking, generating CPU ships in random locations and allowing players to place their own ships
  • Object-Oriented Programming (OOP): By using encapsulation and reusable components, I produced more efficient and robust code

Current Features

  • Single-player vs CPU with AI logic
  • Local multiplayer
  • Scoring system with a functional leaderboard that displays the top ten highest scores
  • Save and load functionality for long-term play
  • A clear and simple user interface (UI)

Tools & Languages

Tools

  • Visual Studio

Languages

  • C#

Media

Screenshot 2026-07-05 161133 Battleships_Gameplay_2 Battleships_Leaderboard

Gained Skills

  • Organisational Skills: Planned, designed, implemented and tested my project, whilst ensuring to keep up-to-date with my other studies
  • Computational Thinking: To effectively use my time, I utilised computational methods including decomposition, abstraction and visualisation.
  • Applying Sorting Algorithms: Successfully implemented an Insertion Sort that was used for a real-world scenario
  • Effective Data Handling: Effectively used different data structures and file handling to create different game modes and systems
  • Testing & Debugging: Throughout the development process, I had to continuously debug and test my written code and handle any warnings or errors
  • Documentation: Produced thorough documentation throughout the entire planning, design, implementation, testing and evaluation phases

Reflection

This was my first experience of working on a programming project of a larger scale; starting from research to completion. This experience provided me with an insight and foundation into software development, problem solving and project management, and has allowed me to further understand the importance of validation for testing and debugging projects. I have since been able to apply the skills and knowledge I have gained when working on more recent projects when using Unity and Unreal Engine 5.


Used Assets & Credits

Disclaimer: The project was developed for educational and portfolio purposes only. To my knowledge, all third-party assets used and their creators have been listed, with appropriate credit being given to the creators for their work. I do not claim any ownership of any third-party assets used. If there are any issues regarding the use of these assets or the credits, please contact me.

2D Art

About

Battleships Game

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages