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
cede12d6
Commit
cede12d6
authored
Aug 30, 2019
by
wjf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
l
parent
c3265068
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
56 deletions
+62
-56
MainBase.ts
egret/libs/new_wx/MainBase.ts
+2
-0
MainScene.ts
egret/src/mainScene/MainScene.ts
+1
-1
GuideCon.ts
egret/src/mapScene/GuideCon.ts
+43
-38
MapScene.ts
egret/src/mapScene/MapScene.ts
+6
-6
ShowWord.ts
egret/src/something/uis/ShowWord.ts
+10
-11
No files found.
egret/libs/new_wx/MainBase.ts
View file @
cede12d6
...
...
@@ -173,6 +173,8 @@ export default class MainBase extends eui.UILayer {
RES
.
getResAsync
(
"guideTxt"
+
i
+
"_png"
)
}
var
arr
=
[
"道具"
,
"recordbtn"
,
"lionMsgBg"
,
"guideBox"
,
"msgTri"
,
...
...
egret/src/mainScene/MainScene.ts
View file @
cede12d6
...
...
@@ -277,7 +277,7 @@ export default class MainScene extends Scene {
playSound
(
SoundType
.
fail
);
PanelCtrl
.
instance
.
show
(
"failed"
,
{
level
:
this
.
chapter
});
},
this
)
this
.
addChild
(
fail
);
//
this.addChild(fail);
var
sucess
=
new
eui
.
Image
(
RES
.
getRes
(
"guideKnowBtn_png"
));
sucess
.
x
=
474
;
sucess
.
y
=
10
;
...
...
egret/src/mapScene/GuideCon.ts
View file @
cede12d6
...
...
@@ -72,48 +72,45 @@ export class GuideCon extends egret.DisplayObjectContainer {
this
.
tri
=
tri
;
this
.
addChild
(
tri
);
this
.
showWord
=
new
ShowWord
();
this
.
showWord
.
x
=
286
;
this
.
showWord
.
x
=
315
;
this
.
showWord
.
y
=
692
;
this
.
addChild
(
this
.
showWord
);
this
.
groups
=
[];
//两个图标,道具商城和我的奖励
var
gg
=
new
egret
.
DisplayObjectContainer
();
gg
.
addChild
(
new
egret
.
Bitmap
(
RES
.
getRes
(
"道具_png"
)));
var
recordBtn
=
new
egret
.
Bitmap
(
RES
.
getRes
(
"recordbtn_png"
));
recordBtn
.
y
=
304.4
-
154
;
gg
.
addChild
(
recordBtn
);
this
.
addChild
(
gg
);
this
.
groups
.
push
(
gg
);
//guideLove
var
guideLove
=
new
egret
.
Bitmap
(
RES
.
getRes
(
"guideLove_png"
));
guideLove
.
x
=
38.72
;
guideLove
.
y
=
23.5
;
this
.
addChild
(
guideLove
);
this
.
groups
.
push
(
guideLove
);
//guideMoney
var
guideMoney
=
new
egret
.
Bitmap
(
RES
.
getRes
(
"guideMoney_png"
));
guideMoney
.
x
=
354
;
guideMoney
.
y
=
24.34
;
this
.
addChild
(
guideMoney
);
this
.
groups
.
push
(
guideMoney
);
//关卡
var
guideLevel
=
new
egret
.
Bitmap
(
RES
.
getRes
(
"guideLevel_png"
));
guideLevel
.
x
=
20.61
;
guideLevel
.
y
=
136.24
;
guideLevel
.
x
=
315
;
guideLevel
.
y
=
462
;
this
.
addChild
(
guideLevel
);
console
.
log
(
guideLevel
);
this
.
groups
.
push
(
guideLevel
);
//宝箱
var
box
=
new
egret
.
Bitmap
(
RES
.
getRes
(
"guideBox_png"
));
box
.
x
=
20.61
;
box
.
y
=
136.24
;
this
.
addChild
(
box
);
this
.
groups
.
push
(
box
);
//guideMoney
var
guideMoney
=
new
egret
.
Bitmap
(
RES
.
getRes
(
"guideMoney_png"
));
guideMoney
.
x
=
354
;
guideMoney
.
y
=
24.34
;
this
.
addChild
(
guideMoney
);
this
.
groups
.
push
(
guideMoney
);
//guideLove
var
guideLove
=
new
egret
.
Bitmap
(
RES
.
getRes
(
"guideLove_png"
));
guideLove
.
x
=
38.72
;
guideLove
.
y
=
23.5
;
this
.
addChild
(
guideLove
);
this
.
groups
.
push
(
guideLove
);
//两个图标,道具商城和我的奖励
var
gg
=
new
egret
.
DisplayObjectContainer
();
gg
.
addChild
(
new
egret
.
Bitmap
(
RES
.
getRes
(
"道具_png"
)));
var
recordBtn
=
new
egret
.
Bitmap
(
RES
.
getRes
(
"recordbtn_png"
));
recordBtn
.
y
=
304.4
-
154
;
gg
.
addChild
(
recordBtn
);
this
.
addChild
(
gg
);
this
.
groups
.
push
(
gg
);
gg
.
x
=
615
;
gg
.
y
=
154
;
//跳过提示
var
guideOver
=
new
egret
.
Bitmap
(
RES
.
getRes
(
"guideOver_png"
));
...
...
@@ -125,7 +122,7 @@ export class GuideCon extends egret.DisplayObjectContainer {
clearTimeout
(
this
.
timeoutId
);
writeCache
();
},
this
)
this
.
addChild
(
guide
Love
);
this
.
addChild
(
guide
Over
);
//箭头
if
(
!
arrow
)
{
...
...
@@ -148,11 +145,11 @@ export class GuideCon extends egret.DisplayObjectContainer {
}
positions
:
number
[][]
=
[
[
1
,
1
,
180
],
[
1
,
1
,
180
],
[
1
,
1
,
0
],
[
1
,
1
,
180
],
[
1
,
1
,
-
90
],
[
245
,
290
,
180
],
[
570
,
290
,
180
],
[
260
,
280
,
0
],
[
255
,
430
,
180
],
[
440
,
390
,
-
90
],
]
words
:
string
[]
=
[
"这里是生命值,闯关失败后
\n
都会扣除一点生命值"
,
...
...
@@ -170,15 +167,23 @@ export class GuideCon extends egret.DisplayObjectContainer {
this
.
toggleVisible
(
step
);
//箭头位置
arrow
.
x
=
this
.
positions
[
step
-
1
][
0
];
arrow
.
x
=
this
.
positions
[
step
-
1
][
1
];
arrow
.
y
=
this
.
positions
[
step
-
1
][
1
];
arrow
.
rotation
=
this
.
positions
[
step
-
1
][
2
];
//文案播放,播放完后this.couldOver=true,计时
this
.
showWord
.
play
(
this
.
words
[
step
-
1
],
()
=>
{
this
.
couldOver
=
true
;
this
.
tri
.
visible
=
true
;
egret
.
Tween
.
get
(
this
.
tri
,
{
loop
:
true
})
.
to
({
y
:
814
},
100
)
.
to
({
y
:
804
},
100
)
egret
.
Tween
.
get
(
this
.
tri
,
{
loop
:
true
},
null
,
true
)
.
set
({
y
:
804
})
.
to
({
y
:
814
},
300
)
.
to
({
y
:
804
},
300
)
this
.
timeoutId
=
setTimeout
(()
=>
{
clearTimeout
(
this
.
timeoutId
);
this
.
couldOver
=
false
;
this
.
goNext
();
},
3000
)
})
}
...
...
egret/src/mapScene/MapScene.ts
View file @
cede12d6
...
...
@@ -26,12 +26,12 @@ export default class MapScene extends Scene {
async
start
(
data
?)
{
super
.
start
();
//
if (!readCache()) {
//
var guide = new GuideCon();
//
this.addChild(guide);
// //
guide.play(1)
//
console.log(guide)
//
}
if
(
!
readCache
())
{
var
guide
=
new
GuideCon
();
this
.
addChild
(
guide
);
guide
.
play
(
1
)
console
.
log
(
guide
)
}
// window['gameover'] = ()=>{
// NetManager.ins.hc_submit(() => { }, 1, 1, null, '');
...
...
egret/src/something/uis/ShowWord.ts
View file @
cede12d6
...
...
@@ -10,6 +10,7 @@ export class ShowWord extends egret.DisplayObjectContainer {
this
.
showText
.
textColor
=
0x000000
;
this
.
showText
.
width
=
410
;
this
.
showText
.
textAlign
=
egret
.
HorizontalAlign
.
LEFT
;
this
.
showText
.
lineSpacing
=
10
;
this
.
addChild
(
this
.
showText
);
}
/**
...
...
@@ -17,27 +18,25 @@ export class ShowWord extends egret.DisplayObjectContainer {
* @param text
*/
play
(
text
:
string
,
callback
:
Function
)
{
var
a
=
{
x
:
0
}
egret
.
Tween
.
get
(
a
)
.
wait
(
200
)
.
call
(()
=>
{
})
var
spiltStrs
=
text
.
split
(
"
\n
"
);
//拆分文本
let
strs
:
string
[]
=
[]
for
(
var
i
=
0
;
i
<
spiltStrs
.
length
;
i
++
)
{
var
spiltStr
:
string
=
spiltStrs
[
i
];
var
str
:
string
=
""
;
while
(
i
>
0
)
{
str
+=
spiltStrs
[
--
i
];
str
+=
"
\n
"
;
var
ori
:
string
=
""
;
var
index
=
0
;
while
(
index
<
i
)
{
ori
+=
spiltStrs
[
index
];
ori
+=
"
\n
"
;
index
++
;
}
for
(
var
j
=
0
;
j
<
spiltStr
.
length
;
j
++
)
{
var
str
=
""
+
ori
;
str
+=
spiltStr
.
substring
(
0
,
j
+
1
)
strs
.
push
(
str
)
}
}
// console.log(strs)
//轮流替换文本
for
(
let
m
=
0
;
m
<
strs
.
length
;
m
++
)
{
let
str
=
strs
[
m
];
...
...
@@ -46,7 +45,7 @@ export class ShowWord extends egret.DisplayObjectContainer {
if
(
m
==
strs
.
length
-
1
)
{
callback
();
}
},
2
00
*
m
)
},
1
00
*
m
)
}
}
}
\ No newline at end of file
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