14/1 game detail view #15

Closed
opened 2025-06-20 10:14:49 +02:00 by froxxxy · 8 comments
Owner

separate view and inputs for 14/1 games

separate view and inputs for 14/1 games
Collaborator

Based on the detailed requirements in dev/14.1.rules, here is a proposed phased implementation plan:

Implementation Plan for 14.1 Endless Scoring

Phase 1: Core Game Setup & Scoring

  • Player Management: UI to enter names for Player 1 and Player 2, and the target score for the match.
  • Basic Scoring:
    • Display scores for both players.
    • Buttons to add points for each player.
    • Logic to switch turns between players after a missed shot or safety.
  • Game State: Clearly indicate whose turn it is.

Phase 2: Foul Implementation

  • Standard Fouls:
    • Button to register a standard foul (-1 point).
    • Implement a foul counter for each player.
  • Break Fouls: Logic for applying a -2 point penalty for an illegal break.
  • Three Consecutive Fouls:
    • When a player commits a third consecutive foul, apply the -15 point penalty (for a total of -16 for that foul).
    • Reset the player's consecutive foul counter to zero after the penalty is applied or after a successful shot.
    • Display a warning when a player has two consecutive fouls.

Phase 3: Advanced Game Flow

  • Call Shot & Safety:
    • Implement a "Safety" button. When a safety is played, any pocketed balls are re-spotted and the turn passes to the opponent.
  • Re-spotting Balls: Functionality to handle re-spotting balls that were pocketed during a foul or a safety.
  • Ball in Hand:
    • Indicate when a player has "ball in hand."
    • Distinguish between "ball in hand" anywhere on the table and "ball in hand" behind the headstring.

Phase 4: Re-Rack Logic (Complex)

  • This is the most challenging feature.
  • Develop a UI (possibly a visual diagram or a guided questionnaire) to determine the positions of the 15th (last) object ball and the cue ball.
  • Implement the logic from the official rules to determine where to place the cue ball and the 15th ball for the next shot.
  • Handle all special re-rack scenarios correctly.

Phase 5: Quality of Life & Extra Features

  • Undo Function: A crucial feature to correct mistakes in scoring or foul entry.
  • Game Log: A history of shots, pots, and fouls for review.
  • Shot Clock: An optional shot timer to enforce timed play.
  • Special Game Actions: Buttons for "Forfeit," "Time Out," and declaring a "Stalemate."
  • Help/Rules: An in-app reference for key rules, especially around fouls and re-racking.

This plan structures the work from basic functionality to the more complex and nuanced rules of 14.1 Endless.

Based on the detailed requirements in `dev/14.1.rules`, here is a proposed phased implementation plan: ### Implementation Plan for 14.1 Endless Scoring #### Phase 1: Core Game Setup & Scoring - **Player Management**: UI to enter names for Player 1 and Player 2, and the target score for the match. - **Basic Scoring**: - Display scores for both players. - Buttons to add points for each player. - Logic to switch turns between players after a missed shot or safety. - **Game State**: Clearly indicate whose turn it is. #### Phase 2: Foul Implementation - **Standard Fouls**: - Button to register a standard foul (-1 point). - Implement a foul counter for each player. - **Break Fouls**: Logic for applying a -2 point penalty for an illegal break. - **Three Consecutive Fouls**: - When a player commits a third consecutive foul, apply the -15 point penalty (for a total of -16 for that foul). - Reset the player's consecutive foul counter to zero after the penalty is applied or after a successful shot. - Display a warning when a player has two consecutive fouls. #### Phase 3: Advanced Game Flow - **Call Shot & Safety**: - Implement a "Safety" button. When a safety is played, any pocketed balls are re-spotted and the turn passes to the opponent. - **Re-spotting Balls**: Functionality to handle re-spotting balls that were pocketed during a foul or a safety. - **Ball in Hand**: - Indicate when a player has "ball in hand." - Distinguish between "ball in hand" anywhere on the table and "ball in hand" behind the headstring. #### Phase 4: Re-Rack Logic (Complex) - This is the most challenging feature. - Develop a UI (possibly a visual diagram or a guided questionnaire) to determine the positions of the 15th (last) object ball and the cue ball. - Implement the logic from the official rules to determine where to place the cue ball and the 15th ball for the next shot. - Handle all special re-rack scenarios correctly. #### Phase 5: Quality of Life & Extra Features - **Undo Function**: A crucial feature to correct mistakes in scoring or foul entry. - **Game Log**: A history of shots, pots, and fouls for review. - **Shot Clock**: An optional shot timer to enforce timed play. - **Special Game Actions**: Buttons for "Forfeit," "Time Out," and declaring a "Stalemate." - **Help/Rules**: An in-app reference for key rules, especially around fouls and re-racking. This plan structures the work from basic functionality to the more complex and nuanced rules of 14.1 Endless.
Author
Owner

