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
e3c7f4dd
Commit
e3c7f4dd
authored
Nov 06, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
98bf1fc4
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
114 additions
and
28 deletions
+114
-28
MainBase.ts
egret/libs/new_wx/MainBase.ts
+1
-0
maplight2.png
egret/resource/assets/map/maplight2.png
+0
-0
default.res.json
egret/resource/default.res.json
+13
-8
createEffect1.ts
egret/src/effect/createEffect1.ts
+33
-0
createEffect2.ts
egret/src/effect/createEffect2.ts
+22
-0
MapScene.ts
egret/src/mapScene/MapScene.ts
+27
-12
MovieClip.ts
egret/src/movieclip/MovieClip.ts
+1
-1
BombTipsPanel.ts
egret/src/panels/BombTipsPanel.ts
+17
-7
No files found.
egret/libs/new_wx/MainBase.ts
View file @
e3c7f4dd
...
...
@@ -210,6 +210,7 @@ export default class MainBase extends eui.UILayer {
}
else
{
RES
.
getResAsync
(
'mapredbagicom_png'
);
RES
.
getResAsync
(
'maplight2_png'
);
RES
.
getResAsync
(
'main_mapbottom_png'
);
RES
.
getResAsync
(
'lightani_png'
);
...
...
egret/resource/assets/map/maplight2.png
0 → 100644
View file @
e3c7f4dd
3.93 KB
egret/resource/default.res.json
View file @
e3c7f4dd
...
...
@@ -202,7 +202,7 @@
},
{
"name"
:
"preload"
,
"keys"
:
"map
redbagicom_png,effect1_json,effect2_json
"
"keys"
:
"map
light2_png
"
}
],
"resources"
:
[
...
...
@@ -3517,21 +3517,26 @@
"name"
:
"redbagtips活动规则_png"
},
{
"
name"
:
"mapredbagicom_
png"
,
"
url"
:
"assets/map/mapredbagicom.
png"
,
"type"
:
"image"
,
"
url"
:
"assets/map/mapredbagicom.
png"
"
name"
:
"mapredbagicom_
png"
},
{
"name"
:
"effect1_json"
,
"type"
:
"sheet"
,
"url"
:
"assets/mc/effect1.json"
,
"type"
:
"sheet"
,
"name"
:
"effect1_json"
,
"subkeys"
:
"红包爆炸_00000,红包爆炸_00001,红包爆炸_00002,红包爆炸_00003,红包爆炸_00004,红包爆炸_00005,红包爆炸_00006,红包爆炸_00007,红包爆炸_00008,红包爆炸_00009,红包爆炸_00010,红包爆炸_00011,红包爆炸_00012,红包爆炸_00013,红包爆炸_00014,红包爆炸_00015,红包爆炸_00016,红包爆炸_00017,红包爆炸_00018"
},
{
"name"
:
"effect2_json"
,
"type"
:
"sheet"
,
"url"
:
"assets/mc/effect2.json"
,
"subkeys"
:
"反馈1_00028,反馈1_00027,反馈1_00026,反馈1_00025,反馈1_00024,反馈1_00023,反馈1_00022,反馈1_00021,反馈1_00020,反馈1_00019,反馈1_00018,反馈1_00017,反馈1_00016,反馈1_00015,反馈1_00014,反馈1_00013,反馈1_00012,反馈1_00011,反馈1_00010,反馈1_00009,反馈1_00008,反馈1_00007,反馈1_00006,反馈1_00005,反馈1_00004,反馈1_00003,反馈1_00002,反馈1_00001,反馈1_00000"
"type"
:
"sheet"
,
"name"
:
"effect2_json"
,
"subkeys"
:
"反馈1_00000,反馈1_00001,反馈1_00002,反馈1_00003,反馈1_00004,反馈1_00005,反馈1_00006,反馈1_00007,反馈1_00008,反馈1_00009,反馈1_00010,反馈1_00011,反馈1_00012,反馈1_00013,反馈1_00014,反馈1_00015,反馈1_00016,反馈1_00017,反馈1_00018,反馈1_00019,反馈1_00020,反馈1_00021,反馈1_00022,反馈1_00023,反馈1_00024,反馈1_00025,反馈1_00026,反馈1_00027,反馈1_00028"
},
{
"name"
:
"maplight2_png"
,
"type"
:
"image"
,
"url"
:
"assets/map/maplight2.png"
}
]
}
\ No newline at end of file
egret/src/effect/createEffect1.ts
0 → 100644
View file @
e3c7f4dd
import
MovieClip
from
"../movieclip/MovieClip"
;
export
const
createEffect1MovieClip
=
()
=>
{
const
spritesheet
=
RES
.
getRes
(
'effect1_json'
);
const
list
=
getEffectFramesStr
(
'红包爆炸_000'
,
0
,
18
);
const
movieclip
=
new
MovieClip
({
spritesheet
:
spritesheet
,
frameInterval
:
2
,
frames
:
list
,
position
:
[
750
/
2
,
750
-
100
],
scale
:
1
,
anchor
:
[.
5
,
.
5
],
loop
:
false
});
movieclip
.
once
(
egret
.
Event
.
COMPLETE
,
()
=>
{
if
(
movieclip
.
parent
)
movieclip
.
parent
.
removeChild
(
movieclip
);
},
this
)
return
movieclip
}
const
getNumStr
=
(
num
)
=>
{
return
num
>=
10
?
`
${
num
}
`
:
`0
${
num
}
`
;
}
export
const
getEffectFramesStr
=
(
str
,
start
,
end
)
=>
{
const
list
=
[];
for
(
let
index
=
start
;
index
<=
end
;
index
++
)
{
list
.
push
(
str
+
getNumStr
(
index
));
}
return
list
;
}
\ No newline at end of file
egret/src/effect/createEffect2.ts
0 → 100644
View file @
e3c7f4dd
import
MovieClip
from
"../movieclip/MovieClip"
;
import
{
getEffectFramesStr
}
from
"./createEffect1"
;
export
const
createEffect2MovieClip
=
(
x
,
y
)
=>
{
const
spritesheet
=
RES
.
getRes
(
'effect2_json'
);
const
list
=
getEffectFramesStr
(
'反馈1_000'
,
0
,
28
);
const
movieclip
=
new
MovieClip
({
spritesheet
:
spritesheet
,
frameInterval
:
1
,
frames
:
list
,
position
:
[
x
,
y
-
70
],
scale
:
1
,
anchor
:
[.
5
,
.
5
],
loop
:
false
});
movieclip
.
once
(
egret
.
Event
.
COMPLETE
,
()
=>
{
if
(
movieclip
.
parent
)
movieclip
.
parent
.
removeChild
(
movieclip
);
},
this
)
return
movieclip
}
\ No newline at end of file
egret/src/mapScene/MapScene.ts
View file @
e3c7f4dd
...
...
@@ -27,6 +27,7 @@ import MapRpeatPart from "./MapRpeatPart";
import
MapTopPart
from
"./MapTopPart"
;
import
createRegTriangle
from
"../playScene/factory/createRegTriangle"
;
import
RedBagAni
,
{
createRedBagIcon
}
from
"./RedBagAni"
;
import
{
createEffect2MovieClip
}
from
"../effect/createEffect2"
;
let
doHelpFlag
=
false
;
// let doScratchHelpFlag = false;
...
...
@@ -948,30 +949,44 @@ export default class MapScene extends Scene {
if
(
ele
.
parent
)
keys
.
push
(
key
);
}
const
p0
=
new
egret
.
Point
(
750
/
2
,
750
/
1.5
);
const
p0
=
new
egret
.
Point
(
750
/
2
,
750
/
1.5
);
const
pics
=
[];
for
(
const
key
of
keys
)
{
const
icon
=
MapScene
.
iconHash
[
key
]
as
egret
.
DisplayObject
;
const
p
=
(
icon
.
localToGlobal
(
0
,
0
));
const
pic
=
createRedBagIcon
(
this
);
pic
.
visible
=
false
;
pic
.
visible
=
false
;
pic
[
'__p2__'
]
=
p
;
p
.
x
+=
50
;
p
.
y
+=
25
;
pic
[
'__icon__'
]
=
icon
;
p
.
x
+=
50
;
p
.
y
+=
25
;
pics
.
push
(
pic
);
}
// console.log(keys);
pics
.
forEach
(
(
pic
,
index
)
=>
{
wait
(
50
*
index
).
then
(()
=>
{
pic
.
visible
=
true
;
pics
.
forEach
(
(
pic
,
index
)
=>
{
wait
(
50
*
index
).
then
(()
=>
{
pic
.
visible
=
true
;
const
p2
=
pic
[
'__p2__'
]
as
egret
.
Point
;
let
dir
=
100
;
if
(
p2
.
y
<
p0
.
y
)
if
(
p2
.
y
<
p0
.
y
)
dir
*=
-
1
;
const
p1x
=
(
p0
.
x
+
p2
.
x
)
/
2
+
dir
;
const
p1y
=
(
p0
.
y
+
p2
.
y
)
/
2
;
const
p1
=
new
egret
.
Point
(
p1x
,
p1y
);
new
RedBagAni
(
p0
,
p1
,
p2
,
pic
);
const
p1x
=
(
p0
.
x
+
p2
.
x
)
/
2
+
dir
;
const
p1y
=
(
p0
.
y
+
p2
.
y
)
/
2
;
const
p1
=
new
egret
.
Point
(
p1x
,
p1y
);
new
RedBagAni
(
p0
,
p1
,
p2
,
pic
,
()
=>
{
const
mc
=
createEffect2MovieClip
(
p2
.
x
,
p2
.
y
);
this
.
addChild
(
mc
);
const
x0
=
pic
[
'__icon__'
].
x
;
const
y0
=
pic
[
'__icon__'
].
y
;
egret
.
Tween
.
get
(
pic
[
'__icon__'
]).
to
({
y
:
y0
+
10
},
100
).
to
({
y
:
y0
},
100
);
const
light
=
new
egret
.
Bitmap
(
RES
.
getRes
(
'maplight2_png'
));
light
.
anchorOffsetX
=
75
;
light
.
anchorOffsetY
=
49
;
light
.
x
=
50
;
light
.
y
=
40
+
5
;
pic
[
'__icon__'
].
addChildAt
(
light
,
0
);
egret
.
Tween
.
get
(
light
).
to
({
scaleX
:
1.5
,
scaleY
:
1.5
,},
200
).
call
(()
=>
{
pic
[
'__icon__'
].
removeChild
(
light
);
});
});
});
})
}
...
...
egret/src/movieclip/MovieClip.ts
View file @
e3c7f4dd
...
...
@@ -63,7 +63,7 @@ export default class MovieClip extends egret.Bitmap {
this
.
currentFrame
=
0
;
}
else
{
this
.
stop
();
this
.
dispatchEvent
(
new
egret
.
Event
(
egret
.
Event
.
COMPLETE
))
this
.
dispatchEvent
(
new
egret
.
Event
(
egret
.
Event
.
COMPLETE
))
;
}
}
}
...
...
egret/src/panels/BombTipsPanel.ts
View file @
e3c7f4dd
import
Panel
from
"../../libs/new_wx/components/Panel"
;
import
PanelCtrl
from
"../../libs/new_wx/ctrls/panelCtrl"
;
import
SceneCtrl
from
"../../libs/new_wx/ctrls/sceneCtrl"
;
import
{
createEffect1MovieClip
}
from
"../effect/createEffect1"
;
export
default
class
BombTipsPanel
extends
Panel
{
start
(
data
)
{
async
start
(
data
)
{
super
.
start
();
this
.
showlog
();
egret
.
Tween
.
get
(
this
[
'light'
],
{
loop
:
true
}).
to
({
rotation
:
360
},
8000
);
...
...
@@ -19,6 +20,11 @@ export default class BombTipsPanel extends Panel {
egret
.
Tween
.
get
(
this
[
'ele4'
],
{
loop
:
true
}).
to
({
x
:
this
[
'ele4'
].
x
-
30
,
y
:
this
[
'ele4'
].
y
+
30
},
1000
)
.
to
({
x
:
this
[
'ele4'
].
x
,
y
:
this
[
'ele4'
].
y
},
1000
);
this
.
touchChildren
=
this
.
touchEnabled
=
false
;
await
RES
.
getResAsync
(
'effect1_json'
);
await
RES
.
getResAsync
(
'effect2_json'
);
this
.
touchChildren
=
this
.
touchEnabled
=
true
;
}
showlog
()
{
...
...
@@ -30,14 +36,10 @@ export default class BombTipsPanel extends Panel {
}
onTapInvite
()
{
this
[
'btn'
].
touchEnabled
=
false
;
const
eles
=
[
'btn'
,
'rulebtn'
,
'bg'
,
'ele1'
,
'ele2'
,
'ele3'
,
'ele4'
,
'light'
];
const
dur
=
100
;
eles
.
forEach
((
e
,
index
)
=>
{
// if (index == 0)
// egret.Tween.get(this[e]).to({ alpha: 0 }, dur).call(() => {
// });
// else
egret
.
Tween
.
get
(
this
[
e
]).
to
({
alpha
:
0
},
dur
);
});
const
mask
=
PanelCtrl
.
instance
.
_mask
;
...
...
@@ -45,8 +47,16 @@ export default class BombTipsPanel extends Panel {
egret
.
Tween
.
get
(
this
[
'redbag'
]).
to
({
scaleX
:
0.7
,
scaleY
:
0.7
},
100
)
.
to
({
scaleX
:
1.5
,
scaleY
:
1.5
,
alpha
:
0
},
300
);
setTimeout
(()
=>
{
const
mc
=
createEffect1MovieClip
();
this
.
addChild
(
mc
);
},
200
);
setTimeout
(()
=>
{
SceneCtrl
.
instance
.
currentScene
[
'showRedBagAni'
]();
},
400
);
setTimeout
(()
=>
{
this
.
hidePanel
();
},
1000
);
}
...
...
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