Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
DF-L220
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-L220
Commits
dd10053f
Commit
dd10053f
authored
Mar 15, 2020
by
Chen Jiping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善
parent
8471fd16
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
32 deletions
+37
-32
play.component.ts
src/app/play/play.component.ts
+37
-32
No files found.
src/app/play/play.component.ts
View file @
dd10053f
...
@@ -992,8 +992,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -992,8 +992,7 @@ export class PlayComponent implements OnInit, OnDestroy {
//取出气球显示
//取出气球显示
for
(
let
i
=
0
;
i
<
this
.
temp_max_ballon
;
++
i
){
for
(
let
i
=
0
;
i
<
this
.
temp_max_ballon
;
++
i
){
let
answer
=
this
.
getShowAnswer
();
this
.
getShowAnswer
((
answer
)
=>
{
if
(
answer
){
if
(
answer
){
//取出坐标
//取出坐标
...
@@ -1004,11 +1003,11 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1004,11 +1003,11 @@ export class PlayComponent implements OnInit, OnDestroy {
//显示气球
//显示气球
this
.
ballonRose
(
answer
);
this
.
ballonRose
(
answer
);
}
}
});
}
}
}
}
else
{
else
{
let
answer
=
this
.
getShowAnswer
();
this
.
getShowAnswer
((
answer
)
=>
{
if
(
answer
){
if
(
answer
){
//设置坐标
//设置坐标
...
@@ -1019,6 +1018,9 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1019,6 +1018,9 @@ export class PlayComponent implements OnInit, OnDestroy {
//显示气球
//显示气球
this
.
ballonRose
(
answer
);
this
.
ballonRose
(
answer
);
}
}
});
}
}
...
@@ -1046,26 +1048,29 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1046,26 +1048,29 @@ export class PlayComponent implements OnInit, OnDestroy {
return
check
;
return
check
;
}
}
getShowAnswer
(){
getShowAnswer
(
callback
){
let
answer
;
let
answer
=
this
.
getRandomItemFromArr
(
this
.
curanswers
)
;
while
(
true
){
if
(
!
answer
){
answer
=
this
.
getRandomItemFromArr
(
this
.
curanswers
);
setTimeout
(()
=>
{
this
.
getShowAnswer
(
callback
);
},
10
);
if
(
!
answer
){
break
;
}
}
else
{
let
index
=
this
.
ballon_temp_arr
.
indexOf
(
answer
);
let
index
=
this
.
ballon_temp_arr
.
indexOf
(
answer
);
if
(
index
==
-
1
){
if
(
index
==
-
1
){
break
;
callback
(
answer
);
}
else
{
setTimeout
(()
=>
{
this
.
getShowAnswer
(
callback
);
},
10
);
}
}
}
}
return
answer
;
}
}
getRandomItemFromArr
(
arr
){
getRandomItemFromArr
(
arr
){
...
...
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