Notes

Based on the detailed requirements in dev/14.1.rules, here is a proposed phased implementation plan:

Implementation Plan for 14.1 Endless Scoring

Phase 1: Core Game Setup & Scoring

  • Player Management: UI to enter names for Player 1 and Player 2, and the target score for the match.
  • we have this already
  • Basic Scoring:
    • Display scores for both players.
  • start with a clone of already existing game view
-   Buttons to add points for each player.
-   Logic to switch turns between players after a missed shot or safety.
  • in 14.1 players arent used to set points but at the end of their turn the count the remaining balls on table. let users input this and calculate scores from this. with this method there is also a need for input of re-rack actions (+14/+15 balls) and a need for combining these inputs with occured fouls.
  • Game State: Clearly indicate whose turn it is.

Phase 2: Foul Implementation

  • Standard Fouls:
    • Button to register a standard foul (-1 point).
    • Implement a foul counter for each player.
  • Break Fouls: Logic for applying a -2 point penalty for an illegal break.
  • Three Consecutive Fouls:
    • When a player commits a third consecutive foul, apply the -15 point penalty (for a total of -16 for that foul).
    • Reset the player's consecutive foul counter to zero after the penalty is applied or after a successful shot.
    • Display a warning when a player has two consecutive fouls.
  • sounds good

Phase 3: Advanced Game Flow

  • Call Shot & Safety:
    • Implement a "Safety" button. When a safety is played, any pocketed balls are re-spotted and the turn passes to the opponent.
  • Re-spotting Balls: Functionality to handle re-spotting balls that were pocketed during a foul or a safety.
  • Ball in Hand:
    • Indicate when a player has "ball in hand."
    • Distinguish between "ball in hand" anywhere on the table and "ball in hand" behind the headstring.
  • we dont need all of these phase 3 items

Phase 4: Re-Rack Logic (Complex)

  • This is the most challenging feature.
  • Develop a UI (possibly a visual diagram or a guided questionnaire) to determine the positions of the 15th (last) object ball and the cue ball.
  • Implement the logic from the official rules to determine where to place the cue ball and the 15th ball for the next shot.
  • Handle all special re-rack scenarios correctly.
  • no need for this. we just need to handle re-rack for counting, no other details needed

Phase 5: Quality of Life & Extra Features

  • Undo Function: A crucial feature to correct mistakes in scoring or foul entry.
  • important
  • Game Log: A history of shots, pots, and fouls for review.
  • important. also needs to be reviewable later. and needs to contain average pots per turn and maximum potting series per player.
  • Shot Clock: An optional shot timer to enforce timed play.
  • not needed. ignore.
  • Special Game Actions: Buttons for "Forfeit," "Time Out," and declaring a "Stalemate."
  • only forfeit needed.
  • Help/Rules: An in-app reference for key rules, especially around fouls and re-racking.
  • not needed, will be implemented later. ignore this.

This plan structures the work from basic functionality to the more complex and nuanced rules of 14.1 Endless.

Notes > Based on the detailed requirements in `dev/14.1.rules`, here is a proposed phased implementation plan: > > ### Implementation Plan for 14.1 Endless Scoring > > #### Phase 1: Core Game Setup & Scoring > - **Player Management**: UI to enter names for Player 1 and Player 2, and the target score for the match. - we have this already > - **Basic Scoring**: > - Display scores for both players. - start with a clone of already existing game view > - Buttons to add points for each player. > - Logic to switch turns between players after a missed shot or safety. - in 14.1 players arent used to set points but at the end of their turn the count the remaining balls on table. let users input this and calculate scores from this. with this method there is also a need for input of re-rack actions (+14/+15 balls) and a need for combining these inputs with occured fouls. > - **Game State**: Clearly indicate whose turn it is. > > #### Phase 2: Foul Implementation > - **Standard Fouls**: > - Button to register a standard foul (-1 point). > - Implement a foul counter for each player. > - **Break Fouls**: Logic for applying a -2 point penalty for an illegal break. > - **Three Consecutive Fouls**: > - When a player commits a third consecutive foul, apply the -15 point penalty (for a total of -16 for that foul). > - Reset the player's consecutive foul counter to zero after the penalty is applied or after a successful shot. > - Display a warning when a player has two consecutive fouls. > - sounds good > #### Phase 3: Advanced Game Flow > - **Call Shot & Safety**: > - Implement a "Safety" button. When a safety is played, any pocketed balls are re-spotted and the turn passes to the opponent. > - **Re-spotting Balls**: Functionality to handle re-spotting balls that were pocketed during a foul or a safety. > - **Ball in Hand**: > - Indicate when a player has "ball in hand." > - Distinguish between "ball in hand" anywhere on the table and "ball in hand" behind the headstring. > - we dont need all of these phase 3 items > #### Phase 4: Re-Rack Logic (Complex) > - This is the most challenging feature. > - Develop a UI (possibly a visual diagram or a guided questionnaire) to determine the positions of the 15th (last) object ball and the cue ball. > - Implement the logic from the official rules to determine where to place the cue ball and the 15th ball for the next shot. > - Handle all special re-rack scenarios correctly. > - no need for this. we just need to handle re-rack for counting, no other details needed - > #### Phase 5: Quality of Life & Extra Features > - **Undo Function**: A crucial feature to correct mistakes in scoring or foul entry. - important > - **Game Log**: A history of shots, pots, and fouls for review. - important. also needs to be reviewable later. and needs to contain average pots per turn and maximum potting series per player. > - **Shot Clock**: An optional shot timer to enforce timed play. - not needed. ignore. > - **Special Game Actions**: Buttons for "Forfeit," "Time Out," and declaring a "Stalemate." - only forfeit needed. > - **Help/Rules**: An in-app reference for key rules, especially around fouls and re-racking. - not needed, will be implemented later. ignore this. > > This plan structures the work from basic functionality to the more complex and nuanced rules of 14.1 Endless.
Collaborator

Excellent feedback. Based on your notes, here is a revised and more focused implementation plan.

Revised Implementation Plan for 14.1 Endless

This updated plan incorporates feedback to streamline the features and align with the typical 14.1 scoring method.

Phase 1: Foundation (Clone and Adapt)

  • Clone Existing Game View: Start by cloning the UI from an existing game mode to ensure consistency.
  • Player Management: The existing player name and target score input fields will be used.
  • Turn-Based Input:
    • Instead of adding points per ball, create an input field for the current player to enter the number of balls remaining on the table at the end of their turn.
    • The app will calculate the score for that turn based on the difference from the previous state (15 balls or the last player's remaining ball count).
  • Turn Indicator: A clear visual indicator for whose turn it is.

Phase 2: Scoring and Re-Rack Logic

  • Score Calculation:
    • Calculate points for a turn: (Balls at start of turn) - (Balls at end of turn).
    • The initial state is 15 balls.
  • Re-Rack Input:
    • Add buttons for a player to signal a re-rack (+14 balls) or a full re-rack after pocketing all 15 balls (+15 balls).
    • This input will adjust the "balls at start of turn" for the calculation.
  • Foul Integration: The score for a turn must be adjusted by any fouls committed. For example: Score = (Calculated pots) - (Foul penalties).

Phase 3: Foul System

  • Standard Foul: Button to register a standard foul (-1 point).
  • Break Foul: Button to register a break foul (-2 points).
  • Consecutive Fouls:
    • Track consecutive fouls for each player.
    • Display a warning at 2 consecutive fouls.
    • On the 3rd consecutive foul, apply a -15 point penalty (in addition to the -1 for the foul itself) and reset the counter. The counter also resets on any legal shot.

Phase 4: Core Features & Game Log

  • Undo Function: Implement a robust "Undo" button to revert the last scoring entry, foul, or re-rack action. This is critical for usability.
  • Forfeit: A button to allow a player to forfeit the game.
  • Detailed Game Log:
    • Log every turn, including balls potted, fouls, and total score for the turn.
    • This log must be saved and reviewable after the game.
    • Calculate and display post-game statistics:
      • Average pots per turn for each player.
      • Highest run (maximum potting series) for each player.
Excellent feedback. Based on your notes, here is a revised and more focused implementation plan. ### Revised Implementation Plan for 14.1 Endless This updated plan incorporates feedback to streamline the features and align with the typical 14.1 scoring method. #### Phase 1: Foundation (Clone and Adapt) - **Clone Existing Game View**: Start by cloning the UI from an existing game mode to ensure consistency. - **Player Management**: The existing player name and target score input fields will be used. - **Turn-Based Input**: - Instead of adding points per ball, create an input field for the current player to enter the number of balls *remaining* on the table at the end of their turn. - The app will calculate the score for that turn based on the difference from the previous state (15 balls or the last player's remaining ball count). - **Turn Indicator**: A clear visual indicator for whose turn it is. #### Phase 2: Scoring and Re-Rack Logic - **Score Calculation**: - Calculate points for a turn: `(Balls at start of turn) - (Balls at end of turn)`. - The initial state is 15 balls. - **Re-Rack Input**: - Add buttons for a player to signal a re-rack (+14 balls) or a full re-rack after pocketing all 15 balls (+15 balls). - This input will adjust the "balls at start of turn" for the calculation. - **Foul Integration**: The score for a turn must be adjusted by any fouls committed. For example: `Score = (Calculated pots) - (Foul penalties)`. #### Phase 3: Foul System - **Standard Foul**: Button to register a standard foul (-1 point). - **Break Foul**: Button to register a break foul (-2 points). - **Consecutive Fouls**: - Track consecutive fouls for each player. - Display a warning at 2 consecutive fouls. - On the 3rd consecutive foul, apply a -15 point penalty (in addition to the -1 for the foul itself) and reset the counter. The counter also resets on any legal shot. #### Phase 4: Core Features & Game Log - **Undo Function**: Implement a robust "Undo" button to revert the last scoring entry, foul, or re-rack action. This is critical for usability. - **Forfeit**: A button to allow a player to forfeit the game. - **Detailed Game Log**: - Log every turn, including balls potted, fouls, and total score for the turn. - This log must be saved and reviewable after the game. - Calculate and display post-game statistics: - Average pots per turn for each player. - Highest run (maximum potting series) for each player.
Collaborator

I have broken down the implementation plan into the following sub-tasks. I will work on them in this order:

  • Phase 1: #18 - Foundation and Turn-Based Input
  • Phase 2: #19 - Advanced Scoring and Re-Rack Logic
  • Phase 3: #20 - Comprehensive Foul System
  • Phase 4: #21 - Undo, Forfeit, and Game Log
I have broken down the implementation plan into the following sub-tasks. I will work on them in this order: - **Phase 1:** #18 - Foundation and Turn-Based Input - **Phase 2:** #19 - Advanced Scoring and Re-Rack Logic - **Phase 3:** #20 - Comprehensive Foul System - **Phase 4:** #21 - Undo, Forfeit, and Game Log
Collaborator

Phase 4 has been created as issue #22.

Phase 4 has been created as issue #22.
Author
Owner
  • game creation score selection
  • foul counting + turn
  • view (log down, active player)
  • "no score"
  • counting re-rack as potted
  • racking graphics feature
* game creation score selection * foul counting + turn * view (log down, active player) * "no score" * counting re-rack as potted * racking graphics feature
Author
Owner
  • undefined in game list
* undefined in game list
Author
Owner
  • rematch
* rematch
Sign in to join this conversation.
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: froxxxy/bscscore#15