Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
DF-L211
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
DF-L211
Commits
f9f78e27
Commit
f9f78e27
authored
Jul 06, 2021
by
LMZ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 重新开始按钮 点不动
parent
ded3a0a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
16 deletions
+33
-16
play.component.ts
src/app/play/play.component.ts
+33
-16
No files found.
src/app/play/play.component.ts
View file @
f9f78e27
...
...
@@ -912,23 +912,10 @@ export class PlayComponent implements OnInit, OnDestroy {
return
;
}
if
(
this
.
checkClickTarget
(
this
.
leftBox
.
boxBg
))
{
this
.
clickBox
(
this
.
leftBox
);
return
;
}
if
(
this
.
checkClickTarget
(
this
.
midBox
.
boxBg
))
{
this
.
clickBox
(
this
.
midBox
);
return
;
}
if
(
this
.
checkClickTarget
(
this
.
rightBox
.
boxBg
))
{
this
.
clickBox
(
this
.
rightBox
);
return
;
}
if
(
this
.
checkClickTarget
(
this
.
restartBtn
.
bg
))
{
console
.
log
(
"
this.restartBtn.isHide:
"
,
this
.
restartBtn
.
isHide
);
if
(
this
.
restartBtn
.
isHide
)
{
return
;
}
...
...
@@ -936,6 +923,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
restartBtn
.
isHide
=
true
;
this
.
canTouch
=
false
;
console
.
log
(
'
this.canTouch = false; 3
'
)
this
.
restartBtn
.
click
(()
=>
{
...
...
@@ -957,9 +945,28 @@ export class PlayComponent implements OnInit, OnDestroy {
});
});
});
return
;
}
if
(
this
.
checkClickTarget
(
this
.
leftBox
.
boxBg
))
{
this
.
clickBox
(
this
.
leftBox
);
return
;
}
if
(
this
.
checkClickTarget
(
this
.
midBox
.
boxBg
))
{
this
.
clickBox
(
this
.
midBox
);
return
;
}
if
(
this
.
checkClickTarget
(
this
.
rightBox
.
boxBg
))
{
this
.
clickBox
(
this
.
rightBox
);
return
;
}
}
mapMove
(
event
)
{
...
...
@@ -998,7 +1005,12 @@ export class PlayComponent implements OnInit, OnDestroy {
return
;
}
if
(
this
.
gameover
)
{
return
;
}
this
.
canTouch
=
false
;
console
.
log
(
'
this.canTouch = false; 1
'
)
box
.
click
(()
=>
{
...
...
@@ -1074,11 +1086,14 @@ export class PlayComponent implements OnInit, OnDestroy {
});
}
showGameOver
()
{
console
.
log
(
"
in showGameOver
"
);
this
.
canTouch
=
false
;
console
.
log
(
'
this.canTouch = false; 2
'
)
this
.
playAudio
(
'
win
'
);
...
...
@@ -1087,7 +1102,6 @@ export class PlayComponent implements OnInit, OnDestroy {
const
showCelebrate
=
()
=>
{
const
showPetal
=
()
=>
{
let
petal
=
new
Petal
(
this
.
endRenderArr
,
this
.
images
,
this
.
ctx
);
...
...
@@ -1106,6 +1120,8 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
endRenderArr
.
push
(
handClap
.
bg
);
handClap
.
play
(()
=>
{
removeItemFromArr
(
this
.
endRenderArr
,
handClap
.
bg
);
...
...
@@ -1115,13 +1131,14 @@ export class PlayComponent implements OnInit, OnDestroy {
removeItemFromArr
(
this
.
endRenderArr
,
cover
);
this
.
restartBtn
.
resetStatus
();
this
.
restartBtn
.
isHide
=
false
;
this
.
endRenderArr
.
push
(
this
.
restartBtn
.
bg
);
this
.
restartBtn
.
bg
.
x
=
(
this
.
canvasWidth
-
this
.
restartBtn
.
bg
.
width
)
/
2
;
this
.
restartBtn
.
bg
.
y
=
this
.
canvasHeight
-
185
*
this
.
mapScale
-
this
.
restartBtn
.
bg
.
height
;
this
.
canTouch
=
true
;
this
.
restartBtn
.
isHide
=
false
;
})
});
...
...
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