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
abc51661
Commit
abc51661
authored
May 09, 2020
by
zjz1994
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整动画
parent
36366b73
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
361 additions
and
77 deletions
+361
-77
NetManager.ts
egret/libs/tw/manager/NetManager.ts
+1
-1
ele41.png
egret/resource/assets/mainScene/ele41.png
+0
-0
lawn.svga
egret/resource/assets/svgas/lawn.svga
+0
-0
MainScene.ts
egret/src/mainScene/MainScene.ts
+115
-9
Chapter28.ts
egret/src/something/chapters/Chapter28.ts
+239
-65
Grass.ts
egret/src/something/class/Grass.ts
+5
-2
ElementType.ts
egret/src/something/enum/ElementType.ts
+1
-0
No files found.
egret/libs/tw/manager/NetManager.ts
View file @
abc51661
...
@@ -478,7 +478,7 @@ export class NetManager extends ABNetManager {
...
@@ -478,7 +478,7 @@ export class NetManager extends ABNetManager {
deviceSessionId
:
window
[
'_device_session_id'
],
deviceSessionId
:
window
[
'_device_session_id'
],
score
:
score
score
:
score
};
};
//
console.log("通关提交",data);
console
.
log
(
"通关提交"
,
data
);
if
(
relatedTaskType
)
{
if
(
relatedTaskType
)
{
data
[
'relatedTaskType'
]
=
relatedTaskType
;
data
[
'relatedTaskType'
]
=
relatedTaskType
;
}
}
...
...
egret/resource/assets/mainScene/ele41.png
View replaced file @
36366b73
View file @
abc51661
11.9 KB
|
W:
|
H:
8.1 KB
|
W:
|
H:
2-up
Swipe
Onion skin
egret/resource/assets/svgas/lawn.svga
0 → 100644
View file @
abc51661
File added
egret/src/mainScene/MainScene.ts
View file @
abc51661
...
@@ -121,7 +121,6 @@ import Rect = eui.Rect;
...
@@ -121,7 +121,6 @@ import Rect = eui.Rect;
import
WormHole
from
'../something/class/WormHole'
;
import
WormHole
from
'../something/class/WormHole'
;
import
doWormHoleAI
from
'./doWormHoleAI'
;
import
doWormHoleAI
from
'./doWormHoleAI'
;
import
{
Grass
}
from
'../something/class/Grass'
;
import
{
Grass
}
from
'../something/class/Grass'
;
import
{
GameEvent
}
from
'../configData/GameEvent'
;
const
aniClass
=
{
const
aniClass
=
{
"BoomAni"
:
BoomAni
,
"BoomAni"
:
BoomAni
,
...
@@ -179,6 +178,9 @@ let pongojioArr:Array<any> = [];
...
@@ -179,6 +178,9 @@ let pongojioArr:Array<any> = [];
let
wormlightdata
:
any
=
null
;
let
wormlightdata
:
any
=
null
;
let
wormlightArr
:
Array
<
any
>
=
[];
let
wormlightArr
:
Array
<
any
>
=
[];
//草坪的特效
let
lawndata
:
any
=
null
;
let
lawnArr
:
Array
<
any
>
=
[];
//红包炸弹弹框名字
//红包炸弹弹框名字
const
redBombPanelName
=
"RedBombAlert"
;
const
redBombPanelName
=
"RedBombAlert"
;
...
@@ -392,7 +394,7 @@ export default class MainScene extends Scene {
...
@@ -392,7 +394,7 @@ export default class MainScene extends Scene {
guideContainer
:
egret
.
DisplayObjectContainer
;
guideContainer
:
egret
.
DisplayObjectContainer
;
festivalContainer
:
egret
.
DisplayObjectContainer
;
festivalContainer
:
egret
.
DisplayObjectContainer
;
fallAllPormise
:
Promise
<
any
>
[];
//铺草坪
//铺草坪
// turfingArr:Array<number> = [];//当前已有草的格子
// turfingArr:Array<number> = [];//当前已有草的格子
//一次掉落前的消除集合
//一次掉落前的消除集合
...
@@ -520,6 +522,7 @@ export default class MainScene extends Scene {
...
@@ -520,6 +522,7 @@ export default class MainScene extends Scene {
async
start
(
data
)
{
async
start
(
data
)
{
super
.
start
();
super
.
start
();
this
.
fallAllPormise
=
new
Array
();
this
.
resetMainScene
();
this
.
resetMainScene
();
// window['gm'] = this.gm;
// window['gm'] = this.gm;
//第几关
//第几关
...
@@ -543,6 +546,8 @@ export default class MainScene extends Scene {
...
@@ -543,6 +546,8 @@ export default class MainScene extends Scene {
//虫洞
//虫洞
this
.
initWormHole
();
this
.
initWormHole
();
//有草坪,加塞草坪的动画
this
.
initLawn
();
//初始话地图格子数据
//初始话地图格子数据
this
.
initLattices
();
this
.
initLattices
();
//初始化回收口,如果是棒棒糖关卡,那么在地图底部增加棒棒糖洞,用到map
//初始化回收口,如果是棒棒糖关卡,那么在地图底部增加棒棒糖洞,用到map
...
@@ -753,6 +758,20 @@ export default class MainScene extends Scene {
...
@@ -753,6 +758,20 @@ export default class MainScene extends Scene {
})
})
}
}
}
}
//草坪动画
initLawn
(
call
=
null
){
var
resPath
=
getResPath
();
if
(
!
svgaParser
)
svgaParser
=
new
window
[
"SVGA"
].
Parser
();
if
(
lawndata
){
}
else
{
svgaParser
.
load
(
resPath
+
'resource/assets/svgas/lawn.svga'
,
(
videoItem
)
=>
{
if
(
!
lawndata
){
lawndata
=
videoItem
;
}
})
}
}
/**
/**
* 加载猩猩脚印
* 加载猩猩脚印
*/
*/
...
@@ -2242,6 +2261,7 @@ export default class MainScene extends Scene {
...
@@ -2242,6 +2261,7 @@ export default class MainScene extends Scene {
* @param callback 所有fall完成后的回调,检查三消,
* @param callback 所有fall完成后的回调,检查三消,
*/
*/
fall
(
callback
:
Function
)
{
fall
(
callback
:
Function
)
{
this
.
fallAllPormise
=
new
Array
();
//去重一次
//去重一次
Tool
.
removeReapty
(
this
.
emptys
);
Tool
.
removeReapty
(
this
.
emptys
);
...
@@ -2886,7 +2906,7 @@ export default class MainScene extends Scene {
...
@@ -2886,7 +2906,7 @@ export default class MainScene extends Scene {
* 执行消除,应该是一个迭代,只要eliminatedElements有东西就一直执行
* 执行消除,应该是一个迭代,只要eliminatedElements有东西就一直执行
* 掉落后的逻辑很复杂
* 掉落后的逻辑很复杂
*/
*/
eliminate
(
data
:
Array
<
{
ineffect
:
boolean
,
addnum
:
number
}
>=
null
)
{
async
eliminate
(
data
:
Array
<
{
ineffect
:
boolean
,
addnum
:
number
}
>=
null
)
{
var
pcannostatArr
:
Array
<
{
ineffect
:
boolean
,
addnum
:
number
}
>
;
var
pcannostatArr
:
Array
<
{
ineffect
:
boolean
,
addnum
:
number
}
>
;
if
(
data
){
if
(
data
){
pcannostatArr
=
data
;
pcannostatArr
=
data
;
...
@@ -2971,12 +2991,14 @@ export default class MainScene extends Scene {
...
@@ -2971,12 +2991,14 @@ export default class MainScene extends Scene {
}
}
//没有可消除元素,执行掉落,
//没有可消除元素,执行掉落,
setTimeout
(()
=>
{
// setTimeout(() => {
await
wait
(
200
);
await
Promise
.
all
(
this
.
fallAllPormise
);
this
.
fall
(()
=>
{
this
.
fall
(()
=>
{
//掉落停止回调
//掉落停止回调
this
.
fallCallback
();
this
.
fallCallback
();
});
});
},
200
)
//
}, 200)
}
}
}
}
incheckFall
:
boolean
=
false
;
incheckFall
:
boolean
=
false
;
...
@@ -5768,12 +5790,24 @@ export default class MainScene extends Scene {
...
@@ -5768,12 +5790,24 @@ export default class MainScene extends Scene {
let
block
=
lat
.
block
;
let
block
=
lat
.
block
;
block
.
parent
.
removeChild
(
block
);
block
.
parent
.
removeChild
(
block
);
if
(
lat
.
block
.
blocktype
==
LatticeType
.
BlOCK
){
if
(
lat
.
block
.
blocktype
==
LatticeType
.
BlOCK
){
this
.
removeBlockGrass
(
block
);
Pool
.
recover
(
RecoverName
.
BLOCK
,
block
);
Pool
.
recover
(
RecoverName
.
BLOCK
,
block
);
}
else
if
(
lat
.
block
.
blocktype
==
LatticeType
.
BLOCK_AND_ICE
){
}
else
if
(
lat
.
block
.
blocktype
==
LatticeType
.
BLOCK_AND_ICE
){
this
.
removeBlockGrass
(
block
);
Pool
.
recover
(
RecoverName
.
ICE_BLOCK
,
block
);
Pool
.
recover
(
RecoverName
.
ICE_BLOCK
,
block
);
// if(block.ice){
// block.ice.parent.removeChild(block.ice);
// block.ice = null;
// }
}
else
if
(
lat
.
block
.
blocktype
==
LatticeType
.
BLOCK_AND_DARK_ICE
){
}
else
if
(
lat
.
block
.
blocktype
==
LatticeType
.
BLOCK_AND_DARK_ICE
){
this
.
removeBlockGrass
(
block
);
Pool
.
recover
(
RecoverName
.
DARK_ICE_BLOCK
,
block
);
Pool
.
recover
(
RecoverName
.
DARK_ICE_BLOCK
,
block
);
// if(block.ice){
// block.ice.parent.removeChild(block.ice);
// block.ice = null;
// }
}
else
if
(
lat
.
block
.
blocktype
==
LatticeType
.
BLOCK_AND_GRASS
){
}
else
if
(
lat
.
block
.
blocktype
==
LatticeType
.
BLOCK_AND_GRASS
){
Pool
.
recover
(
RecoverName
.
GRASS_BLOCK
,
block
);
Pool
.
recover
(
RecoverName
.
GRASS_BLOCK
,
block
);
}
}
...
@@ -5788,6 +5822,12 @@ export default class MainScene extends Scene {
...
@@ -5788,6 +5822,12 @@ export default class MainScene extends Scene {
Pool
.
recover
(
RecoverName
.
GRASS
,
grass
);
Pool
.
recover
(
RecoverName
.
GRASS
,
grass
);
}
}
}
}
removeBlockGrass
(
block
){
if
(
block
.
grass
){
block
.
grass
.
parent
.
removeChild
(
block
.
grass
);
block
.
grass
=
null
;
}
}
recoverEleast
(
lat
:
Lattice
){
recoverEleast
(
lat
:
Lattice
){
let
ele
=
lat
.
element
;
let
ele
=
lat
.
element
;
if
(
!
ele
)
return
;
if
(
!
ele
)
return
;
...
@@ -6205,6 +6245,58 @@ export default class MainScene extends Scene {
...
@@ -6205,6 +6245,58 @@ export default class MainScene extends Scene {
this
.
turfing
(
pidx
);
this
.
turfing
(
pidx
);
}
}
}
}
//草坪动画
lawnAnm
(
posx
,
posy
,
grass
:
any
,
grassp
:
any
,
passpos
:
Array
<
number
>
,
index
:
number
){
var
pro
=
new
Promise
((
resolve
)
=>
{
let
onelawn
;
if
(
lawnArr
.
length
>
0
){
onelawn
=
lawnArr
.
shift
();
}
else
{
onelawn
=
new
window
[
"SVGA"
].
EgretMovieClip
(
lawndata
);
}
this
.
effectContainer
.
addChild
(
onelawn
);
onelawn
.
x
=
posx
-
80
;
onelawn
.
y
=
posy
-
80
;
let
mainScene
:
MainScene
=
this
;
let
compfunc
=
function
(){
onelawn
.
removeEventListener
(
egret
.
Event
.
COMPLETE
,
compfunc
);
onelawn
.
gotoAndStop
(
1
);
if
(
onelawn
.
parent
){
onelawn
.
parent
.
removeChild
(
onelawn
);
lawnArr
.
push
(
onelawn
);
}
}
onelawn
.
addEventListener
(
egret
.
Event
.
COMPLETE
,
compfunc
);
onelawn
.
gotoAndPlay
(
1
,
1
);
let
framefunc
=
function
(){
let
curframe
=
onelawn
.
currentFrame
;
if
(
curframe
==
30
){
// console.log("草坪--------------------------------------------取消监听lawn----frame",index);
grassp
.
addChild
(
grass
);
onelawn
.
removeEventListener
(
egret
.
Event
.
ENTER_FRAME
,
framefunc
);
egret
.
Tween
.
get
(
grass
).
set
({
scaleX
:
0.8
,
scaleY
:
0.8
,
alpha
:
0.2
})
.
to
({
scaleY
:
1
,
scaleX
:
1
,
alpha
:
1
,
},
400
,
egret
.
Ease
.
backOut
)
.
call
(()
=>
{
resolve
();
})
}
}
onelawn
.
addEventListener
(
egret
.
Event
.
ENTER_FRAME
,
framefunc
);
});
return
pro
;
}
//新增铺草地
//新增铺草地
turfing
(
index
:
number
){
turfing
(
index
:
number
){
var
lat
=
this
.
lattices
[
index
];
var
lat
=
this
.
lattices
[
index
];
...
@@ -6221,24 +6313,38 @@ export default class MainScene extends Scene {
...
@@ -6221,24 +6313,38 @@ export default class MainScene extends Scene {
// return;
// return;
// }
// }
// if(!lat.grass){
// if(!lat.grass){
let
grasspos
=
Tool
.
getPositionByIndex
(
index
);
let
grassparent
:
egret
.
DisplayObject
;
let
grassDisplay
=
Pool
.
takeOut
(
RecoverName
.
GRASS
);
let
grassDisplay
=
Pool
.
takeOut
(
RecoverName
.
GRASS
);
if
(
!
grassDisplay
){
if
(
!
grassDisplay
){
grassDisplay
=
new
Grass
();
grassDisplay
=
new
Grass
();
}
}
// grassDisplay.width = grassDisplay.height = 80;
// grassDisplay.anchorOffsetY = 40;
// grassDisplay.anchorOffsetX = 40;
lat
.
grass
=
grassDisplay
;
lat
.
grass
=
grassDisplay
;
var
passpos
:
Array
<
number
>
=
[];
var
passpos
:
Array
<
number
>
=
[];
if
(
lat
.
block
){
if
(
lat
.
block
){
lat
.
block
.
grass
=
grassDisplay
;
lat
.
block
.
grass
=
grassDisplay
;
lat
.
block
.
addChild
(
grassDisplay
);
grassDisplay
.
x
=
0
;
grassDisplay
.
y
=
0
;
// lat.block.addChild(grassDisplay);
grassparent
=
lat
.
block
;
passpos
=
[
lat
.
block
.
x
,
lat
.
block
.
y
];
passpos
=
[
lat
.
block
.
x
,
lat
.
block
.
y
];
}
else
{
}
else
{
this
.
mapupContainer
.
addChild
(
grassDisplay
);
// this.mapupContainer.addChild(grassDisplay);
var
grasspos
=
Tool
.
getPositionByIndex
(
index
);
grassparent
=
this
.
mapupContainer
;
grassDisplay
.
x
=
grasspos
[
0
];
grassDisplay
.
x
=
grasspos
[
0
];
grassDisplay
.
y
=
grasspos
[
1
];
grassDisplay
.
y
=
grasspos
[
1
];
passpos
=
[
lat
.
grass
.
x
,
lat
.
grass
.
y
];
passpos
=
[
lat
.
grass
.
x
,
lat
.
grass
.
y
];
}
}
this
.
goElementTarget
(
ElementType
.
Grass
,
passpos
);
// console.log("准备添加草坪",index)
var
pro
=
this
.
lawnAnm
(
grasspos
[
0
],
grasspos
[
1
],
grassDisplay
,
grassparent
,
passpos
,
index
);
this
.
fallAllPormise
.
push
(
pro
);
// this.goElementTarget(ElementType.Grass,passpos);
// }
// }
}
}
}
}
...
...
egret/src/something/chapters/Chapter28.ts
View file @
abc51661
This diff is collapsed.
Click to expand it.
egret/src/something/class/Grass.ts
View file @
abc51661
...
@@ -6,7 +6,10 @@ export class Grass extends egret.Bitmap {
...
@@ -6,7 +6,10 @@ export class Grass extends egret.Bitmap {
super
();
super
();
var
texture
:
egret
.
Texture
=
RES
.
getRes
(
"ele"
+
ElementType
.
Grass
+
"_png"
);
var
texture
:
egret
.
Texture
=
RES
.
getRes
(
"ele"
+
ElementType
.
Grass
+
"_png"
);
this
.
texture
=
texture
;
this
.
texture
=
texture
;
this
.
anchorOffsetX
=
texture
.
textureWidth
/
2
;
console
.
log
(
"草的大小"
,
texture
.
textureWidth
,
texture
.
textureHeight
);
this
.
anchorOffsetY
=
texture
.
textureHeight
/
2
;
var
grasswidth
=
76
;
this
.
width
=
this
.
height
=
grasswidth
;
this
.
anchorOffsetX
=
grasswidth
/
2
;
this
.
anchorOffsetY
=
grasswidth
/
2
;
}
}
}
}
\ No newline at end of file
egret/src/something/enum/ElementType.ts
View file @
abc51661
...
@@ -256,6 +256,7 @@ export const submitTran = {
...
@@ -256,6 +256,7 @@ export const submitTran = {
26
:
15
,
26
:
15
,
34
:
16
,
34
:
16
,
36
:
17
,
36
:
17
,
41
:
18
,
}
}
// SCORE(1, "分数"),
// SCORE(1, "分数"),
...
...
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