Commit 8fd33eda authored by Friends233's avatar Friends233

游戏配置修改

parent 74045287
...@@ -584,7 +584,7 @@ ...@@ -584,7 +584,7 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "6c6INC2LtG9YwqkWBjt02u" "_id": "37PIdiibtNhZXobCTUtIet"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",
...@@ -614,7 +614,7 @@ ...@@ -614,7 +614,7 @@
"_fillRange": 0, "_fillRange": 0,
"_isTrimmedMode": true, "_isTrimmedMode": true,
"_atlas": null, "_atlas": null,
"_id": "d65Lhj9FJJ4I8eQYf/QbmO" "_id": "d71+WIthJBJqUddrXKBzFC"
}, },
{ {
"__type__": "7c5ffhlHDpBpoDQ8wfKN7pu", "__type__": "7c5ffhlHDpBpoDQ8wfKN7pu",
...@@ -2352,7 +2352,7 @@ ...@@ -2352,7 +2352,7 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "79+sIBNDlBHqhcw4JNBIxi" "_id": "1depVa0mRBaoRbfvG4aN8y"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",
...@@ -2382,7 +2382,7 @@ ...@@ -2382,7 +2382,7 @@
"_fillRange": 0, "_fillRange": 0,
"_isTrimmedMode": true, "_isTrimmedMode": true,
"_atlas": null, "_atlas": null,
"_id": "31PE74OilEooE76EMkU4NK" "_id": "7enKgLYNlEC5/0N0VkvvYR"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
...@@ -2444,7 +2444,7 @@ ...@@ -2444,7 +2444,7 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "36YpA3yfhG17Fq1E7w7NSo" "_id": "68N97CYAFGBLg4BZNzq8u6"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",
...@@ -2474,7 +2474,7 @@ ...@@ -2474,7 +2474,7 @@
"_fillRange": 0, "_fillRange": 0,
"_isTrimmedMode": true, "_isTrimmedMode": true,
"_atlas": null, "_atlas": null,
"_id": "76q8Yv8oZGtLaKfU2iBo3c" "_id": "f3qq2OtWBGXKrMispHkjuX"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
...@@ -2536,7 +2536,7 @@ ...@@ -2536,7 +2536,7 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "96im0BxPREvIex+R75lT/4" "_id": "5ap/Tmj5NCMYxer3sY74tG"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",
...@@ -2566,7 +2566,7 @@ ...@@ -2566,7 +2566,7 @@
"_fillRange": 0, "_fillRange": 0,
"_isTrimmedMode": true, "_isTrimmedMode": true,
"_atlas": null, "_atlas": null,
"_id": "13gpac+txEtZ6iG22sjUqP" "_id": "2euSsdjftDGLmOlGoY/1vr"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
...@@ -2628,7 +2628,7 @@ ...@@ -2628,7 +2628,7 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "12NwMn6VpPrpNL+dtDVj9g" "_id": "0fQ5tBsUJPUJ342jbTq18N"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",
...@@ -2658,7 +2658,7 @@ ...@@ -2658,7 +2658,7 @@
"_fillRange": 0, "_fillRange": 0,
"_isTrimmedMode": true, "_isTrimmedMode": true,
"_atlas": null, "_atlas": null,
"_id": "7b3ltgcThBT6VduW5INK5H" "_id": "16m//oLoVC15Dj58sFnsY6"
}, },
{ {
"__type__": "7c5ffhlHDpBpoDQ8wfKN7pu", "__type__": "7c5ffhlHDpBpoDQ8wfKN7pu",
...@@ -4154,7 +4154,7 @@ ...@@ -4154,7 +4154,7 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "66QSfbIqZFcpTamwqou5Ho" "_id": "f3fJsGBvpAjpZZubT5D9VG"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",
...@@ -4184,7 +4184,7 @@ ...@@ -4184,7 +4184,7 @@
"_fillRange": 0, "_fillRange": 0,
"_isTrimmedMode": true, "_isTrimmedMode": true,
"_atlas": null, "_atlas": null,
"_id": "4ays2Z2tRMgZ5kS61diFIr" "_id": "64SQnJizFA4JH//Dvw9jSd"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
...@@ -4246,7 +4246,7 @@ ...@@ -4246,7 +4246,7 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "caQp5lbg1OnbHiX2GTMAjL" "_id": "aeNdt761RETKzQCYr6lK74"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",
...@@ -4276,7 +4276,7 @@ ...@@ -4276,7 +4276,7 @@
"_fillRange": 0, "_fillRange": 0,
"_isTrimmedMode": true, "_isTrimmedMode": true,
"_atlas": null, "_atlas": null,
"_id": "f57izo30NFCKjkxV1aSZo4" "_id": "7b2RiM9D9EDIuvJlQnfVdx"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
...@@ -4338,7 +4338,7 @@ ...@@ -4338,7 +4338,7 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "cdtvKfkDtJjofBzLHyWU7I" "_id": "f06eJm0cpMJZwd/0prv465"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",
...@@ -4368,7 +4368,7 @@ ...@@ -4368,7 +4368,7 @@
"_fillRange": 0, "_fillRange": 0,
"_isTrimmedMode": true, "_isTrimmedMode": true,
"_atlas": null, "_atlas": null,
"_id": "3eW+x+3uhLeYXHRZFcXGYI" "_id": "9bqW56wrFE8bxwMlNQ3L6v"
}, },
{ {
"__type__": "7c5ffhlHDpBpoDQ8wfKN7pu", "__type__": "7c5ffhlHDpBpoDQ8wfKN7pu",
......
/** 关卡信息 */
export const LevelInfo = [
{ level: 1, colors: ['#EC5F33', '#E52800', '#CA1D00'] }
{ level: 2, colors: ['#FF9400', '#FF6C00', '#EC5F33', '#E52800', '#CA1D00'] }
{ level: 3, colors: ['#FFD34A', '#FFC300', '#FFB637', '#FF9400', '#FF6C00', '#EC5F33', '#E52800', '#CA1D00'] }
]
export const CUSTOM_EVENT = { export const CUSTOM_EVENT = {
/** 爪子动画结束的回调 */ /** 爪子动画结束的回调 */
CLIP_ANI_END: 'CLIP_ANI_END', CLIP_ANI_END: 'CLIP_ANI_END',
...@@ -19,9 +12,9 @@ export const CUSTOM_EVENT = { ...@@ -19,9 +12,9 @@ export const CUSTOM_EVENT = {
/** 开始游戏 */ /** 开始游戏 */
GAME_START: 'GAME_START', GAME_START: 'GAME_START',
/** 初始化游戏数据 */ /** 初始化游戏数据 */
GAME_INIT:'GAME_INIT', GAME_INIT: 'GAME_INIT',
/** 销毁游戏场景 */ /** 销毁游戏场景 */
GAME_DESTROY:'GAME_DESTROY' GAME_DESTROY: 'GAME_DESTROY'
} }
export const Config = { export const Config = {
...@@ -47,7 +40,41 @@ export const Config = { ...@@ -47,7 +40,41 @@ export const Config = {
propsNum: 2, propsNum: 2,
/** 每关的游戏时间 */ /** 每关的游戏时间 */
countDowns: [30, 30, 30] countDowns: [30, 30, 30],
/** 关卡信息 */
LevelInfo: [
{
level: 1,
/** 目标数量 */
num: 10,
/** 倒计时 */
cds: 30,
/** 游戏进度颜色 */
colors: ['#EC5F33', '#E52800', '#CA1D00'],
},
{
level: 1,
/** 目标数量 */
num: 5,
/** 倒计时 */
cds: 30,
/** 游戏进度颜色 */
colors: ['#FF9400', '#FF6C00', '#EC5F33', '#E52800', '#CA1D00'],
},
{
level: 1,
/** 目标数量 */
num: 8,
/** 倒计时 */
cds: 30,
/** 游戏进度颜色 */
colors: ['#FFD34A', '#FFC300', '#FFB637', '#FF9400', '#FF6C00', '#EC5F33', '#E52800', '#CA1D00']
}
],
/** 进度默认颜色 */
defaultColor: "#FF6C00"
/** 道具分布图 4*3 */ /** 道具分布图 4*3 */
propsMap: [ propsMap: [
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
import Svga from "./Components/Svga/Svga"; import Svga from "./Components/Svga/Svga";
import { SvgaEvent } from "./Components/Svga/SvgaEvent"; import { SvgaEvent } from "./Components/Svga/SvgaEvent";
import { CUSTOM_EVENT, Config, LevelInfo } from "./Config/GameConfig"; import { CUSTOM_EVENT, Config } from "./Config/GameConfig";
import exportEvent from "./exportEvent"; import exportEvent from "./exportEvent";
import { getProbability, getRandomArrayElements, loadGameResources, numToChinese, randomNum, getUrlParam } from "./utils"; import { getProbability, getRandomArrayElements, loadGameResources, numToChinese, randomNum, getUrlParam } from "./utils";
const { ccclass, property } = cc._decorator; const { ccclass, property } = cc._decorator;
...@@ -193,6 +193,7 @@ export default class GameScene extends cc.Component { ...@@ -193,6 +193,7 @@ export default class GameScene extends cc.Component {
rotationAni.speed = this.gameConfig.rotationSpeed rotationAni.speed = this.gameConfig.rotationSpeed
this.isGameOver = false this.isGameOver = false
this.isStartGame = false this.isStartGame = false
this.speedMultiplier = 1
this.setClipState(CLIP_STATE.DEFAULT) this.setClipState(CLIP_STATE.DEFAULT)
this.clip.y = -41 this.clip.y = -41
cc.find('clipMask/clipWrp', this.node).angle = 0 cc.find('clipMask/clipWrp', this.node).angle = 0
...@@ -305,9 +306,10 @@ export default class GameScene extends cc.Component { ...@@ -305,9 +306,10 @@ export default class GameScene extends cc.Component {
this.isGameOver = false this.isGameOver = false
this.actLevel = level this.actLevel = level
this.starNum = 0 this.starNum = 0
this.levelObjectives = LevelInfo[level].colors.length this.actLevelInfo = this.gameConfig.LevelInfo[level]
this.actLevelInfo = LevelInfo[level]
this.countDown = this.gameConfig.countDowns[level] || 0 this.levelObjectives = this.actLevelInfo.num
this.countDown = this.actLevelInfo.cds || 0
this.setLable('levelName', `第${numToChinese(level + 1)}关`) this.setLable('levelName', `第${numToChinese(level + 1)}关`)
this.setLable('starIcon/starProc', `${this.starNum}/${this.levelObjectives}`) this.setLable('starIcon/starProc', `${this.starNum}/${this.levelObjectives}`)
...@@ -325,8 +327,8 @@ export default class GameScene extends cc.Component { ...@@ -325,8 +327,8 @@ export default class GameScene extends cc.Component {
this.surplusStar-- this.surplusStar--
if (key >= this.levelObjectives) return if (key >= this.levelObjectives) return
const node = cc.instantiate(this.procItem) const node = cc.instantiate(this.procItem), colors = this.actLevelInfo.colors || []
node.color = cc.color(this.actLevelInfo.colors[key]) node.color = cc.color(colors[key] || this.gameConfig.defaultColor)
node.setParent(proc) node.setParent(proc)
this.starNum++ this.starNum++
...@@ -346,7 +348,7 @@ export default class GameScene extends cc.Component { ...@@ -346,7 +348,7 @@ export default class GameScene extends cc.Component {
nextLevel() { nextLevel() {
const nextLevel = this.actLevel + 1 const nextLevel = this.actLevel + 1
this.unschedule(this.startCd) this.unschedule(this.startCd)
if (nextLevel >= LevelInfo.length) { // 已通关 if (nextLevel >= this.gameConfig.LevelInfo.length) { // 已通关
this.gameOver() this.gameOver()
return return
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment