Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
East_L228
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
East_L228
Commits
81c0ad51
Commit
81c0ad51
authored
May 23, 2020
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev commit
parent
2c339eb6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
7 deletions
+31
-7
play.component.ts
src/app/play/play.component.ts
+31
-7
No files found.
src/app/play/play.component.ts
View file @
81c0ad51
...
...
@@ -150,6 +150,7 @@ export class PlayComponent implements OnInit, OnDestroy {
m_autoFocusID
=
null
;
m_enableCamera
=
false
;
m_nextCardLock
=
false
;
m_enableAutoFocus
=
false
;
// ------------------------------------
...
...
@@ -199,8 +200,8 @@ export class PlayComponent implements OnInit, OnDestroy {
}
restartGame
()
{
this
.
initSystem
();
this
.
cleanSystemVar
()
this
.
initSystem
();
this
.
cleanGameVar
()
this
.
initGame
()
}
...
...
@@ -225,6 +226,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
initCards
();
this
.
initShowCard
();
this
.
initStartButton
()
this
.
autoFocus
()
}
cleanGameVar
(){
...
...
@@ -252,11 +254,20 @@ export class PlayComponent implements OnInit, OnDestroy {
startGame
(){
this
.
m_enableCamera
=
true
;
this
.
autoRollRun
();
this
.
m_enableAutoFocus
=
true
;
this
.
g_cartoon
.
playAudio
(
"
sm-run
"
,
false
,
null
,
true
,
(
audio
)
=>
{
audio
.
volume
=
0.3
})
}
autoFocus
(){
this
.
m_setIntervalIDs
.
push
(
setInterval
(()
=>
{
if
(
this
.
m_enableAutoFocus
){
this
.
nextFocus
()
}
},
300
))
}
initBackground
(){
let
element
=
this
.
g_cartoon
.
createCartoonElementImage
(
"
background-main
"
,
"
main-bg
"
,
this
.
g_canvasWidth
,
this
.
g_canvasHeight
,
this
.
g_canvasWidth
/
2
,
this
.
g_canvasHeight
/
2
);
this
.
render
(
element
.
ref
)
...
...
@@ -357,6 +368,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
m_enableRunway
=
false
;
this
.
g_cartoon
.
stopAudio
(
"
sm-run
"
)
clearTimeout
(
this
.
m_autoFocusID
)
this
.
m_enableAutoFocus
=
false
;
this
.
g_cartoon
.
playAudio
(
"
sm-camera
"
)
this
.
g_cartoon
.
getCartoonElement
(
`card-show`
).
show
(()
=>
{
this
.
g_enableMapDown
=
true
...
...
@@ -471,11 +483,11 @@ export class PlayComponent implements OnInit, OnDestroy {
element
.
content
.
ref
.
x
-=
distance
;
}
if
(
cardContentHighlight
.
ref
.
visible
){
if
(
!
this
.
m_nextCardLock
&&
element
.
ref
.
x
<=
0
){
this
.
nextFocus
()
}
}
//
if(cardContentHighlight.ref.visible){
//
if(!this.m_nextCardLock && element.ref.x<=0){
//
this.nextFocus()
//
}
//
}
}
element
.
readyGoOut
=
(
x
)
=>
{
...
...
@@ -518,6 +530,8 @@ export class PlayComponent implements OnInit, OnDestroy {
})
this
.
m_runStatus
=
true
;
},
40
)
this
.
m_setIntervalIDs
.
push
(
this
.
m_runIntervalId
)
}
// 卡片回收与准备控制
...
...
@@ -558,6 +572,15 @@ export class PlayComponent implements OnInit, OnDestroy {
next
=
current
+
1
}
if
(
this
.
g_cartoon
.
getCartoonElement
(
this
.
m_allCardIds
[
next
]).
waiting
){
for
(
let
index
=
0
;
index
<
this
.
m_allCardIds
.
length
;
index
++
){
if
(
!
this
.
g_cartoon
.
getCartoonElement
(
this
.
m_allCardIds
[
index
]).
waiting
){
next
=
index
;
break
}
}
}
if
(
current
!=
-
1
){
this
.
g_cartoon
.
getCartoonElement
(
this
.
m_allCardIds
[
current
]).
hideHighlight
()
}
...
...
@@ -700,7 +723,8 @@ export class PlayComponent implements OnInit, OnDestroy {
element
.
hide
(()
=>
{
this
.
g_cartoon
.
getCartoonElement
(
"
Camera
"
).
hightlight
(
false
)
this
.
m_enableRunway
=
true
;
this
.
g_enableMapDown
=
true
this
.
g_enableMapDown
=
true
;
this
.
m_enableAutoFocus
=
true
;
})
})
...
...
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