A modern, responsive, and interactive Battleships game built with Vanilla JavaScript and SCSS. Test your tactical skills against an AI opponent in this variation of the classical Battleship game.
- Strategic Gameplay: Classic 10x10 grid combat with intuitive ship placement.
- Modern UI: Responsive layout with smooth animations and nice hover effects.
- Theme Support: Fully integrated Light and Dark modes.
- Dynamic Feedback: Visual indicators for hits, misses, and sunken ships.
- Smart Boarding: Automatic marking of surrounding areas once a ship is confirmed sunk.
| Ship Placement | In-Game Action |
|---|---|
![]() |
![]() |
| Alforitm for random placement of ships | Game process - buffer zones around ships automatically fill up |
- Node.js (v14 or higher)
- npm (v6 or higher)
-
Clone the repository:
git clone https://github.com/yourusername/battleships.git cd battleships -
Install dependencies:
npm install
Run the development server with Hot Module Replacement:
npm run serveCreate an optimized bundle in the dist/ folder:
npm run build- JavaScript (ES6+) - Core logic and game state management.
- Sass (SCSS) - Advanced styling and theme management.
- Webpack - Module bundling and asset optimization.
- Jest - Comprehensive unit testing for game mechanics.
- Babel - JavaScript transpilation for cross-browser compatibility.
The project uses Jest for automated testing of the Ship and Gameboard classes.
npm test
