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
ace1d696
Commit
ace1d696
authored
Aug 21, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
15aadf7b
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
46 deletions
+45
-46
getHomeData.ts
egret/src/getHomeData.ts
+6
-6
MapScene.ts
egret/src/mapScene/MapScene.ts
+2
-2
BloodPanel.ts
egret/src/panels/BloodPanel.ts
+1
-1
StartScene.ts
egret/src/startScene/StartScene.ts
+29
-31
home.json
mock/happyclear/home.json
+7
-6
No files found.
egret/src/getHomeData.ts
View file @
ace1d696
import
{
DataManager
}
from
"../libs/tw/manager/DataManager"
;
interface
IHomeData
{
levels
:{
levelNum
,
maxScore
,
stars
}[];
total
Remain
Starts
;
totalStarts
;
canReceiveTreasureBoxNum
;
wealth
;
heartNums
;
remainEnargy
;
askForEnergy
:
boolean
;
props
:{
propType
,
nums
}[]
remainProp
:{
type
,
num
}[]
}
export
default
():
IHomeData
=>
{
const
{
data
}
=
DataManager
.
ins
.
getData
(
'hc_home'
);
...
...
@@ -15,12 +15,12 @@ export default ():IHomeData=>{
export
const
getPropNums
=
(
type
)
=>
{
const
data
:
IHomeData
=
DataManager
.
ins
.
getData
(
'hc_home'
).
data
;
const
props
=
data
.
props
;
const
props
=
data
.
remainProp
;
let
nums
=
0
;
for
(
const
prop
of
props
)
{
if
(
type
==
prop
.
propT
ype
)
if
(
type
==
prop
.
t
ype
)
{
nums
=
prop
.
num
s
;
nums
=
prop
.
num
;
break
;
}
}
...
...
egret/src/mapScene/MapScene.ts
View file @
ace1d696
...
...
@@ -83,9 +83,9 @@ export default class MapScene extends Scene {
}
updateHomeData
()
{
const
homeData
=
getHomeData
();
this
[
'bloodTxt'
].
text
=
`
${
homeData
.
heartNums
}
/5`
;
this
[
'bloodTxt'
].
text
=
`
${
homeData
.
remainEnargy
}
/5`
;
this
[
'goldTxt'
].
text
=
`
${
homeData
.
wealth
}
`
;
this
[
'totalStarTxt'
].
text
=
`
${
homeData
.
total
RemainStarts
}
/210
`
;
this
[
'totalStarTxt'
].
text
=
`
${
homeData
.
total
Starts
}
/
${
homeData
.
canReceiveTreasureBoxNum
}
`
;
this
[
'boxNumsTxt'
].
text
=
`
${
homeData
.
canReceiveTreasureBoxNum
}
`
;
for
(
let
j
=
0
;
j
<
70
;
j
++
)
{
this
.
disableIcon
(
j
+
1
);
...
...
egret/src/panels/BloodPanel.ts
View file @
ace1d696
...
...
@@ -19,7 +19,7 @@ export default class BloodPanel extends Panel {
private
updateData
()
{
const
homeData
=
getHomeData
();
this
[
'bloodTxt'
].
text
=
`你的可用体力值为:
${
homeData
.
heartNums
}
`
;
this
[
'bloodTxt'
].
text
=
`你的可用体力值为:
${
homeData
.
remainEnargy
}
`
;
const
data
=
getHomeData
();
this
[
'invitTxt'
].
text
=
`(已领0/1)`
;
if
(
data
.
askForEnergy
)
...
...
egret/src/startScene/StartScene.ts
View file @
ace1d696
...
...
@@ -11,7 +11,6 @@ export default class StartScene extends Scene {
private
STOP_PERCENT
=
99
;
private
_current
=
0
;
private
_timer
;
private
startSceneData
:
any
=
{};
async
start
(
data
?)
{
super
.
start
();
...
...
@@ -22,16 +21,16 @@ export default class StartScene extends Scene {
this
[
'progressmask2'
].
scaleX
=
0
;
this
[
'percentTxt'
].
text
=
`0%`
;
if
(
data
)
{
if
(
data
)
{
this
[
'container3'
].
addChild
(
data
[
0
]);
this
[
'container2'
].
addChild
(
data
[
1
]);
this
[
'container1'
].
addChild
(
data
[
2
]);
}
else
{
await
Promise
.
all
([
loadSvga
(
getResPath
()
+
'resource/assets/svgas/loading_progress.svga'
,
this
[
'container3'
]),
loadSvga
(
getResPath
()
+
'resource/assets/svgas/loading_animals.svga'
,
this
[
'container2'
]),
loadSvga
(
getResPath
()
+
'resource/assets/svgas/loading_title.svga'
,
this
[
'container1'
])
loadSvga
(
getResPath
()
+
'resource/assets/svgas/loading_progress.svga'
,
this
[
'container3'
]),
loadSvga
(
getResPath
()
+
'resource/assets/svgas/loading_animals.svga'
,
this
[
'container2'
]),
loadSvga
(
getResPath
()
+
'resource/assets/svgas/loading_title.svga'
,
this
[
'container1'
])
]);
}
...
...
@@ -57,34 +56,16 @@ export default class StartScene extends Scene {
]
);
promise
.
then
(()
=>
{
this
.
createMap
((
)
=>
this
.
onProgressComplete
(
));
this
.
createMap
((
d
)
=>
this
.
onProgressComplete
(
d
));
});
}
else
{
this
.
createMap
((
)
=>
this
.
onProgressComplete
(
))
this
.
createMap
((
d
)
=>
this
.
onProgressComplete
(
d
))
}
}
async
createMap
(
callback
:
Function
)
{
//提前创建地图,以防止卡顿
this
.
startSceneData
.
top
=
new
MapTopPart
();
this
.
startSceneData
.
top
.
loadSkin
();
this
.
startSceneData
.
top
.
start
();
this
.
startSceneData
.
bottom
=
new
MapBottomPart
();
this
.
startSceneData
.
bottom
.
loadSkin
();
this
.
startSceneData
.
bottom
.
start
();
const
list
=
[];
this
.
startSceneData
.
list
=
list
;
for
(
let
i
=
0
;
i
<
4
;
i
++
)
{
const
repeat
=
new
MapRpeatPart
(
i
);
repeat
.
loadSkin
();
repeat
.
start
();
list
.
push
(
repeat
);
}
let
timer
,
count
=
0
;
timer
=
setInterval
(()
=>
{
count
++
;
if
(
count
>=
4
)
clearInterval
(
timer
);
},
1000
/
60
*
2
);
callback
();
const
data
=
createData
();
callback
(
data
);
}
setProgress
(
per
:
number
)
{
...
...
@@ -93,11 +74,11 @@ export default class StartScene extends Scene {
this
[
'percentTxt'
].
text
=
`
${
per
}
%`
}
onProgressComplete
()
{
onProgressComplete
(
d
)
{
setTimeout
(()
=>
{
egret
.
Tween
.
removeTweens
(
this
[
'progressmask2'
]);
egret
.
Tween
.
get
(
this
[
'progressmask2'
]).
to
({
scaleX
:
1
},
200
).
wait
(
200
).
call
(()
=>
{
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
MAP_SCENE
,
this
.
startSceneData
)
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
MAP_SCENE
,
d
)
});
this
[
'percentTxt'
].
text
=
`100%`
clearInterval
(
this
.
_timer
);
...
...
@@ -106,3 +87,20 @@ export default class StartScene extends Scene {
get
skinKey
()
{
return
'Start'
}
}
export
const
createData
=
()
=>
{
const
startSceneData
:
any
=
{};
startSceneData
.
top
=
new
MapTopPart
();
startSceneData
.
top
.
loadSkin
();
startSceneData
.
top
.
start
();
startSceneData
.
bottom
=
new
MapBottomPart
();
startSceneData
.
bottom
.
loadSkin
();
startSceneData
.
bottom
.
start
();
const
list
=
[];
startSceneData
.
list
=
list
;
for
(
let
i
=
0
;
i
<
4
;
i
++
)
{
const
repeat
=
new
MapRpeatPart
(
i
);
repeat
.
loadSkin
();
repeat
.
start
();
list
.
push
(
repeat
);
}
return
startSceneData
}
\ No newline at end of file
mock/happyclear/home.json
View file @
ace1d696
...
...
@@ -2,11 +2,12 @@
"code"
:
"0000000000"
,
"data"
:{
"askForEnergy"
:
true
,
"canReceiveTreasureBoxNum"
:
101
,
"heartNums"
:
1
,
"props"
:[
{
"propType"
:
1
,
"nums"
:
1
},
{
"propType"
:
2
,
"nums"
:
2
}
"canReceiveTreasureBoxNum"
:
23
,
"nextRangeStarsNum"
:
10
,
"remainEnargy"
:
11
,
"remainProp"
:[
{
"type"
:
1
,
"num"
:
1
},
{
"type"
:
2
,
"num"
:
2
}
],
"levels"
:[
{
...
...
@@ -35,7 +36,7 @@
"type"
:
2
}
],
"total
RemainStarts"
:
5
,
"total
Starts"
:
1
5
,
"wealth"
:
5
},
"desc"
:
"OK"
,
...
...
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