feat (solos) add a play again button when the game is over.

Open
#5,549 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
frontend, game-dev

Research direction

Start with WinModel.ts and Main.ts, following the existing 1v1 and 2v2 requeue lifecycle. Verify that solo wins and deaths show the button, preserve the stated solo data while generating new identifiers, and trigger the normal fresh-game flow. Test the behavior in the browser and on Steam.

Written by the indexing model from the issue text.

Description

not-approved

Is your feature request related to a problem? Please describe.
Add a play again button after a player has either died or has won a game in solo mode.

Describe the solution you'd like

WinModel.ts

  • WinModel displays a play again button if its solos.
  • Copies solo config and map settings, but generates a new game ID, client ID and timestamp.
  • Send a matchmaking-requeue event with mode = "solo"

Main.ts

  • The requeue handler which is used for 1v1 and 2v2, is now repurposed to also include "solo".
  • Stores the restart data in sessionStorage using a new const key.
  • uses the same lifecycle for the window as requeuing in 1v1 or 2v2.
  • The saved data is deleted from sessionStorage
  • Normal join-lobby event runs to start a fresh solo game.

Assignment

  • I'd like to be assigned to this issue and work on it myself

(already complete)

Should work on steam, however would recommend testing.

Image Image
Dominant language
TypeScript
Stars
2.7k
Forks
1.4k
Avg merge
16h 28m
Merged PRs (30d)
332

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openfrontio/OpenFrontIO

All issues in openfrontio/OpenFrontIO

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.