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

模板完善

parent 018ffe28
...@@ -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);
......
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