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
e4705706
Commit
e4705706
authored
Aug 27, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
8de2c301
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
8 deletions
+38
-8
MapScene.ts
egret/src/mapScene/MapScene.ts
+33
-8
home.json
mock/happyclear/home.json
+5
-0
No files found.
egret/src/mapScene/MapScene.ts
View file @
e4705706
...
@@ -48,19 +48,40 @@ export default class MapScene extends Scene {
...
@@ -48,19 +48,40 @@ export default class MapScene extends Scene {
this
.
scrollGroup
.
addChild
(
data
.
bottom
);
this
.
scrollGroup
.
addChild
(
data
.
bottom
);
data
.
bottom
.
y
=
data
.
top
.
height
+
(
data
.
list
.
length
*
data
.
list
[
0
].
height
);
data
.
bottom
.
y
=
data
.
top
.
height
+
(
data
.
list
.
length
*
data
.
list
[
0
].
height
);
let
target
;
const
homeData
=
getHomeData
();
if
(
homeData
.
levels
.
length
==
0
)
{
target
=
1
;
}
else
if
(
homeData
.
levels
.
length
==
70
)
{
target
=
70
;
}
else
{
target
=
homeData
.
levels
.
length
+
1
;
}
for
(
const
key
in
MapScene
.
iconHash
)
{
for
(
const
key
in
MapScene
.
iconHash
)
{
const
levelOrder
=
parseInt
(
key
);
const
element
=
MapScene
.
iconHash
[
key
];
const
element
=
MapScene
.
iconHash
[
key
];
element
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
element
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
const
homeData
=
getHomeData
();
const
levelOrder
=
parseInt
(
key
);
if
(
levelOrder
>
(
homeData
.
levels
.
length
+
1
)
&&
levelOrder
>
1
)
{
if
(
levelOrder
>
(
homeData
.
levels
.
length
+
1
)
&&
levelOrder
>
1
)
{
// showToast('必须通关前面的关卡才能开启本关');
// showToast('必须通关前面的关卡才能开启本关');
}
else
}
else
PanelCtrl
.
instance
.
show
(
'StartPanel'
,
key
);
PanelCtrl
.
instance
.
show
(
'StartPanel'
,
key
);
NetManager
.
ins
.
clickLog
(
getlogItem
(
19
))
NetManager
.
ins
.
clickLog
(
getlogItem
(
19
))
},
this
);
},
this
);
}
}
const
targetIcon
=
MapScene
.
iconHash
[
target
];
const
light
=
RES
.
getRes
(
'lightani_png'
);
const
pic
=
new
egret
.
Bitmap
(
light
);
//76 61
// targetIcon.addChild(pic);
targetIcon
.
addChildAt
(
pic
,
0
);
pic
.
anchorOffsetX
=
76
;
pic
.
anchorOffsetY
=
61
;
pic
.
x
=
50
-
2
;
pic
.
y
=
37
+
10
;
egret
.
Tween
.
get
(
pic
,{
loop
:
true
}).
to
({
scaleX
:
2
,
scaleY
:
2
,
alpha
:
0
},
1000
).
wait
(
1000
);
this
[
'pic'
]
=
pic
;
this
.
updateHomeData
();
this
.
updateHomeData
();
this
.
showLog
();
this
.
showLog
();
this
.
updateBox
();
this
.
updateBox
();
...
@@ -76,15 +97,19 @@ export default class MapScene extends Scene {
...
@@ -76,15 +97,19 @@ export default class MapScene extends Scene {
}
}
},
this
);
},
this
);
const
homeData
=
getHomeData
();
let
lastOrder
=
homeData
.
levels
.
length
+
1
;
let
lastOrder
=
homeData
.
levels
.
length
+
1
;
if
(
homeData
.
levels
.
length
>=
70
)
if
(
homeData
.
levels
.
length
>=
70
)
lastOrder
=
70
;
lastOrder
=
70
;
this
.
scroll
.
viewport
.
scrollV
=
this
.
getScrollV
(
lastOrder
,
this
.
stage
.
stageHeight
);
this
.
scroll
.
viewport
.
scrollV
=
this
.
getScrollV
(
lastOrder
,
this
.
stage
.
stageHeight
);
// console.warn(this.getScrollV(lastOrder, this.stage.stageHeight))
// console.warn(this.getScrollV(lastOrder, this.stage.stageHeight))
const
light
=
RES
.
getRes
(
'lightani_png'
);
const
pic
=
new
egret
.
Bitmap
(
light
);
}
this
.
addChild
(
pic
);
destroy
(){
super
.
destroy
();
if
(
this
[
'pic'
])
egret
.
Tween
.
removeTweens
(
this
[
'pic'
]);
}
}
getScrollV
(
lastOrder
,
stageHeight
)
{
getScrollV
(
lastOrder
,
stageHeight
)
{
...
...
mock/happyclear/home.json
View file @
e4705706
...
@@ -87,6 +87,11 @@
...
@@ -87,6 +87,11 @@
"maxScore"
:
99999
,
"maxScore"
:
99999
,
"stars"
:
3
"stars"
:
3
},
},
{
"levelNum"
:
18
,
"maxScore"
:
99999
,
"stars"
:
3
},
{
{
"levelNum"
:
17
,
"levelNum"
:
17
,
"maxScore"
:
42420
,
"maxScore"
:
42420
,
...
...
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