@qpjoy/electron-game-suduku
v0.1.2
Published
Suduku game for the Qpjoy Electron game marketplace.
Downloads
2,980
Maintainers
Readme
@qpjoy/electron-game-suduku
Suduku is a local-first Electron game package for the Qpjoy game marketplace.
It is published as a game package with both:
qpjoyGame: game metadata for the marketplace game board.qpjoyPlugin: compatibility with the current plugin installer/runtime. The active plugin exposeslaunch()for试玩.
Modes
7x7: row/column unique Latin-Sudoku. Digits1-7must appear once in every row and column.9x9: standard Sudoku. Digits1-9must appear once in every row, column, and3x3box.
Scoring
Scores are awarded only when a round is completed.
| Mode | Max score | Minimum completed score | Time cap |
| --- | ---: | ---: | ---: |
| 7x7 | 700 | 120 | 5 minutes |
| 9x9 | 1200 | 250 | 15 minutes |
The score linearly decreases between the max score and minimum completed score. Once elapsed time is greater than the cap, every completed round receives the minimum score. A filled but incorrect board is highlighted and receives no score; a correct board saves the score and starts the next round automatically.
Player Identity
Identity resolution order:
- Marketplace launch context from
QPJOY_GAME_CONTEXT. - Marketplace user env vars
QPJOY_MARKET_USER_IDandQPJOY_MARKET_USER_NAME. - Existing local SQLite player record.
- Prompt before the first round. The entered name receives a four-digit suffix, such as
Joy#4821.
Storage
Local scores are stored in SQLite under Electron's app.getPath("userData").
When launched by @qpjoy/electron-market, scores are written into the shared marketplace SQLite database (electron_game_players / electron_game_scores) so they can be queried together with installed plugins, marketplace entries, and plugin logs. Standalone development still falls back to a local suduku.sqlite file.
When the marketplace host is logged in and a marketplace server is configured, completed rounds are also synced to electron-server as per-user high scores. The server stores the best score per user/game/mode in Postgres when DATABASE_URL is enabled, and the game shows the server ranking when it is reachable.
Development
npm install
npm startRun syntax and registry checks from electron-game/:
npm run check