Commit b6fecd81 authored by zjz1994's avatar zjz1994

樱花元素暂存

parent 8d38115d
...@@ -1391,7 +1391,6 @@ export default class MainScene extends Scene { ...@@ -1391,7 +1391,6 @@ export default class MainScene extends Scene {
console.error("检查樱花分布",idx,lastidx,i,j); console.error("检查樱花分布",idx,lastidx,i,j);
} }
if(szp){ if(szp){
console.log("树枝位置",szp[0],szp[1]);
let onesz = new shuzhi(); let onesz = new shuzhi();
onesz.name = "sz_"+idx+"_"+lastidx; onesz.name = "sz_"+idx+"_"+lastidx;
onesz.x = szp[0]; onesz.x = szp[0];
...@@ -1408,7 +1407,6 @@ export default class MainScene extends Scene { ...@@ -1408,7 +1407,6 @@ export default class MainScene extends Scene {
}else{ }else{
ele.reset(ElementType.cherry); ele.reset(ElementType.cherry);
} }
console.log("樱花位置",p[0],p[1]);
ele.x = p[0]; ele.x = p[0];
ele.y = p[1]; ele.y = p[1];
...@@ -3185,7 +3183,7 @@ export default class MainScene extends Scene { ...@@ -3185,7 +3183,7 @@ export default class MainScene extends Scene {
this.waitCherry = true; this.waitCherry = true;
return; return;
}else{ }else{
console.log("樱花消除完毕,自动掉落"); // console.log("樱花消除完毕,自动掉落");
} }
//没有可消除元素,执行掉落, //没有可消除元素,执行掉落,
// setTimeout(() => { // setTimeout(() => {
...@@ -7505,7 +7503,7 @@ export default class MainScene extends Scene { ...@@ -7505,7 +7503,7 @@ export default class MainScene extends Scene {
} }
//激活樱花 //激活樱花
activeCherry(idx:number){ activeCherry(idx:number){
console.log("1消除樱花----------------------",idx); // console.log("1消除樱花----------------------",idx);
var lat = this.lattices[idx]; var lat = this.lattices[idx];
var ele = this.lattices[idx].element; var ele = this.lattices[idx].element;
ele.activeCherry(); ele.activeCherry();
...@@ -7519,7 +7517,7 @@ export default class MainScene extends Scene { ...@@ -7519,7 +7517,7 @@ export default class MainScene extends Scene {
//消除自身时,把连接自身的棍消除 //消除自身时,把连接自身的棍消除
this.removeCherryGun(idx,nearidxs); this.removeCherryGun(idx,nearidxs);
console.log("2消除樱花----------------------",JSON.stringify(nearidxs)); // console.log("2消除樱花----------------------",JSON.stringify(nearidxs));
// var pro2 = new Promise(res=>{ // var pro2 = new Promise(res=>{
// setTimeout(() => { // setTimeout(() => {
// res(); // res();
...@@ -7535,7 +7533,7 @@ export default class MainScene extends Scene { ...@@ -7535,7 +7533,7 @@ export default class MainScene extends Scene {
this.activeCherry(nidx); this.activeCherry(nidx);
} }
} }
}, 300); }, 100);
} }
//樱花动画 //樱花动画
playCherryAni(idx:number){ playCherryAni(idx:number){
...@@ -7549,13 +7547,12 @@ export default class MainScene extends Scene { ...@@ -7549,13 +7547,12 @@ export default class MainScene extends Scene {
oneani.x = p[0]; oneani.x = p[0];
oneani.y = p[1]; oneani.y = p[1];
this.effectContainer.addChild(oneani); this.effectContainer.addChild(oneani);
console.log("樱花动画");
egret.Tween.get(oneani) egret.Tween.get(oneani)
.to({ .to({
alpha:0, alpha:0,
scaleX:2, scaleX:2,
scaleY:2 scaleY:2
},800) },500)
.call(()=>{ .call(()=>{
var lat = this.lattices[idx]; var lat = this.lattices[idx];
var ele = lat.element; var ele = lat.element;
...@@ -7576,6 +7573,8 @@ export default class MainScene extends Scene { ...@@ -7576,6 +7573,8 @@ export default class MainScene extends Scene {
this.eliminate(); this.eliminate();
} }
} }
//移除樱花动画
this.effectContainer.removeChild(oneani);
}) })
} }
//获取相邻樱花 //获取相邻樱花
......
...@@ -89,7 +89,6 @@ chapters.forEach((chapter,index) => { ...@@ -89,7 +89,6 @@ chapters.forEach((chapter,index) => {
*/ */
export function getChapterData(index: number): ChapterData { export function getChapterData(index: number): ChapterData {
//没有数据就返回第一关数据 //没有数据就返回第一关数据
return chapters[801];
return chapters[index] || chapters[1]; return chapters[index] || chapters[1];
} }
......
...@@ -23,6 +23,5 @@ export default class shuzhi extends egret.Bitmap{ ...@@ -23,6 +23,5 @@ export default class shuzhi extends egret.Bitmap{
roa = 90; roa = 90;
} }
this.rotation = roa; this.rotation = roa;
console.log("树枝啦啦啦啦",this);
} }
} }
\ No newline at end of file
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