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

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

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