Skip to content

tests: implement tests regarding time conditions #128

@quinteselena

Description

@quinteselena

The player loses the match if any of the following happens:

  • The timer reaches zero and the player has not connected the three sides of the board.
  • The opponent (bot) connects the three sides of the board before the player.

🔺 Win Condition
The player wins the match if:

They connect the three sides of the board before the timer reaches zero AND before the opponent connects their three sides.

Required Features

  1. Game End Detection
  • Detect when the player or the bot completes a winning connection.
  • Detect when the timer reaches zero.
  • Trigger the end‑of‑game state accordingly.
  1. UI Feedback
    When the match ends, the interface must display:
  • A congratulatory message if the player wins.
  • An encouraging message if the player loses.

Both outcomes must include two buttons:

  • Exit → Navigates to the main page.
  • Play Again → Navigates to the Game Preview screen.
  1. Data Persistence
    The result of the match (win or loss) must be stored in the database.
    This data will be used to:
  • Update the global ranking.
  • Display the match in the user's game history.

Acceptance Criteria

  • The game ends correctly under all win/loss conditions.
  • The correct message is shown depending on the outcome.
  • Exit and Play Again buttons work as expected.
  • Match results are saved and accessible for ranking and history.
  • No match can continue indefinitely.

Metadata

Metadata

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions