Skip to content

[US-02] Alternating shooting with feedback

Ivan Esau requested to merge feature/issue-2-us-02-alternating-shooting-wit into master

Description

Implements alternating shooting functionality for the Battleship game with hit/miss feedback and turn-based gameplay.

Changes

  • Added GameController with turn-based shooting logic
  • Added Board class with shot processing and hit detection
  • Added Player class to manage player state and ships
  • Added Ship class with damage tracking
  • Added Coordinate class for grid positions
  • Added comprehensive test coverage for shooting functionality

Features Implemented

Players take turns shooting Hit/miss feedback with ship damage tracking Prevention of duplicate shots at same coordinates Game state management (setup, player turns, game over) Ship sinking detection

Acceptance Criteria Validation

  • When firing at A1 for the first time, a message should appear showing hit or miss, and that field should become marked
  • When the same field is targeted again, the shot should not go through, and the next player should then act
  • After one shot cycle finishes, the control changes so that only the other player can continue

Current Status

⚠️ PIPELINE FAILED - Test compilation errors detected

  • Ship constructor signature mismatch in tests
  • Missing place() method calls in test setup
  • Requires test fixes before merge

Technical Details

  • Java 21 with Maven build system
  • JUnit 5 for testing
  • MVC architecture pattern
  • Comprehensive test coverage for core shooting logic

Closes #2

Merge request reports

Loading