Skip to content

Commit 2db450e

Browse files
committed
docs: add 2048
1 parent 6000cca commit 2db450e

6 files changed

Lines changed: 132 additions & 0 deletions

File tree

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@
1010
[submodule "tinker-third-party"]
1111
path = tinker-third-party
1212
url = https://github.com/liriliri/tinker-third-party.git
13+
[submodule "tinker-games"]
14+
path = tinker-games
15+
url = https://github.com/liriliri/tinker-games.git

docs/.vitepress/sidebar.mts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,16 @@ export const enSidebar = [
395395
},
396396
],
397397
},
398+
{
399+
text: 'Official Games',
400+
collapsed: false,
401+
items: [
402+
{
403+
text: '2048',
404+
link: '/guide/official-games/2048',
405+
},
406+
],
407+
},
398408
{
399409
text: 'Third-Party Plugins',
400410
collapsed: false,
@@ -864,6 +874,16 @@ export const zhSidebar = [
864874
},
865875
],
866876
},
877+
{
878+
text: '官方游戏',
879+
collapsed: false,
880+
items: [
881+
{
882+
text: '2048',
883+
link: '/zh/guide/official-games/2048',
884+
},
885+
],
886+
},
867887
{
868888
text: '第三方插件',
869889
collapsed: false,

docs/guide/official-games/2048.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# tinker-2048
2+
3+
Join the numbers and get to the 2048 tile! A minimalist puzzle game for [TINKER](https://github.com/liriliri/tinker).
4+
5+
![Screenshot](https://raw.githubusercontent.com/liriliri/tinker-games/master/packages/tinker-2048/screenshot.png)
6+
7+
## Features
8+
9+
- **Endlessly replayable** — no two games are the same, every attempt is a fresh challenge
10+
- **Buttery smooth** — tiles glide and merge with satisfying animations and sound effects
11+
- **Play your way** — keyboard, touch, or gamepad, whatever feels right
12+
- **Never lose progress** — the game saves automatically, come back anytime
13+
- **Bilingual** — fully localized in English and Chinese
14+
15+
## Installation
16+
17+
Download and install [TINKER](https://tinker.liriliri.io/), then run:
18+
19+
```bash
20+
npm i -g tinker-2048
21+
```
22+
23+
## How to Play
24+
25+
1. Open the **2048** plugin in TINKER
26+
2. Slide the tiles in any direction — matching numbers **merge and double**
27+
3. Aim for the **2048 tile**, then push beyond to beat your high score
28+
4. Can't move? Game over. Hit **New Game** and try again
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# tinker-2048
2+
3+
合并数字,冲向 2048 方块!一款简约的 [TINKER](https://github.com/liriliri/tinker) 益智游戏插件。
4+
5+
![Screenshot](https://raw.githubusercontent.com/liriliri/tinker-games/master/packages/tinker-2048/screenshot.png)
6+
7+
## 特性
8+
9+
- **无限重玩** — 每局都是独一无二的挑战,永不重复
10+
- **丝滑流畅** — 方块滑动与合并伴随精美的动画和音效
11+
- **随心操控** — 键盘、触屏或手柄,想怎么玩就怎么玩
12+
- **永不丢失进度** — 游戏自动保存,随时回来继续
13+
- **双语支持** — 完整的中英文界面本地化
14+
15+
## 安装
16+
17+
下载并安装 [TINKER](https://tinker.liriliri.io/),然后运行:
18+
19+
```bash
20+
npm i -g tinker-2048
21+
```
22+
23+
## 玩法
24+
25+
1. 在 TINKER 中打开 **2048** 插件
26+
2. 向任意方向滑动方块 — 相同数字**合并并翻倍**
27+
3. 目标是合成 **2048 方块**,之后继续挑战更高分
28+
4. 无法移动?游戏结束。点击**新游戏**再来一局

skills/official-game/SKILL.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
name: official-game
3+
description: Add or update an official game plugin documentation page to tinker-docs from tinker-games.
4+
---
5+
6+
# Add or Update Official Game Plugin Documentation
7+
8+
When the user asks to add or update a game plugin doc (e.g. "add 2048 doc", "update minesweeper readme"), follow these steps:
9+
10+
## 1. Read plugin info
11+
12+
Read the plugin's `package.json` from `tinker-games/packages/tinker-<name>/package.json` to get:
13+
- `tinker.name` — used as the English sidebar item text
14+
- `tinker.locales.zh-CN.name` — used as the Chinese sidebar item text
15+
16+
Read the plugin's `README.md` from `tinker-games/packages/tinker-<name>/README.md` for content.
17+
18+
## 2. Create or update English doc
19+
20+
Create or update `docs/guide/official-games/<name>.md` based on the README content. Adjust install section to use a link to TINKER and a code block for the npm command.
21+
22+
## 3. Create or update Chinese doc
23+
24+
Create or update `docs/zh/guide/official-games/<name>.md` with the README content translated to Chinese. Keep technical terms (e.g. npm) untranslated.
25+
26+
## 4. Update sidebar config (add only)
27+
28+
If the plugin is new (not already in the sidebar), add an entry in `docs/.vitepress/sidebar.mts` to BOTH sidebar arrays:
29+
30+
- English sidebar (`enSidebar``Official Games` items array):
31+
```js
32+
{
33+
text: '<tinker.name value>',
34+
link: '/guide/official-games/<name>',
35+
},
36+
```
37+
38+
- Chinese sidebar (`zhSidebar``官方游戏` items array):
39+
```js
40+
{
41+
text: '<tinker.locales.zh-CN.name value>',
42+
link: '/zh/guide/official-games/<name>',
43+
},
44+
```
45+
46+
## Key rules
47+
48+
- The sidebar item `text` MUST come from `package.json`: English uses `tinker.name`, Chinese uses `tinker.locales.zh-CN.name` (if it exists, otherwise fall back to `tinker.name`)
49+
- The file name under `official-games/` should be the plugin name without the `tinker-` prefix (e.g. `tinker-2048``2048.md`)
50+
- The sidebar category is `Official Games` (EN) / `官方游戏` (ZH) with `collapsed: false`
51+
- Sidebar items MUST be sorted by plugin ID in alphabetical order (e.g. 2048 → cube → minesweeper)
52+
- Screenshot images should reference the raw GitHub URL from the README

tinker-games

Submodule tinker-games added at 0612d49

0 commit comments

Comments
 (0)