Commit cb2d2ac6 authored by wildfirecode's avatar wildfirecode

Merge branch 'dev' of gitlab2.dui88.com:wanghongyuan/xiaoxiaole into dev

parents 82ea1c0d e32a30b9
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"blood","version":5,"files":["../assets/blood/blood体力补济站.png","../assets/blood/blood按钮.png","../assets/blood/blood按钮 副本1.png","../assets/blood/blood按钮 副本.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"blood","version":5,"files":["..\\assets\\blood\\blood体力补济站.png","..\\assets\\blood\\blood按钮.png","..\\assets\\blood\\blood按钮 副本1.png","..\\assets\\blood\\blood按钮 副本.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"box","version":5,"files":["../assets/box/boxbtn.png","../assets/box/boxbg.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"box","version":5,"files":["..\\assets\\box\\boxbtn.png","..\\assets\\box\\boxbg.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"box2","version":5,"files":["../assets/box2/box2_bg.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"box2","version":5,"files":["..\\assets\\box2\\box2_bg.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"buy1","version":5,"files":["../assets/buy1/购买锤子.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"buy1","version":5,"files":["..\\assets\\buy1\\购买锤子.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"buy2","version":5,"files":["../assets/buy2/购买炸弹.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"buy2","version":5,"files":["..\\assets\\buy2\\购买炸弹.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"buy3","version":5,"files":["../assets/buy3/购买步数增加.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"buy3","version":5,"files":["..\\assets\\buy3\\购买步数增加.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"common","version":5,"files":["../assets/common/toast.png","../assets/common/closeCommonBtn.png","../assets/common/btn.png","../assets/common/alertbg.png","../assets/common/按钮 副本 4.png","../assets/common/按钮 副本 3.png","../assets/common/share_btn2.png","../assets/common/share_btn1.png","../assets/common/commmon_okbtn1.png","../assets/common/lightani.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"common","version":5,"files":["..\\assets\\common\\toast.png","..\\assets\\common\\closeCommonBtn.png","..\\assets\\common\\btn.png","..\\assets\\common\\alertbg.png","..\\assets\\common\\按钮 副本 4.png","..\\assets\\common\\按钮 副本 3.png","..\\assets\\common\\share_btn2.png","..\\assets\\common\\share_btn1.png","..\\assets\\common\\commmon_okbtn1.png","..\\assets\\common\\lightani.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"fail","version":5,"files":["../assets/faild/闯关失败.png","../assets/faild/按钮 副本 9.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"fail","version":5,"files":["..\\assets\\faild\\闯关失败.png","..\\assets\\faild\\按钮 副本 9.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"failed","version":5,"files":["../assets/faild/闯关失败.png","../assets/faild/按钮 副本 9.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"failed","version":5,"files":["..\\assets\\faild\\闯关失败.png","..\\assets\\faild\\按钮 副本 9.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"map","version":5,"files":["../assets/map/progress2.png","../assets/map/progress1.png","../assets/map/icon.png","../assets/map/animal1.png","../assets/map/元宝bg.png","../assets/map/有星星.png","../assets/map/音乐.png","../assets/map/星星bg.png","../assets/map/星星.png","../assets/map/无星星.png","../assets/map/问题.png","../assets/map/退出.png","../assets/map/狮子.png","../assets/map/声音.png","../assets/map/设置bg.png","../assets/map/设置.png","../assets/map/关闭 拷贝.png","../assets/map/道具.png","../assets/map/宝箱btn.png","../assets/map/宝箱bg.png","../assets/map/宝箱.png","../assets/map/宝箱3.png","../assets/map/宝箱2.png","../assets/map/宝箱1.png","../assets/map/iconbg.png","../assets/map/光 副本 4.png","../assets/map/音乐关闭.png","../assets/map/声音关闭.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"map","version":5,"files":["..\\assets\\map\\progress2.png","..\\assets\\map\\progress1.png","..\\assets\\map\\icon.png","..\\assets\\map\\animal1.png","..\\assets\\map\\元宝bg.png","..\\assets\\map\\有星星.png","..\\assets\\map\\音乐.png","..\\assets\\map\\星星bg.png","..\\assets\\map\\星星.png","..\\assets\\map\\无星星.png","..\\assets\\map\\问题.png","..\\assets\\map\\退出.png","..\\assets\\map\\狮子.png","..\\assets\\map\\声音.png","..\\assets\\map\\设置bg.png","..\\assets\\map\\设置.png","..\\assets\\map\\关闭 拷贝.png","..\\assets\\map\\道具.png","..\\assets\\map\\宝箱btn.png","..\\assets\\map\\宝箱bg.png","..\\assets\\map\\宝箱.png","..\\assets\\map\\宝箱3.png","..\\assets\\map\\宝箱2.png","..\\assets\\map\\宝箱1.png","..\\assets\\map\\iconbg.png","..\\assets\\map\\光 副本 4.png","..\\assets\\map\\音乐关闭.png","..\\assets\\map\\声音关闭.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"noprize","version":5,"files":["../assets/nprize/擦肩而过弹窗 .png","../assets/nprize/得分- 无发券.png","../assets/nprize/再来一次.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"noprize","version":5,"files":["..\\assets\\nprize\\擦肩而过弹窗 .png","..\\assets\\nprize\\得分- 无发券.png","..\\assets\\nprize\\再来一次.png"]}
\ No newline at end of file
<<<<<<< HEAD
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"preload","version":5,"files":["..\\assets\\common\\prizePanelbg.png"]}
=======
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"preload","version":5,"files":["../assets/common/prizePanelbg.png"]}
>>>>>>> 983aa8d0e137ab6ac947ff8d15f79d5e2a402b74
<<<<<<< HEAD
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"prize","version":5,"files":["..\\assets\\prize\\PrizePanelX.png","..\\assets\\prize\\prizePanelUseBtn.png","..\\assets\\prize\\点亮.png","..\\assets\\prize\\点亮 副本 2.png"]}
=======
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"prize","version":5,"files":["../assets/prize/PrizePanelX.png","../assets/prize/prizePanelUseBtn.png","../assets/prize/点亮.png","../assets/prize/点亮 副本 2.png"]}
>>>>>>> 983aa8d0e137ab6ac947ff8d15f79d5e2a402b74
<<<<<<< HEAD
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"prize2","version":5,"files":["..\\assets\\prize2\\prize2_icon.png"]}
=======
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"prize2","version":5,"files":["../assets/prize2/prize2_icon.png"]}
>>>>>>> 983aa8d0e137ab6ac947ff8d15f79d5e2a402b74
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"quit","version":5,"files":["../assets/quit/quit_bg.png","../assets/quit/关闭按钮.png","../assets/quit/按钮 副本 8.png","../assets/quit/按钮 副本 7.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"quit","version":5,"files":["..\\assets\\quit\\quit_bg.png","..\\assets\\quit\\关闭按钮.png","..\\assets\\quit\\按钮 副本 8.png","..\\assets\\quit\\按钮 副本 7.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"rule","version":5,"files":["../assets/rule/ruleBg.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"rule","version":5,"files":["..\\assets\\rule\\ruleBg.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"shop","version":5,"files":["../assets/shop/道具商城.png","../assets/shop/按钮 副本.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"shop","version":5,"files":["..\\assets\\shop\\道具商城.png","..\\assets\\shop\\按钮 副本.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"start","version":5,"files":["../assets/startScene/mask3.png","../assets/startScene/mask2.png","../assets/startScene/mask.png","../assets/startScene/loadingbg.png","../assets/startScene/头顶树丛.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"start","version":5,"files":["..\\assets\\startScene\\mask3.png","..\\assets\\startScene\\mask2.png","..\\assets\\startScene\\mask.png","..\\assets\\startScene\\loadingbg.png","..\\assets\\startScene\\头顶树丛.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"startpanel","version":5,"files":["../assets/startpanel2/通关条件.png","../assets/startpanel2/数量.png","../assets/startpanel2/数量 副本 3.png","../assets/startpanel2/按钮.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"startpanel","version":5,"files":["..\\assets\\startpanel2\\通关条件.png","..\\assets\\startpanel2\\数量.png","..\\assets\\startpanel2\\数量 副本 3.png","..\\assets\\startpanel2\\按钮.png"]}
\ No newline at end of file
......@@ -94,6 +94,8 @@ export default class MainScene extends Scene {
chapter: number
//所有的格子数组
lattices: Lattice[];
//生成口
generateIndexs: number[];
//最后一行的行数
endRowNum: number = 0;
//元素的容器,为了移动事件简单
......@@ -333,7 +335,7 @@ export default class MainScene extends Scene {
this.addChild(this.stepNumber);
//分数进度条,托管
this.scoreProgress = new ScoreProgress(this.starProgress, this.scoreTxt, this.chapterData.starScores);
// this.scoreTxt.textColor = 0x5e1f0c
this.scoreTxt.y -= 2;
//背景图生成
// var bg = drawBg(this.chapterData.map.paths, this.chapterData.map.lattices)
var path = generateMapBg(this.chapterData.map.lattices);
......@@ -538,7 +540,7 @@ export default class MainScene extends Scene {
}
}
//设置生成口
Tool.setGenerateLats(this.lattices, generateLats)
this.generateIndexs = Tool.setGenerateLats(this.lattices, generateLats)
//联通口
var connectedLats = this.chapterData.map.connectedLats || [];
for (var i = 0; i < connectedLats.length; i++) {
......@@ -1115,9 +1117,9 @@ export default class MainScene extends Scene {
//先把竖直的掉落完,掉满后
var maxCount = 1;
for (var m = 0; m < Tool.colNum; m++) {
//同一列
//同一列,先原有的填满,再查是否有生成口
for (var n = Tool.rowNum - 1; n >= 0; n--) {
var index = Tool.rcToIndex(n, m);
let index = Tool.rcToIndex(n, m);
let lat = this.lattices[index];
if (Tool.judgeFall(lat)) {
var emptyIndex = Tool.findBottom(lat, this.emptys, this.lattices);
......@@ -1132,8 +1134,14 @@ export default class MainScene extends Scene {
this.emptys.push(index);
lat.element = null
}
} else {
}
}
//找m列的生成口
if (this.generateIndexs[m] != undefined) {
let lat = this.lattices[this.generateIndexs[m]];
let index = this.generateIndexs[m];
//如果有格子。无元素,是生成口,要补齐下面能掉落的
if (lat && !lat.element && lat.isGenerate) {
//找出从生成口一直到能掉落的空格
......@@ -1168,7 +1176,6 @@ export default class MainScene extends Scene {
}
}
}
}
anis["maxCount"] = maxCount > 1 ? maxCount / 2 : maxCount;
return anis;
}
......@@ -1180,7 +1187,7 @@ export default class MainScene extends Scene {
//排序从大到小
emptys.sort(function (a, b) { return a < b ? 1 : -1 })
for (var i = 0; i < emptys.length; i++) {
var indexMy = emptys[i];
let indexMy = emptys[i];
var lat = this.lattices[indexMy];
//判断是否是生成口
if (lat.isGenerate) {
......@@ -1230,11 +1237,15 @@ export default class MainScene extends Scene {
//能掉落,记录元素动画
anis.push([latFall.element, indexMy]);
//去掉
// console.log(emptys)
// console.log(indexFall)
emptys.splice(i, 1);
//在剩下emptys的加上一个,正上方的那个
// Tool.insert(indexFall, emptys)
// Tool.insertEX(indexFall, emptys)
// console.log(emptys)
// emptys.push(indexFall)
emptys.splice(i + 1, 0, indexFall);
// Tool.removeEle(indexMy,emptys)
//掉落的格子上的元素致null
latFall.element = null;
//长度加了,多加+
......@@ -1320,7 +1331,7 @@ export default class MainScene extends Scene {
* @param callback
*/
fallAni(anis: any[], callback: Function) {
playSound(SoundType.fall);
// playSound(SoundType.fall);
let count = 0;
let countAll = anis.length;
for (let i = 0; i < anis.length; i++) {
......
......@@ -1181,7 +1181,7 @@ export const Chapters: ChapterData[] = [
],
generateLats: [1, 1, 1, 1, 1, 1, 1, 1, 1],
elements: [
3, 1, 3, 1, 1, 1, 3, 1, 3,
3, 3, 1, 1, 1, 1, 1, 3, 3,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 0, 0, 1, 0, 0, 1, 1,
1, 1, 0, 1, 1, 1, 0, 1, 1,
......
......@@ -148,9 +148,10 @@ export class Tool {
if (num > arr[i]) {
//在arr[i]后加num
arr.splice(i, 0, num);
break
return
}
}
arr.push(num)
}
/**
* 判断格子是否能掉落,
......@@ -517,6 +518,7 @@ export class Tool {
* @param generateLats [0,1,1,1,1,1,1,1,0]
*/
public static setGenerateLats(lattices: Lattice[], generateLats: number[]) {
var indexs = []
for (var m = 0; m < Tool.colNum; m++) {
//找每列第一个元素
for (var g = 0; g < Tool.rowNum; g++) {
......@@ -524,10 +526,12 @@ export class Tool {
//如果格子存在,并且该列g的数据为1;
if (lattices[index] && generateLats[m]) {
lattices[index].isGenerate = true;
indexs[m] = index;
break
}
}
}
return indexs
}
/**
* 将9*9都转化成01格子
......
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