Commit 4ed37812 authored by zjz1994's avatar zjz1994

修改流沙抖动问题

parent c735478e
......@@ -219,6 +219,9 @@ export default class MainScene extends Scene {
recycleIndexs: number[];
//元素的容器,为了移动事件简单
elementContainer: egret.DisplayObjectContainer;
//流沙提出来,解决流沙抖动问题
mapupContainer:egret.DisplayObjectContainer;
//选中框
choosed: eui.Image;
//消除后生成空格的索引
......@@ -695,9 +698,14 @@ export default class MainScene extends Scene {
this.conveyorMap = {};
this.map = bg;
this.map.addChild(conveyor);
//修改流沙的问题
this.mapupContainer = new egret.DisplayObjectContainer();
this.addChild(this.mapupContainer);
//容器
this.elementContainer = new egret.DisplayObjectContainer();
this.addChild(this.elementContainer);
//加遮罩,大遮罩一直都加,小遮罩时时判断
var mask = drawShape(path);
this.elementContainer.mask = mask;
......@@ -896,7 +904,8 @@ export default class MainScene extends Scene {
this.lattices[i].block = latticeDisplay as BaseBlock;
}
if(latticeDisplay) {
this.map.addChild(latticeDisplay);
// this.map.addChild(latticeDisplay);
this.mapupContainer.addChild(latticeDisplay);
latticeDisplay.x = p[0];
latticeDisplay.y = p[1];
}
......@@ -4220,7 +4229,7 @@ export default class MainScene extends Scene {
const ice = lat.ice;
ice.countNum--;
if(ice.countNum == 0) {
this.map.removeChild(ice);
this.mapupContainer.removeChild(ice);
//回收
Pool.recover(RecoverName.ICE, ice);
lat.ice = null;
......
......@@ -41,7 +41,7 @@ export default async (thisObj: MainScene) => {
if (!sandMoveAni) {
sandMoveAni = new SandMoveAni();
}
thisObj.map.addChild(sandMoveAni);
thisObj.mapupContainer.addChild(sandMoveAni);
promiseList.push(sandMoveAni.play(from, p, sand));
// sands.push(sand);
}
......
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