Skip to content

Oliverr48/battleships

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Battleship Game

A networked multiplayer implementation of the classic Battleship game with enhanced features.

Core Features

  • Multiplayer Network Play: Play against other players over a network connection
  • Spectator Mode: Watch ongoing games between other players
  • Chat System: In-game chat with other players
  • Secure Protocol: Custom secure protocol for game communication
  • Reconnection System: Ability to reconnect to ongoing games if disconnected

New Enhancements

The following enhancements have been added to the game:

Multiple Game Modes

The game now supports different gameplay modes:

  • Classic Mode: Traditional Battleship with standard rules
  • Quick Game Mode: Smaller board, fewer ships for faster games
  • Salvo Mode: Fire multiple shots per turn equal to your remaining ships
  • Advanced Mode: Larger board with diagonal ship placement allowed

Statistics Tracking

Player performance statistics are now tracked across games:

  • Win/loss record
  • Ships sunk
  • Shot accuracy
  • Rank progression based on performance
  • Per-game mode statistics

Game Replay System

Full game replay functionality:

  • Games are automatically recorded
  • Replay viewer with step-by-step playback
  • Auto-play mode with adjustable speed
  • Jump to specific moves in the game
  • Save and share replays with other players

Configurable Game Settings

New options for customizing the game:

  • Board size options (6x6, 8x8, 10x10, 12x12)
  • Custom ship configurations
  • Timeout settings
  • Server configuration

Files and Modules

  • battleship.py: Core game logic and data structures
  • server.py: Network server for handling multiplayer games
  • client.py: Client application for connecting to the server
  • game_settings.py: Configurable game parameters
  • stats_tracker.py: Player statistics tracking system
  • game_modes.py: Implementation of different game modes
  • game_replay.py: Game recording and replay functionality
  • replay_viewer.py: Command-line utility for viewing game replays

How to Play

  1. Start the server:
python server.py
  1. Start the client:
python client.py
  1. Follow the prompts to enter your username and connect to a game.

  2. Replay saved games:

python replay_viewer.py

Game Commands

  • Place ships: PLACE <coordinate> <orientation> <ship_name>
    • Example: PLACE A1 H BATTLESHIP
  • Fire at opponent: <coordinate>
    • Example: B5
  • Send chat message: CHAT <message>
  • View statistics: STATS
  • Select game mode: MODE <mode_name>
  • Help command: HELP

Game Modes

Mode Board Size Ships Special Features
Classic 10x10 5 ships Standard rules
Quick 6x6 3 ships Fast games
Salvo 10x10 5 ships Multiple shots per turn
Advanced 12x12 6 ships Diagonal ship placement

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages