Commit 4ed37812 authored by zjz1994's avatar zjz1994

修改流沙抖动问题

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