Commit 3d988248 authored by Chen Jiping's avatar Chen Jiping

fix:调整音频播放问题,及增加拖拽正确范围

parent cdeb96a4
......@@ -1005,7 +1005,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this.canTouch = false;
let toX = (this.canvasWidth - this.bigCard.bg.width) / 2;
let toY = (this.canvasHeight - this.bigCard.bg.height) / 2;
let toY = (this.canvasHeight - this.bigCard.bg.height) / 2 + 28 * this.mapScale;
this.playAudio('open');
this.bigCard.showCard(toX, toY, () => {
......@@ -1030,6 +1030,15 @@ export class PlayComponent implements OnInit, OnDestroy {
return;
}
if(this.checkClickTarget(this.bigCard.contentSpr)){
if(this.curExercises){
this.playAudio(this.curExercises.audioUrl);
}
return;
}
}
isMove(item) {
......@@ -1108,8 +1117,9 @@ export class PlayComponent implements OnInit, OnDestroy {
for (let i = 0; i < this.lineSprArr.length; ++i) {
let tLineSpr = this.lineSprArr[i];
if (this.checkPointInRect(this.mx, this.my, tLineSpr.bg.getBoundingBox())) {
let rect = tLineSpr.bg.getBoundingBox();
rect.height += 30 * this.mapScale;
if (this.checkPointInRect(this.mx, this.my, rect)) {
lineIndex = i;
lineSpr = tLineSpr;
break;
......@@ -1122,6 +1132,13 @@ export class PlayComponent implements OnInit, OnDestroy {
return;
}
let answerSpr = this.answerSprArr[lineIndex];
if(answerSpr != letterItem){
back();
return;
}
letterItem.lineIndex = lineIndex;
this.playAudio('right', true);
......
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