Commit 5557a5b8 authored by 李维's avatar 李维

dev commit

parent 40281eec
......@@ -200,8 +200,9 @@ export class PlayComponent implements OnInit, OnDestroy {
console.log(this.g_formData);
this.initBackground();
this.initCardsAll();
this.initQuestionBackground()
this.initQuestionBackground();
this.initQuestion();
this.initHand();
}
cleanGameVar(){
......@@ -232,8 +233,12 @@ export class PlayComponent implements OnInit, OnDestroy {
}
endGame(){
alert("End")
this.showEndPatal()
this.showEndPatal();
this.clapHand();
this.g_cartoon.playAudio("sm-choice-complete", false, ()=>{
this.stopClapHand();
this.stopEndPatal();
})
this.m_startGame = false;
}
......@@ -415,6 +420,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this.g_enableMapDown = true;
return
}
this.g_cartoon.playAudio("tuozhuai")
this.m_enableCardMove = true;
this.m_currentSelectedCardID = element.id
border_H.ref.visible = true;
......@@ -585,6 +591,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this.g_enableMapDown = true;
return
}
this.g_cartoon.playAudio("tuozhuai")
this.m_enableCardMove = true;
this.m_currentSelectedCardID = element.id
border_H.ref.visible = true;
......@@ -696,10 +703,14 @@ export class PlayComponent implements OnInit, OnDestroy {
this.m_answerCard_All.splice(index, 1, selectedCard)
this.deleteElementInRender(element.id)
this.topOfRenderArray(this.g_cartoon.getCartoonElement("background-main-xia").ref)
this.g_cartoon.stopAudio("excellent")
this.g_cartoon.playAudio("excellent")
}else{
selectedCard.release()
this.disableMoveAsstant();
element.shake()
element.shake();
this.g_cartoon.stopAudio("cuowu")
this.g_cartoon.playAudio("cuowu")
}
}
this.g_enableMapUp = true;
......@@ -789,10 +800,14 @@ export class PlayComponent implements OnInit, OnDestroy {
this.m_answerCard_All.splice(index, 1, selectedCard)
this.deleteElementInRender(element.id)
this.topOfRenderArray(this.g_cartoon.getCartoonElement("background-main-xia").ref)
this.g_cartoon.stopAudio("excellent")
this.g_cartoon.playAudio("excellent")
}else{
selectedCard.release()
this.disableMoveAsstant();
element.shake()
this.g_cartoon.stopAudio("cuowu")
this.g_cartoon.playAudio("cuowu")
}
}
this.g_enableMapUp = true;
......@@ -1112,10 +1127,86 @@ export class PlayComponent implements OnInit, OnDestroy {
}else{
return null
}
}
initHand(){
let basePos = {
x: this.g_canvasWidth / 2,
y: this.g_canvasHeight - 100 * this.g_mapScale
}
let elementLeft = this.g_cartoon.createCartoonElementImage("hand-left", "bg_left", 468, 398, basePos.x - 120*this.g_mapScale, basePos.y, true)
elementLeft.pos_1 = {
x: basePos.x - 120*this.g_mapScale,
y: basePos.y
}
elementLeft.pos_2 = {
x: basePos.x - 200*this.g_mapScale,
y: basePos.y
}
elementLeft.ref.y += 1000 * this.g_mapScale
let elementRight = this.g_cartoon.createCartoonElementImage("hand-right", "bg_right", 227, 315, basePos.x + 120*this.g_mapScale, basePos.y, true)
elementRight.pos_1 = {
x: basePos.x + 120*this.g_mapScale,
y: basePos.y
}
elementRight.pos_2 = {
x: basePos.x + 200*this.g_mapScale,
y: basePos.y
}
elementRight.ref.y += 1000 * this.g_mapScale
let item = this.g_cartoon.createCartoonElementImage("hand-star", "icon_finishstar", 114, 116, this.g_canvasWidth / 2 + 150 * this.g_mapScale, this.g_canvasHeight - 350 * this.g_mapScale, true)
item.ref.setScaleXY(0)
item.show = ()=>{
tweenChange(item.ref, {scaleX:item.initScaleX, scaleY:item.initScaleY}, 1, ()=>{
this.m_setIntervalIDs.push(setInterval(()=>{
tweenChange(item.ref, {alpha:0}, 0.2, ()=>{
tweenChange(item.ref, {alpha:1}, 0.2)
})
}, 410))
})
}
elementLeft.clap = (callback?)=>{
tweenChange(elementLeft.ref, {y:elementLeft.initY}, 1, ()=>{
this.m_setIntervalIDs.push(setInterval(()=>{
tweenChange(elementLeft.ref, elementLeft.pos_2, 0.2, ()=>{
tweenChange(elementLeft.ref, elementLeft.pos_1, 0.2)
})
}, 410))
})
}
elementRight.clap = (callback?)=>{
tweenChange(elementRight.ref, {y:elementRight.initY}, 1, ()=>{
this.m_setIntervalIDs.push(setInterval(()=>{
tweenChange(elementRight.ref, elementRight.pos_2, 0.2, ()=>{
tweenChange(elementRight.ref, elementRight.pos_1, 0.2)
})
}, 410))
})
}
this.render(item.ref, 9995)
this.render(elementLeft.ref, 9999)
this.render(elementRight.ref, 9990)
}
clapHand(callback?){
this.g_cartoon.getCartoonElement("hand-star").show()
this.g_cartoon.getCartoonElement("hand-left").clap()
this.g_cartoon.getCartoonElement("hand-right").clap()
}
stopClapHand(callback?){
this.stopAllInterval()
let star = this.g_cartoon.getCartoonElement("hand-star")
let handLeft = this.g_cartoon.getCartoonElement("hand-left")
let handRight = this.g_cartoon.getCartoonElement("hand-right")
tweenChange(star.ref, {alpha:0}, 0.5)
tweenChange(handLeft.ref, {y: handLeft.ref.y + 1000 * this.g_mapScale}, 1)
tweenChange(handRight.ref, {y: handRight.ref.y + 1000 * this.g_mapScale}, 1)
}
......
......@@ -97,19 +97,10 @@ const localAudios = {
'sm-go': 'assets/play/default/audio/sm-go.mp3',
'sm-ready': 'assets/play/default/audio/sm-ready.mp3',
'1': 'assets/play/sound/1.mp3',
'2': 'assets/play/sound/2.mp3',
'3': 'assets/play/sound/3.mp3',
'check': 'assets/play/sound/check.mp3',
'fanye': 'assets/play/sound/fanye.mp3',
'jifen': 'assets/play/sound/jifen.mp3',
'kulian': 'assets/play/sound/kulian.mp3',
'putong': 'assets/play/sound/putong.mp3',
'start': 'assets/play/sound/start.mp3',
'xianshi': 'assets/play/sound/xianshi.mp3',
'xiaolian': 'assets/play/sound/xiaolian.mp3',
'xingxing': 'assets/play/sound/xingxing.mp3',
'default_audio': 'assets/play/sound/Rolling in the deep.mp3'
'cuowu': 'assets/play/sound/cuowu.mp3',
'excellent': 'assets/play/sound/excellent.mp3',
'tuozhuai': 'assets/play/sound/tuozhuai.mp3',
'wancheng': 'assets/play/sound/wancheng.mp3',
};
......
'bg_bg': 'assets/play/bg_bg.png',
'bg_bottom': 'assets/play/bg_bottom.png',
'bg_change': 'assets/play/bg_change.png',
'bg_change2-1': 'assets/play/bg_change2-1.png',
'bg_change2': 'assets/play/bg_change2.png',
'bg_change_1': 'assets/play/bg_change_1.png',
'bg_kuang1': 'assets/play/bg_kuang1.png',
'bg_kuang2': 'assets/play/bg_kuang2.png',
'bg_laba': 'assets/play/bg_laba.png',
......@@ -13,6 +15,9 @@
'bg_tiao': 'assets/play/bg_tiao.png',
'bg_tiaodi': 'assets/play/bg_tiaodi.png',
'bg_word': 'assets/play/bg_word.png',
'border_center': 'assets/play/border_center.png',
'border_left': 'assets/play/border_left.png',
'border_right': 'assets/play/border_right.png',
'btn_tiaodian': 'assets/play/btn_tiaodian.png',
'btn_videooff': 'assets/play/btn_videooff.png',
'btn_videoon': 'assets/play/btn_videoon.png',
......@@ -20,6 +25,14 @@
'filename': 'assets/play/filename.txt',
'icon_finishstar': 'assets/play/icon_finishstar.png',
'icon_star': 'assets/play/icon_star.png',
'image_border_left': 'assets/play/image_border_left.png',
'image_border_right': 'assets/play/image_border_right.png',
'image_center': 'assets/play/image_center.png',
'image_container': 'assets/play/image_container.png',
'lego-building': 'assets/play/lego-building.jpg',
'text_border_left': 'assets/play/text_border_left.png',
'text_border_right': 'assets/play/text_border_right.png',
'text_center': 'assets/play/text_center.png',
......@@ -48,16 +61,9 @@
'1': 'assets/sound/1.mp3',
'2': 'assets/sound/2.mp3',
'3': 'assets/sound/3.mp3',
'check': 'assets/sound/check.mp3',
'fanye': 'assets/sound/fanye.mp3',
'jifen': 'assets/sound/jifen.mp3',
'kulian': 'assets/sound/kulian.mp3',
'putong': 'assets/sound/putong.mp3',
'start': 'assets/sound/start.mp3',
'xianshi': 'assets/sound/xianshi.mp3',
'xiaolian': 'assets/sound/xiaolian.mp3',
'xingxing': 'assets/sound/xingxing.mp3',
'cuowu': 'assets/sound/cuowu.mp3',
'excellent': 'assets/sound/excellent.mp3',
'guzhang': 'assets/sound/guzhang.mp3',
'tuozhuai': 'assets/sound/tuozhuai.mp3',
'wancheng': 'assets/sound/wancheng.mp3',
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