Skip to content

Thrilling C++ command-line game with strategic battles against CPU

Notifications You must be signed in to change notification settings

Ali-Sdg90/Sea-Battle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sea Battle

This is a command-line game called Sea Battle written in C++. It took 5 months to build and allows you to play against CPU.

Game Overview

At the start of the game, you set your ground and ship orientation. If you don't like this orientation of ships, you can press 1 and the game will create another random ground with the same ships but in different places and orientations. Once you are okay with the new ground, you can proceed to the next menu where you can buy things like air defense, bomber, fighter, radar, and more. You have a random amount of money to spend and must choose what to buy with your money. You can view the aircraft information before making a purchase and there is a short demonstration of each item.

After you have purchased your equipment, you can go to the "advanced settings" and access features like becoming rich, showing your opponent's ground, or letting the opponent only play. Be sure to check there! You can then confirm the layout and start playing the game.

In the game menu, you will see your ground and ships on the left and your opponent's hidden ground on the right. You can use the equipment that you purchased in the last menu by selecting "use equipment" and then selecting what you want to use. A description of how to use the equipment will appear on the bottom of the page when you select it. If you destroy part of your opponent's ship, you gain an additional round and can play again. If you cannot hit your opponent's ship, your opponent will play. The opponent does not have any equipment.

If you run out of equipment or do not want to use it, you can bomb one block of your opponent's ground. After successfully sinking a ship, meaning every block of the ship gets hit, the ship and blocks next to it will become revealed. You cannot hit reveal blocks twice. The game base (ground) for you and your opponent is 10x10. The first player to destroy every ship of the other player wins.

Screenshots

  • First Menu:

    Buy Menu Screenshot
  • Buy Menu:

    Buy Menu Screenshot
  • Game Menu:

    Game Menu Screenshot

How to Play

To play the game, open Sea Battle v1.0.0.exe or download the code and run it in a C++ compiler. Follow the instructions on the screen to set up your ground, purchase equipment, and play against your opponent.

Good luck and have fun playing!

About

Thrilling C++ command-line game with strategic battles against CPU

Topics

Resources

Stars

Watchers

Forks

Languages