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
41b020e6
Commit
41b020e6
authored
May 14, 2020
by
zjz1994
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码暂存
parent
0ee1c419
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
16 deletions
+50
-16
MapBottomPart.ts
egret/src/mapScene/MapBottomPart.ts
+7
-2
MapRpeatPart.ts
egret/src/mapScene/MapRpeatPart.ts
+7
-2
MapScene.ts
egret/src/mapScene/MapScene.ts
+30
-10
MapTopPart.ts
egret/src/mapScene/MapTopPart.ts
+6
-2
No files found.
egret/src/mapScene/MapBottomPart.ts
View file @
41b020e6
...
@@ -19,11 +19,16 @@ export default class MapBottomPart extends ComponentBase {
...
@@ -19,11 +19,16 @@ export default class MapBottomPart extends ComponentBase {
const
icon
=
this
.
getIcon
(
i
);
const
icon
=
this
.
getIcon
(
i
);
icon
.
addChild
(
star
);
icon
.
addChild
(
star
);
icon
.
show
=
()
=>
{
this
.
addChild
(
icon
)
};
icon
.
show
=
()
=>
{
icon
.
visible
=
true
;
};
icon
.
hide
=
()
=>
{
this
.
removeChild
(
icon
)
};
icon
.
hide
=
()
=>
{
icon
.
visible
=
false
;
};
icon
[
'nums'
]
=
icon
.
getChildAt
(
0
);
icon
[
'nums'
]
=
icon
.
getChildAt
(
0
);
icon
[
'bmptxt'
]
=
icon
.
getChildAt
(
1
);
icon
[
'bmptxt'
]
=
icon
.
getChildAt
(
1
);
icon
[
'starsp'
]
=
star
;
icon
[
'starsp'
]
=
star
;
icon
.
touchEnabled
=
true
;
icon
[
'nums'
].
touchEnabled
=
false
;
icon
[
'bmptxt'
].
touchEnabled
=
false
;
icon
[
'starsp'
].
touchEnabled
=
false
;
}
}
// const repeatCount =getRepeatCount();
// const repeatCount =getRepeatCount();
// for (let i = 0; i < MapBottomPart.LEVEL_NUMS; i++) {
// for (let i = 0; i < MapBottomPart.LEVEL_NUMS; i++) {
...
...
egret/src/mapScene/MapRpeatPart.ts
View file @
41b020e6
...
@@ -24,12 +24,17 @@ export default class MapRpeatPart extends ComponentBase {
...
@@ -24,12 +24,17 @@ export default class MapRpeatPart extends ComponentBase {
const
icon
=
this
.
getIcon
(
i
);
const
icon
=
this
.
getIcon
(
i
);
icon
.
addChild
(
star
);
icon
.
addChild
(
star
);
icon
.
show
=
()
=>
{
this
.
addChild
(
icon
)
};
icon
.
show
=
()
=>
{
icon
.
visible
=
true
;
};
icon
.
hide
=
()
=>
{
this
.
removeChild
(
icon
)
};
icon
.
hide
=
()
=>
{
icon
.
visible
=
false
;
};
icon
[
'nums'
]
=
icon
.
getChildAt
(
0
);
icon
[
'nums'
]
=
icon
.
getChildAt
(
0
);
icon
[
'bmptxt'
]
=
icon
.
getChildAt
(
1
);
icon
[
'bmptxt'
]
=
icon
.
getChildAt
(
1
);
icon
[
'starsp'
]
=
star
;
icon
[
'starsp'
]
=
star
;
// icon.hide();
// icon.hide();
icon
.
touchEnabled
=
true
;
icon
[
'nums'
].
touchEnabled
=
false
;
icon
[
'bmptxt'
].
touchEnabled
=
false
;
icon
[
'starsp'
].
touchEnabled
=
false
;
}
}
...
...
egret/src/mapScene/MapScene.ts
View file @
41b020e6
...
@@ -133,8 +133,10 @@ export default class MapScene extends Scene {
...
@@ -133,8 +133,10 @@ export default class MapScene extends Scene {
if
(
!
this
.
pic
){
if
(
!
this
.
pic
){
let
light
=
RES
.
getRes
(
'lightani_png'
);
let
light
=
RES
.
getRes
(
'lightani_png'
);
this
.
pic
=
new
egret
.
Bitmap
(
light
);
this
.
pic
=
new
egret
.
Bitmap
(
light
);
this
.
pic
.
name
=
'water_light'
;
this
.
pic
.
anchorOffsetX
=
76
;
this
.
pic
.
anchorOffsetX
=
76
;
this
.
pic
.
anchorOffsetY
=
61
;
this
.
pic
.
anchorOffsetY
=
61
;
this
.
pic
.
touchEnabled
=
false
;
}
}
}
}
initMapScene
(){
initMapScene
(){
...
@@ -813,15 +815,24 @@ export default class MapScene extends Scene {
...
@@ -813,15 +815,24 @@ export default class MapScene extends Scene {
for
(
var
i
=
0
;
i
<
mapnums
;
i
++
){
for
(
var
i
=
0
;
i
<
mapnums
;
i
++
){
const
levelOrder
=
startlevel
+
i
+
1
;
const
levelOrder
=
startlevel
+
i
+
1
;
let
icon
=
mappart
.
getIcon
(
i
);
let
icon
=
mappart
.
getIcon
(
i
);
let
havewater_light
=
icon
.
getChildByName
(
'water_light'
);
icon
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
showToastQd
);
icon
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
showToastQd
);
mappart
.
getTxt
(
i
).
text
=
levelOrder
+
''
;
mappart
.
getTxt
(
i
).
text
=
levelOrder
+
''
;
if
(
levelOrder
>
last_level
){
if
(
levelOrder
>
last_level
){
if
(
havewater_light
){
console
.
log
(
"当前关卡,移除water_light"
,
levelOrder
);
icon
.
removeChild
(
this
.
pic
);
}
(
icon
[
'nums'
]
as
eui
.
Image
).
source
=
'icongray_png'
;
(
icon
[
'nums'
]
as
eui
.
Image
).
source
=
'icongray_png'
;
(
icon
[
'bmptxt'
]
as
eui
.
BitmapLabel
).
visible
=
false
;
(
icon
[
'bmptxt'
]
as
eui
.
BitmapLabel
).
visible
=
false
;
icon
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
showToastQd
,
this
);
icon
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
showToastQd
,
this
);
(
icon
[
'starsp'
]
as
MapStarComp
).
visible
=
false
;
(
icon
[
'starsp'
]
as
MapStarComp
).
visible
=
false
;
setGray
(
icon
);
setGray
(
icon
);
}
else
if
(
levelOrder
<
homeData
.
levels
.
length
+
1
){
}
else
if
(
levelOrder
<
homeData
.
levels
.
length
+
1
){
if
(
havewater_light
){
console
.
log
(
"当前关卡,移除water_light"
,
levelOrder
);
icon
.
removeChild
(
this
.
pic
);
}
icon
.
filters
=
null
;
icon
.
filters
=
null
;
var
leveldata
=
homeData
.
levels
[
levelOrder
-
1
];
var
leveldata
=
homeData
.
levels
[
levelOrder
-
1
];
console
.
log
(
"关卡测试:"
+
levelOrder
);
console
.
log
(
"关卡测试:"
+
levelOrder
);
...
@@ -837,21 +848,30 @@ export default class MapScene extends Scene {
...
@@ -837,21 +848,30 @@ export default class MapScene extends Scene {
(
icon
[
'bmptxt'
]
as
eui
.
BitmapLabel
).
font
=
'nums_fnt'
;
(
icon
[
'bmptxt'
]
as
eui
.
BitmapLabel
).
font
=
'nums_fnt'
;
(
icon
[
'starsp'
]
as
MapStarComp
).
setStar
(
0
);
(
icon
[
'starsp'
]
as
MapStarComp
).
setStar
(
0
);
(
icon
[
'starsp'
]
as
MapStarComp
).
visible
=
true
;
(
icon
[
'starsp'
]
as
MapStarComp
).
visible
=
true
;
this
.
pic
.
x
=
icon
.
x
+
50
;
if
(
!
havewater_light
){
this
.
pic
.
y
=
icon
.
y
+
37
+
7
;
this
.
pic
.
x
=
50
;
egret
.
Tween
.
removeTweens
(
this
.
pic
);
this
.
pic
.
y
=
37
+
7
;
egret
.
Tween
.
get
(
this
.
pic
,
{
loop
:
true
})
icon
.
addChild
(
this
.
pic
);
.
set
({
scaleX
:
1
,
egret
.
Tween
.
removeTweens
(
this
.
pic
);
scaleY
:
1
,
egret
.
Tween
.
get
(
this
.
pic
,
{
loop
:
true
})
alpha
:
1
.
set
({
})
scaleX
:
1
,
.
to
({
scaleX
:
2
,
scaleY
:
2
,
alpha
:
0
},
1000
).
wait
(
1000
);
scaleY
:
1
,
alpha
:
1
})
.
to
({
scaleX
:
2
,
scaleY
:
2
,
alpha
:
0
},
1000
).
wait
(
1000
);
console
.
log
(
"当前关卡,添加water_light"
,
levelOrder
,
this
.
pic
);
}
}
else
{
}
else
{
icon
.
filters
=
null
;
icon
.
filters
=
null
;
(
icon
[
'nums'
]
as
eui
.
Image
).
source
=
'icongray_png'
;
(
icon
[
'nums'
]
as
eui
.
Image
).
source
=
'icongray_png'
;
(
icon
[
'bmptxt'
]
as
eui
.
BitmapLabel
).
visible
=
false
;
(
icon
[
'bmptxt'
]
as
eui
.
BitmapLabel
).
visible
=
false
;
(
icon
[
'starsp'
]
as
MapStarComp
).
visible
=
false
;
(
icon
[
'starsp'
]
as
MapStarComp
).
visible
=
false
;
if
(
havewater_light
){
console
.
log
(
"当前关卡,移除water_light"
,
levelOrder
);
icon
.
removeChild
(
this
.
pic
);
}
}
}
if
(
!
icon
.
hasEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
)){
if
(
!
icon
.
hasEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
)){
icon
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
clickIcon
,
this
);
icon
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
clickIcon
,
this
);
...
...
egret/src/mapScene/MapTopPart.ts
View file @
41b020e6
...
@@ -14,12 +14,16 @@ export default class MapTopPart extends ComponentBase {
...
@@ -14,12 +14,16 @@ export default class MapTopPart extends ComponentBase {
const
icon
=
this
.
getIcon
(
i
);
const
icon
=
this
.
getIcon
(
i
);
icon
.
addChild
(
star
);
icon
.
addChild
(
star
);
icon
.
show
=
()
=>
{
this
.
addChild
(
icon
)
};
icon
.
show
=
()
=>
{
icon
.
visible
=
true
;
};
icon
.
hide
=
()
=>
{
this
.
removeChild
(
icon
)
};
icon
.
hide
=
()
=>
{
icon
.
visible
=
false
;
};
icon
[
'nums'
]
=
icon
.
getChildAt
(
0
);
icon
[
'nums'
]
=
icon
.
getChildAt
(
0
);
icon
[
'bmptxt'
]
=
icon
.
getChildAt
(
1
);
icon
[
'bmptxt'
]
=
icon
.
getChildAt
(
1
);
icon
[
'starsp'
]
=
star
;
icon
[
'starsp'
]
=
star
;
icon
.
touchEnabled
=
true
;
icon
[
'nums'
].
touchEnabled
=
false
;
icon
[
'bmptxt'
].
touchEnabled
=
false
;
icon
[
'starsp'
].
touchEnabled
=
false
;
}
}
// for (let i = 0; i < MapTopPart.LEVEL_NUMS; i++) {
// for (let i = 0; i < MapTopPart.LEVEL_NUMS; i++) {
...
...
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