Commit db5b9dd7 authored by 李维's avatar 李维

Bug fix

parent 1d40b197
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
<div class="section-title" > <div class="section-title" >
错误选项 错误选项
<div style="text-align: center; float: right;"> <div style="text-align: center; float: right;">
<button nz-button nzType="primary" (click)="addChoice(item.incorrect)" > <button nz-button nzType="primary" (click)="addChoice(item.incorrect)" [disabled]="item.correct.length>=4" >
<i nz-icon nzType="plus-circle" nzTheme="outline"></i> <i nz-icon nzType="plus-circle" nzTheme="outline"></i>
添加 添加
</button> </button>
......
...@@ -526,7 +526,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -526,7 +526,7 @@ export class PlayComponent implements OnInit, OnDestroy {
if(index==1){ if(index==1){
newId = "score-ball-right-" newId = "score-ball-right-"
} }
for(let i=0; i<6; i++){ for(let i=0; i<this.g_formData.dataArray.length; i++){
let scoreBall = this.g_cartoon.createCartoonElementImageFunc(newId + i, "bg_star", (w ,h)=>{ let scoreBall = this.g_cartoon.createCartoonElementImageFunc(newId + i, "bg_star", (w ,h)=>{
return { return {
sx: 68 / w, sx: 68 / w,
...@@ -649,11 +649,11 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -649,11 +649,11 @@ export class PlayComponent implements OnInit, OnDestroy {
let x = 0 let x = 0
if( side=="right" ){ if( side=="right" ){
do{ do{
x = this.g_canvasWidth / 2 + ( Math.ceil(Math.random()*400) + 80 ) * this.g_mapScale x = this.g_canvasWidth / 2 + ( Math.ceil(Math.random()*400) + 150 ) * this.g_mapScale
}while(this.m_lastBubbleX[side] != -1 && x <= (this.m_lastBubbleX[side] + width) && x >= (this.m_lastBubbleX[side] - width)) }while(this.m_lastBubbleX[side] != -1 && x <= (this.m_lastBubbleX[side] + width) && x >= (this.m_lastBubbleX[side] - width))
}else{ }else{
do{ do{
x = 150 * this.g_mapScale + Math.ceil(Math.random()*400) * this.g_mapScale x = 150 * this.g_mapScale + Math.ceil(Math.random()*350) * this.g_mapScale
}while(this.m_lastBubbleX[side] != -1 && x <= (this.m_lastBubbleX[side] + width) && x >= (this.m_lastBubbleX[side] - width)) }while(this.m_lastBubbleX[side] != -1 && x <= (this.m_lastBubbleX[side] + width) && x >= (this.m_lastBubbleX[side] - width))
} }
this.m_lastBubbleX[side] = x this.m_lastBubbleX[side] = x
...@@ -679,9 +679,10 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -679,9 +679,10 @@ export class PlayComponent implements OnInit, OnDestroy {
this.m_allAnswerBubble[side].push(container.id) this.m_allAnswerBubble[side].push(container.id)
if(data.type == "Image"){ if(data.type == "Image"){
container.isImage = true;
let image = this.g_cartoon.createImage(data.image_url, (w, h)=>{ let image = this.g_cartoon.createImage(data.image_url, (w, h)=>{
let sx = 138 * 0.7 / w let sx = 120 / w
let sy = 138 * 0.7 / h let sy = 120 / h
let s = Math.min(sx, sy) let s = Math.min(sx, sy)
return { return {
sx: s, sx: s,
...@@ -694,23 +695,40 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -694,23 +695,40 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
}) })
container.ref.addChild(image) container.ref.addChild(image)
container.content = image
}else{ }else{
let text = this.g_cartoon.createLabel(data.text, "BerlinSansFBDemi-Bold", "#FFFFFF", 24); container.isImage = false;
let text = this.g_cartoon.createLabel(data.text, "MMTextBook-Bold", "#00528c", 40);
container.ref.addChild(text) container.ref.addChild(text)
container.content = text
} }
container.ball_highlight = this.g_cartoon.createImage("ball_highlight", (w, h)=>{ container.ball_highlight = this.g_cartoon.createImage("ball_highlight", (w, h)=>{
return { return {
sx: 164 * 1.1 / w, sx: 164 / w,
sy: 152 * 1.1 / h sy: 152 / h
} }
}, (w, h)=>{ }, (w, h)=>{
return { return {
x: -2, x: -5,
y: -5 y: -5
} }
}) })
container.ref.addChild(container.ball_highlight)
let redOutline = new ShapeRect();
redOutline.fillColor = "#ff5252"
redOutline.setSize(container.content.width * container.content.scaleX + 10, container.content.height * container.content.scaleY + 10);
redOutline.x = -container.content.width * container.content.scaleX / 2
redOutline.y = -container.content.height * container.content.scaleY / 2
if(container.isImage) {
redOutline.alpha = 1;
} else {
redOutline.alpha = 0;
}
container.ball_highlight.addChild(redOutline)
container.ball_highlight.alpha = 0
container.ref.addChild(container.ball_highlight, -1)
container.ball_highlight.visible = false; container.ball_highlight.visible = false;
container.ballYeah = this.g_cartoon.createImage("bg_graet", (w, h)=>{ container.ballYeah = this.g_cartoon.createImage("bg_graet", (w, h)=>{
...@@ -777,7 +795,10 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -777,7 +795,10 @@ export class PlayComponent implements OnInit, OnDestroy {
this.g_cartoon.playAudio("cuowu") this.g_cartoon.playAudio("cuowu")
container.ball_highlight.visible = true; container.ball_highlight.visible = true;
this.showShakeAnimation(container.id, ()=>{ this.showShakeAnimation(container.id, ()=>{
container.ball_highlight.visible = false; if(!container.isImage) {
container.content.fontColor = "#ff5252"
}
// container.ball_highlight.visible = false;
callback && callback() callback && callback()
}) })
} }
...@@ -793,12 +814,12 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -793,12 +814,12 @@ export class PlayComponent implements OnInit, OnDestroy {
if( side=="right" ){ if( side=="right" ){
let time = 0; let time = 0;
do{ do{
x = this.g_canvasWidth / 2 + ( Math.ceil(Math.random()*400) + 80 ) * this.g_mapScale x = this.g_canvasWidth / 2 + ( Math.ceil(Math.random()*400) + 150 ) * this.g_mapScale
}while(x <= (this.m_lastBubbleX[side] + width) && x >= (this.m_lastBubbleX[side] - width)) }while(x <= (this.m_lastBubbleX[side] + width) && x >= (this.m_lastBubbleX[side] - width))
}else{ }else{
let time = 0; let time = 0;
do{ do{
x = 150 * this.g_mapScale + Math.ceil(Math.random()*400) * this.g_mapScale x = 150 * this.g_mapScale + Math.ceil(Math.random()*350) * this.g_mapScale
}while( x <= (this.m_lastBubbleX[side] + width) && x >= (this.m_lastBubbleX[side] - width)) }while( x <= (this.m_lastBubbleX[side] + width) && x >= (this.m_lastBubbleX[side] - width))
} }
this.m_lastBubbleX[side] = x this.m_lastBubbleX[side] = x
...@@ -825,8 +846,9 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -825,8 +846,9 @@ export class PlayComponent implements OnInit, OnDestroy {
this.g_enableMapDown = true; this.g_enableMapDown = true;
return return
} }
container.tween.stop()
if(container.index == this.m_currentQuestionIndex){ if(container.index == this.m_currentQuestionIndex){
container.tween.stop()
this.m_scoreLine[side]-- this.m_scoreLine[side]--
if( this.m_scoreLine[side]==0 ){ if( this.m_scoreLine[side]==0 ){
this.m_score[side]++ this.m_score[side]++
...@@ -847,9 +869,10 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -847,9 +869,10 @@ export class PlayComponent implements OnInit, OnDestroy {
}) })
} }
}else{ }else{
container.tween.pause()
container.inCorrect(()=>{ container.inCorrect(()=>{
this.g_enableMapDown = true; this.g_enableMapDown = true;
container.tween.start() container.tween.resume()
}) })
} }
return true; return 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