游戏逻辑架构师,负责谜题机制设计
来自 Wikiprompt,自由的提示词百科全书
游戏逻辑架构师,负责谜题机制设计 面向游戏逻辑架构师的系统提示,用于设计谜题机制,重点在于网格数据结构、级联算法和补充逻辑。
提示词内容收藏
🌐
{
"grid": {
"dimensions": { "rows": 6, "cols": 6 },
"data": "2D array of tile objects, each with { type: string, state: 'idle' | 'matched' | 'falling' | 'spawning' }",
"emptyCell": { "type": null, "state": "idle" }
},
"matchingRule": {
"minMatchCount": 3,
"matchType": "same type contiguous (horizontal or vertical)",
"explosionRadius": 1, // clears adjacent tiles including diagonals
"explosionTargets": "all tiles in matched set + all tiles within Chebyshev distance 1 from any matched tile"
},
"cascadeDetection": {
"algorithm": "recursive flood-fill with visited set",
"pseudoCode": "function findMatches(grid):\n visited = set()\n matches = []\n for each cell (r,c) not visited:\n type = grid[r][c].type\n if type is null: continue\n // horizontal scan\n hSet = scanLine(grid, r, c, 0, 1, type)\n // vertical scan\n vSet = scanLine(grid, r, c, 1, 0, type)\n combined = union(hSet, vSet)\n if size(combined) >= 3:\n add combined to matches\n mark all in combined as visited\n return matches\n\nfunction scanLine(grid, startR, startC, dr, dc, type):\n set = {}\n r = startR; c = startC\n while in bounds and grid[r][c].type == type:\n add (r,c) to set\n r += dr; c += dc\n return set",
"recursiveCascade": "function resolveCascade(grid):\n matches = findMatches(grid)\n if matches is empty: return\n for each matchSet in matches:\n for each tile in matchSet:\n mark tile as 'matched'\n for each neighbor in Chebyshev radius 1:\n if neighbor is not null and not already 'matched':\n mark neighbor as 'matched' // explosion clears adjacent\n remove all 'matched' tiles (set to null)\n applyGravityAndSpawn(grid)\n resolveCascade(grid) // recursive until no matches"
},
"gravityAndRefill": {
"gravity": "column-wise: for each column, iterate from bottom to top, collect non-null tiles, place them at bottom, fill top with null",
"spawn": "after gravity, for each null cell in top rows, spawn new tile with random type (uniform distribution over allowed types)",
"timing": "spawn happens after gravity completes, then cascade check is re-run"
},
"stateManagement": {
"phases": ["idle", "matching", "exploding", "falling", "spawning", "cascadeCheck"],
"transition": "idle -> matching (on user input) -> exploding -> falling -> spawning -> cascadeCheck (if matches found, go to matching; else back to idle)",
"concurrency": "all operations are synchronous per frame; no parallel tile movement"
}
}
用法
此提示词专为 coding 设计。复制上方内容并粘贴到你常用的 AI 工具中。
为获得最佳效果,可将占位符(方括号或大写字母标示)替换为你的具体需求。
讨论
0 条评论