Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xiaoxiaole
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wildfirecode13
xiaoxiaole
Commits
4ed37812
Commit
4ed37812
authored
Apr 15, 2020
by
zjz1994
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改流沙抖动问题
parent
c735478e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
MainScene.ts
egret/src/mainScene/MainScene.ts
+11
-2
doSandAI.ts
egret/src/mainScene/doSandAI.ts
+1
-1
No files found.
egret/src/mainScene/MainScene.ts
View file @
4ed37812
...
@@ -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
.
map
upContainer
.
removeChild
(
ice
);
//回收
//回收
Pool
.
recover
(
RecoverName
.
ICE
,
ice
);
Pool
.
recover
(
RecoverName
.
ICE
,
ice
);
lat
.
ice
=
null
;
lat
.
ice
=
null
;
...
...
egret/src/mainScene/doSandAI.ts
View file @
4ed37812
...
@@ -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
.
map
upContainer
.
addChild
(
sandMoveAni
);
promiseList
.
push
(
sandMoveAni
.
play
(
from
,
p
,
sand
));
promiseList
.
push
(
sandMoveAni
.
play
(
from
,
p
,
sand
));
// sands.push(sand);
// sands.push(sand);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment