add 支持保存自定义配置

add 新增 2 种难度
This commit is contained in:
yupi 2022-09-18 00:20:52 +08:00
parent e57adbc824
commit 0cf6b3a9c2
4 changed files with 76 additions and 12 deletions

View File

@ -1,8 +1,15 @@
<template> <template>
<div class="my-ad"> <div class="my-ad">
<a href="https://space.bilibili.com/12890453/"> 欢迎关注程序员鱼皮 </a> <a href="https://github.com/liyupi/yulegeyu" target="_blank">
<div>广告位招租狗头</div> <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> </div>
</template> </template>
<script setup lang="ts"></script> <script setup lang="ts">
import { GithubOutlined } from "@ant-design/icons-vue";
</script>
<style></style> <style></style>

View File

@ -129,3 +129,47 @@ export const lunaticGameConfig: GameConfigType = {
// 动物数组 // 动物数组
animals, 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,
};

View File

@ -9,6 +9,7 @@
<div v-if="gameStatus === 3" style="text-align: center"> <div v-if="gameStatus === 3" style="text-align: center">
<h2>恭喜你赢啦🎉</h2> <h2>恭喜你赢啦🎉</h2>
<img alt="程序员鱼皮" src="../assets/kunkun.png" /> <img alt="程序员鱼皮" src="../assets/kunkun.png" />
<my-ad style="margin-top: 16px" />
</div> </div>
</a-row> </a-row>
<!-- 分层选块 --> <!-- 分层选块 -->
@ -77,6 +78,7 @@
import useGame from "../core/game"; import useGame from "../core/game";
import { onMounted } from "vue"; import { onMounted } from "vue";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import MyAd from "../components/MyAd.vue";
const router = useRouter(); const router = useRouter();

View File

@ -30,15 +30,24 @@
> >
地狱模式 地狱模式
</a-button> </a-button>
<a-button block style="margin-bottom: 16px" @click="() => toGamePage()"> <a-button
自定义 block
style="margin-bottom: 16px"
@click="toGamePage(skyGameConfig)"
>
天域模式
</a-button> </a-button>
<a href="https://github.com/liyupi/yulegeyu" target="_blank"> <a-button
<div style="background: rgba(0, 0, 0, 0.8); padding: 12px"> block
<github-outlined /> style="margin-bottom: 16px"
代码完全开源欢迎 star @click="toGamePage(yangGameConfig)"
</div> >
</a> 羊了个羊模式
</a-button>
<a-button block style="margin-bottom: 16px" @click="() => toGamePage()">
自定义 🔥
</a-button>
<my-ad />
<div class="footer"> <div class="footer">
鱼了个鱼 ©2022 by 鱼了个鱼 ©2022 by
<a href="https://github.com/liyupi" target="_blank" style="color: #fff"> <a href="https://github.com/liyupi" target="_blank" style="color: #fff">
@ -58,14 +67,16 @@
<script setup lang="ts"> <script setup lang="ts">
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { GithubOutlined } from "@ant-design/icons-vue";
import { import {
easyGameConfig, easyGameConfig,
middleGameConfig, middleGameConfig,
hardGameConfig, hardGameConfig,
lunaticGameConfig, lunaticGameConfig,
skyGameConfig,
yangGameConfig,
} from "../core/gameConfig"; } from "../core/gameConfig";
import { useGlobalStore } from "../core/globalStore"; import { useGlobalStore } from "../core/globalStore";
import MyAd from "../components/MyAd.vue";
const router = useRouter(); const router = useRouter();