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