Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
PU-17
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
PU-17
Commits
8c12485f
Commit
8c12485f
authored
Jun 28, 2020
by
Chen Jiping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模板完善
parent
018ffe28
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
7 deletions
+26
-7
play.component.ts
src/app/play/play.component.ts
+26
-7
No files found.
src/app/play/play.component.ts
View file @
8c12485f
...
@@ -16,6 +16,7 @@ import { Palette } from './Palette2';
...
@@ -16,6 +16,7 @@ import { Palette } from './Palette2';
import
{
Stage
}
from
'
./Stage
'
;
import
{
Stage
}
from
'
./Stage
'
;
import
{
Star
}
from
'
./StarUtil
'
import
{
Star
}
from
'
./StarUtil
'
import
{
Petal
}
from
'
./PetalUtil
'
;
import
{
Petal
}
from
'
./PetalUtil
'
;
import
{
Course
}
from
'
../form/Course
'
;
...
@@ -443,7 +444,25 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -443,7 +444,25 @@ export class PlayComponent implements OnInit, OnDestroy {
*/
*/
initDefaultData
()
{
initDefaultData
()
{
if
(
!
this
.
data
.
type
)
{
this
.
data
.
type
=
'
01
'
;
}
if
(
!
this
.
data
.
text
)
{
this
.
data
.
text
=
'
colour the food from plants in green and the food from animals in red
'
;
}
if
(
!
this
.
data
.
picArr
)
{
this
.
data
.
picArr
=
[];
}
if
(
!
this
.
data
.
colorArr
)
{
this
.
data
.
colorArr
=
[];
}
console
.
log
(
this
.
data
);
}
}
...
@@ -729,10 +748,10 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -729,10 +748,10 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
canTouch
=
true
;
this
.
canTouch
=
true
;
if
(
this
.
stage
.
isEnd
())
{
if
(
this
.
stage
.
isEnd
())
{
this
.
canTouch
=
false
;
this
.
canTouch
=
false
;
this
.
showEnd
();
this
.
showEnd
();
}
}
},
4000
);
},
4000
);
},
()
=>
{
},
()
=>
{
...
@@ -774,7 +793,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -774,7 +793,7 @@ export class PlayComponent implements OnInit, OnDestroy {
}
}
else
{
else
{
colorCard
.
moveout
(()
=>
{
colorCard
.
moveout
(()
=>
{
});
});
}
}
}
}
...
@@ -782,7 +801,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -782,7 +801,7 @@ export class PlayComponent implements OnInit, OnDestroy {
if
(
touchedColorCard
)
{
if
(
touchedColorCard
)
{
return
;
return
;
}
}
else
{
else
{
if
(
this
.
curCard
)
{
if
(
this
.
curCard
)
{
this
.
curCard
.
clearColor
();
this
.
curCard
.
clearColor
();
}
}
...
@@ -833,7 +852,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -833,7 +852,7 @@ export class PlayComponent implements OnInit, OnDestroy {
showEnd
()
{
showEnd
()
{
this
.
playAudio
(
'
win
'
);
this
.
playAudio
(
'
win
'
);
let
petal
=
new
Petal
(
this
.
endRenderArr
,
this
.
images
,
this
.
ctx
);
let
petal
=
new
Petal
(
this
.
endRenderArr
,
this
.
images
,
this
.
ctx
);
...
...
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