Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
YM_L5_27
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
template admin
YM_L5_27
Commits
10f7be4b
Commit
10f7be4b
authored
Jul 08, 2021
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: bugs
parent
d267b5f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
11 deletions
+41
-11
MyGame.ts
src/app/play/game/MyGame.ts
+41
-11
No files found.
src/app/play/game/MyGame.ts
View file @
10f7be4b
...
...
@@ -34,7 +34,9 @@ export class MyGame extends Game {
imgUrlList
.
push
(
this
.
data
.
popUpPosition
.
bgItem
.
url
);
imgUrlList
.
push
(
this
.
data
.
popUpPosition
.
bgItem2
.
url
);
// audioUrlList.push(this.data.titleLetterAudio);
audioUrlList
.
push
(
this
.
data
.
titleAudio
);
audioUrlList
.
push
(
this
.
data
.
titleLetterAudio
);
audioUrlList
.
push
(
this
.
data
.
totalAudio
);
this
.
data
.
popUpPosition
.
hotZoneItemArr
.
forEach
(
data
=>
{
audioUrlList
.
push
(
data
.
audio_url
);
...
...
@@ -179,25 +181,53 @@ export class MyGame extends Game {
}
eyeOpen
=
true
;
playingTotalAuido
=
false
;
initButton
()
{
const
b
tn
=
new
TouchSprite
();
b
tn
.
init
(
this
.
images
.
get
(
'
btn_eye_open
'
));
b
tn
.
x
=
this
.
_parent
.
canvasWidth
-
60
*
this
.
mapScale
;
btn
.
y
=
this
.
_parent
.
canvasHeight
-
6
0
*
this
.
mapScale
;
b
tn
.
setScaleXY
(
this
.
mapScale
);
b
tn
.
addTouchBeganListener
(()
=>
{
jelly
(
b
tn
);
const
eyeB
tn
=
new
TouchSprite
();
eyeB
tn
.
init
(
this
.
images
.
get
(
'
btn_eye_open
'
));
eyeB
tn
.
x
=
this
.
_parent
.
canvasWidth
-
60
*
this
.
mapScale
;
eyeBtn
.
y
=
this
.
_parent
.
canvasHeight
-
15
0
*
this
.
mapScale
;
eyeB
tn
.
setScaleXY
(
this
.
mapScale
);
eyeB
tn
.
addTouchBeganListener
(()
=>
{
jelly
(
eyeB
tn
);
if
(
this
.
eyeOpen
)
{
b
tn
.
init
(
this
.
images
.
get
(
'
btn_eye_close
'
));
eyeB
tn
.
init
(
this
.
images
.
get
(
'
btn_eye_close
'
));
tweenChange
(
this
.
middleBg1
,
{
alpha
:
0
},
0.2
);
tweenChange
(
this
.
middleBg2
,
{
alpha
:
1
},
0.2
);
}
else
{
b
tn
.
init
(
this
.
images
.
get
(
'
btn_eye_open
'
));
eyeB
tn
.
init
(
this
.
images
.
get
(
'
btn_eye_open
'
));
tweenChange
(
this
.
middleBg1
,
{
alpha
:
1
},
0.2
);
tweenChange
(
this
.
middleBg2
,
{
alpha
:
0
},
0.2
);
}
this
.
eyeOpen
=
!
this
.
eyeOpen
;
});
this
.
addChild
(
btn
);
this
.
addChild
(
eyeBtn
);
const
btnPlay
=
new
TouchSprite
();
btnPlay
.
init
(
this
.
images
.
get
(
'
btn_play
'
));
btnPlay
.
x
=
this
.
_parent
.
canvasWidth
-
60
*
this
.
mapScale
;
btnPlay
.
y
=
this
.
_parent
.
canvasHeight
-
60
*
this
.
mapScale
;
btnPlay
.
setScaleXY
(
this
.
mapScale
);
btnPlay
.
addTouchBeganListener
(()
=>
{
jelly
(
btnPlay
);
if
(
this
.
data
.
totalAudio
!=
''
)
{
if
(
!
this
.
playingTotalAuido
)
{
this
.
playingTotalAuido
=
true
;
this
.
playAudio
(
this
.
data
.
totalAudio
,
true
,
()
=>
{
this
.
playingTotalAuido
=
false
;
btnPlay
.
init
(
this
.
images
.
get
(
'
btn_play
'
));
});
btnPlay
.
init
(
this
.
images
.
get
(
'
btn_pause
'
));
}
else
{
this
.
playingTotalAuido
=
false
;
btnPlay
.
init
(
this
.
images
.
get
(
'
btn_play
'
));
const
audio
=
this
.
_parent
.
audioObj
[
this
.
data
.
totalAudio
];
if
(
audio
&&
!
audio
.
paused
)
{
audio
.
pause
();
}
}
}
});
this
.
addChild
(
btnPlay
);
}
}
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