Commit cd7b2940 authored by 李维's avatar 李维

bug fix

parent 69d25f00
...@@ -142,6 +142,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -142,6 +142,7 @@ export class PlayComponent implements OnInit, OnDestroy {
m_totalScrollHeight = 0; m_totalScrollHeight = 0;
m_questionIndexArray = []; m_questionIndexArray = [];
m_endGame = false; m_endGame = false;
m_resultSaved = [];
// ------------------------------------ // ------------------------------------
...@@ -239,6 +240,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -239,6 +240,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this.m_totalScrollHeight = 0; this.m_totalScrollHeight = 0;
this.m_questionIndexArray = []; this.m_questionIndexArray = [];
this.m_endGame = false; this.m_endGame = false;
this.m_resultSaved = [];
} }
startGame(){ startGame(){
...@@ -480,7 +482,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -480,7 +482,7 @@ export class PlayComponent implements OnInit, OnDestroy {
} else { } else {
target.setContentText(letttes[i-1].toLocaleLowerCase()) target.setContentText(letttes[i-1].toLocaleLowerCase())
} }
await this.buttonPressAnimation(le.id) this.buttonPressAnimation(le.id)
this.g_enableMapDown = true; this.g_enableMapDown = true;
this.jumpToNextActive(this.m_currentQuestionIndex); this.jumpToNextActive(this.m_currentQuestionIndex);
}) })
...@@ -825,6 +827,16 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -825,6 +827,16 @@ export class PlayComponent implements OnInit, OnDestroy {
let rolNum = this.g_formData.grid.length; let rolNum = this.g_formData.grid.length;
let colNum = this.g_formData.grid[0].length; let colNum = this.g_formData.grid[0].length;
if(rolNum==17) {
element.ref.x -= 150 * this.g_mapScale
} else if(rolNum==15) {
element.ref.x -= 120 * this.g_mapScale
} else if(rolNum==12) {
element.ref.x -= 80 * this.g_mapScale
} else if(rolNum==9) {
element.ref.x -= 60 * this.g_mapScale
}
let width = 900; let width = 900;
let height = 900; let height = 900;
...@@ -961,8 +973,8 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -961,8 +973,8 @@ export class PlayComponent implements OnInit, OnDestroy {
}) })
bgMiddleMask.ref.addChild(checkTop.ref) bgMiddleMask.ref.addChild(checkTop.ref)
let labelText = this.g_cartoon.createCartoonElementLabel("Chenck_label_title", "Check", "Aileron-Black", "#FFFFFF", 60) // let labelText = this.g_cartoon.createCartoonElementLabel("Chenck_label_title", "Check", "Aileron-Black", "#FFFFFF", 60)
checkTop.ref.addChild(labelText.ref); // checkTop.ref.addChild(labelText.ref);
let checkBottom = this.g_cartoon.createCartoonElementImageFunc(`checkpannel_checnk_bottom`, "check_bottom", (w, h)=>{ let checkBottom = this.g_cartoon.createCartoonElementImageFunc(`checkpannel_checnk_bottom`, "check_bottom", (w, h)=>{
return { return {
...@@ -1089,6 +1101,11 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1089,6 +1101,11 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
sendResult() { sendResult() {
// console.log(JSON.stringify(this.m_resultSaved))
window.parent.postMessage( {action: 'temp_send_result', data: JSON.stringify(this.m_resultSaved)}, "*")
}
getResult() {
let resultDataStr = [] let resultDataStr = []
this.m_blockGroup.forEach(group => { this.m_blockGroup.forEach(group => {
let rightLetters = ""; let rightLetters = "";
...@@ -1102,7 +1119,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1102,7 +1119,7 @@ export class PlayComponent implements OnInit, OnDestroy {
}) })
}); });
// console.log(JSON.stringify(resultDataStr)) // console.log(JSON.stringify(resultDataStr))
window.parent.postMessage( {action: 'temp_send_result', data: JSON.stringify(resultDataStr)}, "*") return resultDataStr
} }
initSlider() { initSlider() {
...@@ -1546,10 +1563,10 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1546,10 +1563,10 @@ export class PlayComponent implements OnInit, OnDestroy {
}); });
}); });
this.m_resultSaved.push(this.getResult());
if(errorIndex>=0) { if(errorIndex>=0) {
this.switchQuestion(this.m_currentQuestionIndex, errorIndex) this.switchQuestion(this.m_currentQuestionIndex, errorIndex)
} }
if(this.m_submitedTimes>=2 || (this.m_submitedTimes<2 && !hasIncorrect)) { if(this.m_submitedTimes>=2 || (this.m_submitedTimes<2 && !hasIncorrect)) {
let qp = this.g_cartoon.getCartoonElement("question_container") let qp = this.g_cartoon.getCartoonElement("question_container")
let keyboard = this.g_cartoon.getCartoonElement("keyboard_container") let keyboard = this.g_cartoon.getCartoonElement("keyboard_container")
...@@ -1907,6 +1924,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1907,6 +1924,7 @@ export class PlayComponent implements OnInit, OnDestroy {
mapDown(event) { mapDown(event) {
event.preventDefault();
let myStopPropagation = false; let myStopPropagation = false;
if (!this.g_enableMapDown) { if (!this.g_enableMapDown) {
return; return;
...@@ -1939,6 +1957,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1939,6 +1957,7 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
mapMove(event) { mapMove(event) {
// event.preventDefault();
let myStopPropagation = false; let myStopPropagation = false;
if (!this.g_enableMapMove) { if (!this.g_enableMapMove) {
return; return;
...@@ -1957,6 +1976,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1957,6 +1976,7 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
mapUp(event) { mapUp(event) {
// event.preventDefault();
let myStopPropagation = false; let myStopPropagation = false;
if (!this.g_enableMapUp) { if (!this.g_enableMapUp) {
return; return;
......
src/assets/play/check_top.png

13.8 KB | W: | H:

src/assets/play/check_top.png

33.3 KB | W: | H:

src/assets/play/check_top.png
src/assets/play/check_top.png
src/assets/play/check_top.png
src/assets/play/check_top.png
  • 2-up
  • Swipe
  • Onion skin
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