v0.6: 深空巡航 Canvas 2D 实时玩法 + UI 偏移重叠修复
## 玩法拓展(回应用户: 玩法太单调/全是点点点) - 新增「深空巡航」Canvas 2D 全屏实时玩法 - 飞船操控(WASD/方向键/移动端虚拟摇杆) - 实时躲避陨石/虚空风暴,收集晶体/洞见/信标 - 到达星门通关,护盾归零失败 - 3层视差星空 + 粒子系统(尾焰/收集/碰撞/烟花) + 辉光 + 屏幕震动 - 奖励同步主游戏(grantCruiseReward) - 独立 localStorage 记录最高分/通关数 ## UI 修复(回应用户: 解析球左上偏移/成就小屏重叠) - DecodeArray 节点: 移除 Tailwind translate 与 inline transform 冲突 - AchievementsPanel: 移除固定 max-h, 改 flex-1 min-h-0 自适应 - page.tsx 布局: 小屏减小 min-h, 避免挤压重叠 ## 集成 - gameStore 新增 grantCruiseReward action - header 新增 amber 主题「巡航」按钮 + 全屏 CruiseMode 渲染 ## 文件 - src/lib/game/cruise.ts (新增, ~1008行) - src/components/game/CruiseMode.tsx (新增, ~1350行) - src/app/page.tsx (集成巡航入口) - src/store/gameStore.ts (grantCruiseReward action) - src/components/game/DecodeArray.tsx (节点偏移修复) - src/components/game/AchievementsPanel.tsx (小屏重叠修复) QA: lint 零错误; agent-browser+VLM 验证主界面无偏移+巡航玩法正常运行
This commit is contained in:
@@ -118,6 +118,9 @@ interface GameActions {
|
||||
// 深空信标奖励发放(v0.5)
|
||||
grantBeaconReward: (insights: number, contact: number) => void;
|
||||
|
||||
// 深空巡航奖励发放(v0.6 — 实时 Canvas 玩法)
|
||||
grantCruiseReward: (rewards: { crystals?: number; insights?: number; contact?: number }) => void;
|
||||
|
||||
// 派生
|
||||
canPrestige: () => boolean;
|
||||
}
|
||||
@@ -796,6 +799,19 @@ export const useGameStore = create<Store>()(
|
||||
contact: Math.min(100, s.contact + contact),
|
||||
});
|
||||
},
|
||||
|
||||
// 深空巡航:发放实时玩法奖励(v0.6)
|
||||
grantCruiseReward: (rewards) => {
|
||||
const s = get();
|
||||
const addCrystals = rewards.crystals ?? 0;
|
||||
const addInsights = rewards.insights ?? 0;
|
||||
const addContact = rewards.contact ?? 0;
|
||||
set({
|
||||
crystals: Math.min(s.crystalCap, s.crystals + addCrystals),
|
||||
insights: s.insights + Math.round(addInsights),
|
||||
contact: Math.min(100, s.contact + addContact),
|
||||
});
|
||||
},
|
||||
}),
|
||||
{
|
||||
name: "echo-nexus-save-v1",
|
||||
|
||||
Reference in New Issue
Block a user