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
3fcb6966
Commit
3fcb6966
authored
Nov 04, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
284d5699
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
141 additions
and
106 deletions
+141
-106
MapBottomPart.ts
egret/src/mapScene/MapBottomPart.ts
+3
-1
MapRpeatPart.ts
egret/src/mapScene/MapRpeatPart.ts
+3
-2
MapScene.ts
egret/src/mapScene/MapScene.ts
+120
-97
MapTopPart.ts
egret/src/mapScene/MapTopPart.ts
+3
-1
StartScene.ts
egret/src/startScene/StartScene.ts
+12
-5
No files found.
egret/src/mapScene/MapBottomPart.ts
View file @
3fcb6966
...
@@ -10,7 +10,7 @@ import { getRepeatCount } from "../startScene/StartScene";
...
@@ -10,7 +10,7 @@ import { getRepeatCount } from "../startScene/StartScene";
export
default
class
MapBottomPart
extends
ComponentBase
{
export
default
class
MapBottomPart
extends
ComponentBase
{
static
LEVEL_NUMS
=
11
;
static
LEVEL_NUMS
=
11
;
getTxt
(
i
):
eui
.
BitmapLabel
{
return
this
[
`txt
${
i
}
`
];
}
getTxt
(
i
):
eui
.
BitmapLabel
{
return
this
[
`txt
${
i
}
`
];
}
start
()
{
start
(
{
repeatHeight
,
topHeight
}
)
{
super
.
start
();
super
.
start
();
const
repeatCount
=
getRepeatCount
();
const
repeatCount
=
getRepeatCount
();
for
(
let
i
=
0
;
i
<
MapBottomPart
.
LEVEL_NUMS
;
i
++
)
{
for
(
let
i
=
0
;
i
<
MapBottomPart
.
LEVEL_NUMS
;
i
++
)
{
...
@@ -31,6 +31,7 @@ export default class MapBottomPart extends ComponentBase {
...
@@ -31,6 +31,7 @@ export default class MapBottomPart extends ComponentBase {
const
icon
=
MapScene
.
iconHash
[
levelOrder
]
=
this
.
getIcon
(
i
);
const
icon
=
MapScene
.
iconHash
[
levelOrder
]
=
this
.
getIcon
(
i
);
this
.
removeChild
(
icon
);
this
.
removeChild
(
icon
);
icon
.
show
=
()
=>
{
this
.
addChild
(
icon
)};
icon
.
show
=
()
=>
{
this
.
addChild
(
icon
)};
icon
.
hide
=
()
=>
{
this
.
removeChild
(
icon
)};
icon
[
'nums'
]
=
icon
.
getChildAt
(
0
);
icon
[
'nums'
]
=
icon
.
getChildAt
(
0
);
icon
[
'bmptxt'
]
=
icon
.
getChildAt
(
1
);
icon
[
'bmptxt'
]
=
icon
.
getChildAt
(
1
);
icon
[
'mappart'
]
=
this
;
icon
[
'mappart'
]
=
this
;
...
@@ -39,6 +40,7 @@ export default class MapBottomPart extends ComponentBase {
...
@@ -39,6 +40,7 @@ export default class MapBottomPart extends ComponentBase {
star
.
loadSkin
();
star
.
start
();
star
.
loadSkin
();
star
.
start
();
MapScene
.
starHash
[
levelOrder
]
=
star
;
MapScene
.
starHash
[
levelOrder
]
=
star
;
icon
.
addChild
(
star
);
icon
.
addChild
(
star
);
icon
[
'visibleY'
]
=
icon
.
y
+
topHeight
+
repeatHeight
*
repeatCount
;
}
}
}
}
...
...
egret/src/mapScene/MapRpeatPart.ts
View file @
3fcb6966
...
@@ -12,7 +12,6 @@ export default class MapRpeatPart extends ComponentBase {
...
@@ -12,7 +12,6 @@ export default class MapRpeatPart extends ComponentBase {
super
();
super
();
this
.
_index
=
i
;
this
.
_index
=
i
;
this
.
_topHeight
=
topHeight
;
this
.
_topHeight
=
topHeight
;
// createData()
}
}
start
()
{
start
()
{
...
@@ -24,6 +23,7 @@ export default class MapRpeatPart extends ComponentBase {
...
@@ -24,6 +23,7 @@ export default class MapRpeatPart extends ComponentBase {
const
icon
=
MapScene
.
iconHash
[
levelOrder
]
=
this
.
getIcon
(
i
);
const
icon
=
MapScene
.
iconHash
[
levelOrder
]
=
this
.
getIcon
(
i
);
this
.
removeChild
(
icon
);
this
.
removeChild
(
icon
);
icon
.
show
=
()
=>
{
this
.
addChild
(
icon
)};
icon
.
show
=
()
=>
{
this
.
addChild
(
icon
)};
icon
.
hide
=
()
=>
{
this
.
removeChild
(
icon
)};
icon
[
'nums'
]
=
icon
.
getChildAt
(
0
);
icon
[
'nums'
]
=
icon
.
getChildAt
(
0
);
icon
[
'bmptxt'
]
=
icon
.
getChildAt
(
1
);
icon
[
'bmptxt'
]
=
icon
.
getChildAt
(
1
);
icon
[
'mappart'
]
=
this
;
icon
[
'mappart'
]
=
this
;
...
@@ -32,7 +32,8 @@ export default class MapRpeatPart extends ComponentBase {
...
@@ -32,7 +32,8 @@ export default class MapRpeatPart extends ComponentBase {
star
.
loadSkin
();
star
.
start
();
star
.
loadSkin
();
star
.
start
();
MapScene
.
starHash
[
levelOrder
]
=
star
;
MapScene
.
starHash
[
levelOrder
]
=
star
;
icon
.
addChild
(
star
);
icon
.
addChild
(
star
);
icon
[
'visibleY'
]
=
this
.
_topHeight
+
this
icon
[
'visibleY'
]
=
this
.
_topHeight
+
this
.
height
*
this
.
_index
+
icon
.
y
;
console
.
log
(
icon
[
'visibleY'
]
);
}
}
this
[
'animal1'
].
visible
=
this
.
_index
%
2
;
this
[
'animal1'
].
visible
=
this
.
_index
%
2
;
...
...
egret/src/mapScene/MapScene.ts
View file @
3fcb6966
This diff is collapsed.
Click to expand it.
egret/src/mapScene/MapTopPart.ts
View file @
3fcb6966
import
ComponentBase
from
"../../libs/new_wx/components/ComponentBase"
;
import
ComponentBase
from
"../../libs/new_wx/components/ComponentBase"
;
import
MapScene
from
"./MapScene"
;
import
MapScene
from
"./MapScene"
;
import
MapStarComp
from
"./MapStarComp"
;
import
MapStarComp
from
"./MapStarComp"
;
import
{
createData
}
from
"../startScene/StartScene"
;
export
default
class
MapTopPart
extends
ComponentBase
{
export
default
class
MapTopPart
extends
ComponentBase
{
static
LEVEL_NUMS
=
7
;
static
LEVEL_NUMS
=
7
;
...
@@ -18,10 +19,11 @@ export default class MapTopPart extends ComponentBase {
...
@@ -18,10 +19,11 @@ export default class MapTopPart extends ComponentBase {
icon
[
'nums'
]
=
icon
.
getChildAt
(
0
);
icon
[
'nums'
]
=
icon
.
getChildAt
(
0
);
icon
[
'bmptxt'
]
=
icon
.
getChildAt
(
1
);
icon
[
'bmptxt'
]
=
icon
.
getChildAt
(
1
);
this
.
removeChild
(
icon
);
this
.
removeChild
(
icon
);
icon
.
hide
=
()
=>
{
this
.
removeChild
(
icon
)};
icon
[
'mappart'
]
=
this
;
icon
[
'mappart'
]
=
this
;
icon
.
show
=
()
=>
{
this
.
addChild
(
icon
)};
icon
.
show
=
()
=>
{
this
.
addChild
(
icon
)};
icon
[
'visibleY'
]
=
icon
.
y
;
icon
[
'visibleY'
]
=
icon
.
y
;
console
.
log
(
icon
[
'visibleY'
]);
}
}
}
}
...
...
egret/src/startScene/StartScene.ts
View file @
3fcb6966
...
@@ -111,19 +111,26 @@ export const changeMapScene = (p?) => {
...
@@ -111,19 +111,26 @@ export const changeMapScene = (p?) => {
export
const
createData
=
()
=>
{
export
const
createData
=
()
=>
{
const
startSceneData
:
any
=
{};
const
startSceneData
:
any
=
{};
startSceneData
.
top
=
new
MapTopPart
();
startSceneData
.
top
.
loadSkin
();
startSceneData
.
top
.
start
();
const
repeatCount
=
getRepeatCount
();
startSceneData
.
bottom
=
new
MapBottomPart
();
startSceneData
.
bottom
.
loadSkin
();
startSceneData
.
bottom
.
start
();
const
list
=
[];
const
list
=
[];
startSceneData
.
list
=
list
;
startSceneData
.
list
=
list
;
const
repeatCount
=
getRepeatCount
();
startSceneData
.
top
=
new
MapTopPart
();
startSceneData
.
top
.
loadSkin
();
startSceneData
.
top
.
start
();
for
(
let
i
=
0
;
i
<
repeatCount
;
i
++
)
{
for
(
let
i
=
0
;
i
<
repeatCount
;
i
++
)
{
const
repeat
=
new
MapRpeatPart
(
i
,
startSceneData
.
top
.
height
);
const
repeat
=
new
MapRpeatPart
(
i
,
startSceneData
.
top
.
height
);
repeat
.
loadSkin
();
repeat
.
start
();
repeat
.
loadSkin
();
repeat
.
start
();
list
.
push
(
repeat
);
list
.
push
(
repeat
);
}
}
startSceneData
.
bottom
=
new
MapBottomPart
();
startSceneData
.
bottom
.
loadSkin
();
startSceneData
.
bottom
.
start
({
repeatHeight
:
list
[
0
].
height
,
topHeight
:
startSceneData
.
top
.
height
});
return
startSceneData
return
startSceneData
}
}
...
...
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