add 支持保存自定义配置
add 新增 2 种难度
This commit is contained in:
		| @@ -1,8 +1,15 @@ | ||||
| <template> | ||||
|   <div class="my-ad"> | ||||
|     <a href="https://space.bilibili.com/12890453/"> 欢迎关注程序员鱼皮 </a> | ||||
|     <div>广告位招租(狗头)</div> | ||||
|     <a href="https://github.com/liyupi/yulegeyu" target="_blank"> | ||||
|       <div style="background: rgba(0, 0, 0, 0.8); padding: 12px"> | ||||
|         <github-outlined /> | ||||
|         代码完全开源,欢迎 star | ||||
|       </div> | ||||
|     </a> | ||||
|     <!-- <a href="https://space.bilibili.com/12890453/"> 欢迎关注程序员鱼皮 </a>--> | ||||
|   </div> | ||||
| </template> | ||||
| <script setup lang="ts"></script> | ||||
| <script setup lang="ts"> | ||||
| import { GithubOutlined } from "@ant-design/icons-vue"; | ||||
| </script> | ||||
| <style></style> | ||||
|   | ||||
| @@ -129,3 +129,47 @@ export const lunaticGameConfig: GameConfigType = { | ||||
|   // 动物数组 | ||||
|   animals, | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * 天狱难度 | ||||
|  */ | ||||
| export const skyGameConfig: GameConfigType = { | ||||
|   // 槽容量 | ||||
|   slotNum: 7, | ||||
|   // 需要多少个一样块的才能合成 | ||||
|   composeNum: 3, | ||||
|   // 动物类别数 | ||||
|   typeNum: 16, | ||||
|   // 每层块数(大致) | ||||
|   levelBlockNum: 24, | ||||
|   // 边界收缩步长 | ||||
|   borderStep: 2, | ||||
|   // 总层数(最小为 2) | ||||
|   levelNum: 12, | ||||
|   // 随机区块数(数组长度代表随机区数量,值表示每个随机区生产多少块) | ||||
|   randomBlocks: [8, 8], | ||||
|   // 动物数组 | ||||
|   animals, | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * 羊了个羊难度 | ||||
|  */ | ||||
| export const yangGameConfig: GameConfigType = { | ||||
|   // 槽容量 | ||||
|   slotNum: 7, | ||||
|   // 需要多少个一样块的才能合成 | ||||
|   composeNum: 3, | ||||
|   // 动物类别数 | ||||
|   typeNum: 18, | ||||
|   // 每层块数(大致) | ||||
|   levelBlockNum: 28, | ||||
|   // 边界收缩步长 | ||||
|   borderStep: 3, | ||||
|   // 总层数(最小为 2) | ||||
|   levelNum: 15, | ||||
|   // 随机区块数(数组长度代表随机区数量,值表示每个随机区生产多少块) | ||||
|   randomBlocks: [8, 8], | ||||
|   // 动物数组 | ||||
|   animals, | ||||
| }; | ||||
|   | ||||
| @@ -9,6 +9,7 @@ | ||||
|       <div v-if="gameStatus === 3" style="text-align: center"> | ||||
|         <h2>恭喜,你赢啦!🎉</h2> | ||||
|         <img alt="程序员鱼皮" src="../assets/kunkun.png" /> | ||||
|         <my-ad style="margin-top: 16px" /> | ||||
|       </div> | ||||
|     </a-row> | ||||
|     <!-- 分层选块 --> | ||||
| @@ -77,6 +78,7 @@ | ||||
| import useGame from "../core/game"; | ||||
| import { onMounted } from "vue"; | ||||
| import { useRouter } from "vue-router"; | ||||
| import MyAd from "../components/MyAd.vue"; | ||||
|  | ||||
| const router = useRouter(); | ||||
|  | ||||
|   | ||||
| @@ -30,15 +30,24 @@ | ||||
|     > | ||||
|       地狱模式 | ||||
|     </a-button> | ||||
|     <a-button block style="margin-bottom: 16px" @click="() => toGamePage()"> | ||||
|       自定义 | ||||
|     <a-button | ||||
|       block | ||||
|       style="margin-bottom: 16px" | ||||
|       @click="toGamePage(skyGameConfig)" | ||||
|     > | ||||
|       天域模式 | ||||
|     </a-button> | ||||
|     <a href="https://github.com/liyupi/yulegeyu" target="_blank"> | ||||
|       <div style="background: rgba(0, 0, 0, 0.8); padding: 12px"> | ||||
|         <github-outlined /> | ||||
|         代码完全开源,欢迎 star | ||||
|       </div> | ||||
|     </a> | ||||
|     <a-button | ||||
|       block | ||||
|       style="margin-bottom: 16px" | ||||
|       @click="toGamePage(yangGameConfig)" | ||||
|     > | ||||
|       羊了个羊模式 | ||||
|     </a-button> | ||||
|     <a-button block style="margin-bottom: 16px" @click="() => toGamePage()"> | ||||
|       自定义 🔥 | ||||
|     </a-button> | ||||
|     <my-ad /> | ||||
|     <div class="footer"> | ||||
|       鱼了个鱼 ©2022 by | ||||
|       <a href="https://github.com/liyupi" target="_blank" style="color: #fff"> | ||||
| @@ -58,14 +67,16 @@ | ||||
|  | ||||
| <script setup lang="ts"> | ||||
| import { useRouter } from "vue-router"; | ||||
| import { GithubOutlined } from "@ant-design/icons-vue"; | ||||
| import { | ||||
|   easyGameConfig, | ||||
|   middleGameConfig, | ||||
|   hardGameConfig, | ||||
|   lunaticGameConfig, | ||||
|   skyGameConfig, | ||||
|   yangGameConfig, | ||||
| } from "../core/gameConfig"; | ||||
| import { useGlobalStore } from "../core/globalStore"; | ||||
| import MyAd from "../components/MyAd.vue"; | ||||
|  | ||||
| const router = useRouter(); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user