Commit 8c12485f authored by Chen Jiping's avatar Chen Jiping

模板完善

parent 018ffe28
......@@ -16,6 +16,7 @@ import { Palette } from './Palette2';
import { Stage } from './Stage';
import { Star } from './StarUtil'
import { Petal } from './PetalUtil';
import { Course } from '../form/Course';
......@@ -443,7 +444,25 @@ export class PlayComponent implements OnInit, OnDestroy {
*/
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 {
this.canTouch = true;
if (this.stage.isEnd()) {
this.canTouch = false;
this.showEnd();
}
if (this.stage.isEnd()) {
this.canTouch = false;
this.showEnd();
}
}, 4000);
}, () => {
......@@ -774,7 +793,7 @@ export class PlayComponent implements OnInit, OnDestroy {
}
else {
colorCard.moveout(() => {
});
}
}
......@@ -782,7 +801,7 @@ export class PlayComponent implements OnInit, OnDestroy {
if (touchedColorCard) {
return;
}
else{
else {
if (this.curCard) {
this.curCard.clearColor();
}
......@@ -833,7 +852,7 @@ export class PlayComponent implements OnInit, OnDestroy {
showEnd() {
this.playAudio('win');
let petal = new Petal(this.endRenderArr, this.images, this.ctx);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment