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
83a5d042
Commit
83a5d042
authored
Apr 16, 2020
by
zjz1994
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
黑洞与烟花
parent
ece84fb2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
47 deletions
+85
-47
MainScene.ts
egret/src/mainScene/MainScene.ts
+38
-22
doWormHoleAI.ts
egret/src/mainScene/doWormHoleAI.ts
+16
-5
Chapter25.ts
egret/src/something/chapters/Chapter25.ts
+4
-4
Element.ts
egret/src/something/class/Element.ts
+27
-16
No files found.
egret/src/mainScene/MainScene.ts
View file @
83a5d042
...
...
@@ -350,6 +350,8 @@ export default class MainScene extends Scene {
//记录是否有红包炸弹弹框
redBombPanelMark
:
boolean
;
//烟花绽放
fireworkPromise
:
Promise
<
any
>
[];
async
start
(
data
)
{
super
.
start
();
window
[
'gm'
]
=
this
.
gm
;
...
...
@@ -1676,6 +1678,7 @@ export default class MainScene extends Scene {
this
.
removeChild
(
this
.
stepCircle
)
}
if
(
s
)
{
this
.
fireworkPromise
=
new
Array
();
//成功的
switch
(
prop
)
{
case
PropType
.
BOOM
:
...
...
@@ -1852,6 +1855,7 @@ export default class MainScene extends Scene {
}
mouseDownE
(
e
:
egret
.
TextEvent
)
{
this
.
fireworkPromise
=
new
Array
();
// if (!this.enableTouch) return
this
.
_converyorTag
=
true
;
this
.
_wormholeTag
=
true
;
...
...
@@ -1879,6 +1883,7 @@ export default class MainScene extends Scene {
}
mouseMoveE
(
e
)
{
this
.
fireworkPromise
=
new
Array
();
this
.
_converyorTag
=
true
;
this
.
_wormholeTag
=
true
;
if
(
this
.
SELECTED
&&
e
.
target
.
parent
instanceof
Element
)
{
...
...
@@ -2803,34 +2808,38 @@ export default class MainScene extends Scene {
}
//黑洞转移
if
(
this
.
_wormholeTag
){
this
.
_wormholeTag
=
false
;
let
wormholes
=
this
.
chapterData
.
map
.
WORMHOLE
;
if
(
wormholes
&&
wormholes
.
length
>
0
){
await
Promise
.
all
(
this
.
fireworkPromise
).
then
(()
=>
{
// console.log("本次烟花播放完毕");
});
await
doWormHoleAI
(
this
);
// console.log("黑洞转移完毕");
}
this
.
_wormholeTag
=
false
;
//黑洞转移,使黑洞占位变空,需要添加到emptys中
for
(
var
_w
=
0
;
_w
<
this
.
lattices
.
length
;
_w
++
){
var
_wlattice
=
this
.
lattices
[
_w
];
if
(
_wlattice
&&!
_wlattice
.
element
&&
this
.
emptys
.
indexOf
(
_wlattice
.
index
)
==-
1
){
this
.
emptys
.
push
(
_wlattice
.
index
);
//黑洞转移,使黑洞占位变空,需要添加到emptys中
for
(
var
_w
=
0
;
_w
<
this
.
lattices
.
length
;
_w
++
){
var
_wlattice
=
this
.
lattices
[
_w
];
if
(
_wlattice
&&!
_wlattice
.
element
&&
this
.
emptys
.
indexOf
(
_wlattice
.
index
)
==-
1
){
this
.
emptys
.
push
(
_wlattice
.
index
);
}
}
}
//棒棒糖消除
var
recoverlp2
=
this
.
checkEmtbbt
();
if
(
recoverlp2
>
0
){
// console.log("传送带棒棒糖消除");
// this.fall(()=>{
// this.fallCallback();
// })
// return;
//棒棒糖消除
var
recoverlp2
=
this
.
checkEmtbbt
();
if
(
recoverlp2
>
0
){
// console.log("传送带棒棒糖消除");
// this.fall(()=>{
// this.fallCallback();
// })
// return;
}
this
.
fall
(()
=>
{
this
.
fallCallback
();
})
return
;
}
this
.
fall
(()
=>
{
this
.
fallCallback
();
})
return
;
}
...
...
@@ -4341,7 +4350,14 @@ export default class MainScene extends Scene {
const
type
=
fireworksTypeMap
[
ele
.
type
];
if
(
this
.
passElements
&&
this
.
passElements
[
type
]
!=
0
)
{
// if (this.passElements && this.passElements[type] != undefined && this.passElements[type] != 0) {
lat
.
element
.
canFire
&&
lat
.
element
.
fire
(
type
);
if
(
lat
.
element
.
canFire
){
let
pro
=
lat
.
element
.
fire
(
type
);
let
isInworm
=
Tool
.
judgeInWormHole
(
index
,
this
.
chapterData
.
map
.
WORMHOLE
);
if
(
isInworm
){
this
.
fireworkPromise
.
push
(
pro
);
}
}
this
.
goElementTarget
(
type
,
[
ele
.
x
,
ele
.
y
]);
}
}
...
...
egret/src/mainScene/doWormHoleAI.ts
View file @
83a5d042
...
...
@@ -2,6 +2,7 @@ import MainScene from "./MainScene";
import
{
Lattice
}
from
"../something/class/Lattice"
;
import
{
LatticeType
}
from
"../something/enum/LatticeType"
;
import
{
Tool
}
from
"../something/Tool"
;
import
{
ElementType
}
from
"../something/enum/ElementType"
;
const
getMapsp
=
function
(
lattice
:
Lattice
){
var
mapcf
:{
...
...
@@ -83,11 +84,11 @@ const tweenAnisp = function(sp:egret.DisplayObject,posx:number,posy:number,latti
scaleY
:
norscaleY
},
500
)
.
call
(()
=>
{
if
(
lattice
&&
mapcf
&&
elecf
){
// console.log("需要替换数据11111111",lattice.index);
lattice
.
changeData
(
mapcf
,
elecf
);
// console.log("替换数据",JSON.stringify(lattice));
}
//
if(lattice&&mapcf&&elecf){
//
// console.log("需要替换数据11111111",lattice.index);
//
lattice.changeData(mapcf,elecf);
//
// console.log("替换数据",JSON.stringify(lattice));
//
}
resolve
();
})
})
...
...
@@ -165,6 +166,16 @@ export default async (thisObj:MainScene)=>{
// console.log("000000发起时准备替换元素",jlidxlattice.index,mapcf.mapdata["maptype"],elecf.eledata["type"]);
let
elepro
=
tweenAnisp
(
elesp
,
jlidxpos
[
0
],
jlidxpos
[
1
]);
promiseList
.
push
(
elepro
);
//烟花特殊处理
if
(
elecf
.
eledata
[
"type"
]
==
ElementType
.
FIREWORKS_SHOOTER
){
// console.log("烟花特殊处理");
let
firework
=
elesp
[
"_fireworks"
];
let
fireposx
=
jlidxpos
[
0
];
let
fireposy
=
jlidxpos
[
1
]
+
12
;
let
firepro
=
tweenAnisp
(
firework
,
fireposx
,
fireposy
);
promiseList
.
push
(
firepro
);
}
}
}
}
...
...
egret/src/something/chapters/Chapter25.ts
View file @
83a5d042
...
...
@@ -52,14 +52,14 @@ export const Chapters25: ChapterData[] = [
// [ 72, 53 ]
// ],
elements
:
[
1
,
1
9
,
1
,
1
,
1
,
1
,
1
,
1
,
22
,
1
,
1
3
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
3
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
22
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
18
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
13
,
1
,
1
,
9
,
1
,
13
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
],
baseElements
:
[
...
...
egret/src/something/class/Element.ts
View file @
83a5d042
...
...
@@ -85,18 +85,21 @@ export class Element extends eui.Component {
return
t
-
this
.
_fireworksTimer
>
2
*
1000
;
}
fire
(
type
:
ElementType
)
{
// zi hong huang lan lv
fire
(
type
:
ElementType
)
{
// zi hong huang lan lv
let
pro
;
this
.
_fireworksTimer
=
new
Date
().
getTime
();
if
(
type
==
ElementType
.
FIREWORKS_RABBIT
)
//rabbit 紫
this
.
toFireworksAction
(
1
,
90
);
pro
=
this
.
toFireworksAction
(
1
,
90
);
else
if
(
type
==
ElementType
.
FIREWORKS_PIG
)
//pig 粉
this
.
toFireworksAction
(
91
,
180
);
pro
=
this
.
toFireworksAction
(
91
,
180
);
else
if
(
type
==
ElementType
.
FIREWORKS_LION
)
//lion 黄
this
.
toFireworksAction
(
181
,
270
);
pro
=
this
.
toFireworksAction
(
181
,
270
);
else
if
(
type
==
ElementType
.
FIREWORKS_CATTLE
)
//cattle 蓝
this
.
toFireworksAction
(
271
,
360
);
pro
=
this
.
toFireworksAction
(
271
,
360
);
else
if
(
type
==
ElementType
.
FIREWORKS_CHICKEN
)
//chicken 绿
this
.
toFireworksAction
(
361
,
450
);
pro
=
this
.
toFireworksAction
(
361
,
450
);
return
pro
;
}
_fireworks
;
...
...
@@ -105,23 +108,31 @@ export class Element extends eui.Component {
this
.
showImage
.
alpha
=
0
;
const
mv
:
any
=
initSvga
(
getFireworksVideoItem
());
this
.
_fireworks
=
mv
;
this
.
_fireworks
.
touchEnabled
=
false
;
this
.
_fireworks
.
touchThrough
=
true
;
thisobj
.
addChild
(
mv
);
// this.addChild(this._fireworks);
mv
.
anchorOffsetX
=
340
/
2
;
mv
.
anchorOffsetY
=
5
0
0
;
mv
.
anchorOffsetY
=
5
5
0
;
mv
.
x
=
this
.
x
;
mv
.
y
=
this
.
y
-
38
;
mv
.
y
=
this
.
y
+
12
;
// mv.y = -38;
this
.
_fireworks
.
gotoAndStop
(
1
);
}
toFireworksAction
(
start
,
end
)
{
const
cb
=
()
=>
{
if
(
this
.
_fireworks
.
currentFrame
==
end
)
{
//向上吹
this
.
_fireworks
.
gotoAndStop
(
start
);
this
.
_fireworks
.
removeEventListener
(
egret
.
Event
.
ENTER_FRAME
,
cb
,
this
);
}
};
this
.
_fireworks
.
addEventListener
(
egret
.
Event
.
ENTER_FRAME
,
cb
,
this
);
this
.
_fireworks
.
gotoAndPlay
(
start
,
true
);
var
pro
=
new
Promise
(
function
(
resolve
,
reject
){
const
cb
=
()
=>
{
if
(
this
.
_fireworks
.
currentFrame
==
end
)
{
//向上吹
this
.
_fireworks
.
gotoAndStop
(
start
);
this
.
_fireworks
.
removeEventListener
(
egret
.
Event
.
ENTER_FRAME
,
cb
,
this
);
resolve
();
}
};
this
.
_fireworks
.
addEventListener
(
egret
.
Event
.
ENTER_FRAME
,
cb
,
this
);
this
.
_fireworks
.
gotoAndPlay
(
start
,
true
);
}.
bind
(
this
));
return
pro
;
}
_mv
;
...
...
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