Commit 1d40b197 authored by 李维's avatar 李维

Dev done

parent 6833a145
......@@ -339,10 +339,12 @@ export class PlayComponent implements OnInit, OnDestroy {
}
if(this.m_score["left"] > this.m_score["right"]){
showType = "final-win-left";
this.showEndPatal("left")
}
if(this.m_score["left"] < this.m_score["right"]){
showType = "final-win-right";
this.showEndPatal("right")
}
this.g_cartoon.getCartoonElement(showType).in()
......@@ -440,6 +442,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this.render(startButton.ref, zIndexMap.button)
this.subscribeMapDownEvent(startButton.id, ()=>{
this.g_cartoon.playAudio("click_btn")
this.showJellyAnimation(startButton.id, ()=>{
tweenChange(startButton.ref, {x: this.g_canvasWidth + 500 * this.g_mapScale}, 0.2, ()=>{
this.startGame()
......@@ -467,6 +470,7 @@ export class PlayComponent implements OnInit, OnDestroy {
}
this.subscribeMapDownEvent(replayButton.id, ()=>{
this.g_cartoon.playAudio("click_btn")
this.showJellyAnimation(replayButton.id, ()=>{
this.restartGame(()=>{
this.g_enableMapDown = true;
......@@ -558,6 +562,7 @@ export class PlayComponent implements OnInit, OnDestroy {
}
setScore(side, score, callback?){
this.g_cartoon.playAudio("start")
for(let index = 0; index<5; index++){
let ball = this.g_cartoon.getCartoonElement(`score-ball-${side}-${index}`)
let ballLight = this.g_cartoon.getCartoonElement(`score-ball-${side}-${index}-light`)
......@@ -739,6 +744,7 @@ export class PlayComponent implements OnInit, OnDestroy {
container.bubbleAni.playEndFunc = ()=>{
container.bubbleAni.visible = false;
if(score){
this.g_cartoon.playAudio("great")
this.topOfRenderArray(container.ref)
container.ballYeah.visible = true;
let x = this.g_canvasWidth / 4
......@@ -981,45 +987,164 @@ export class PlayComponent implements OnInit, OnDestroy {
}
initFinal(){
let element = this.g_cartoon.createCartoonElementImageFunc(`final-win`, "bg_new_smiling_face", (w,h)=>{
let winRight = this.g_cartoon.createCartoonElementImageFunc(`final-win-right`, "bg_winyou", (w,h)=>{
return {
sx: 700*this.g_mapScale / w,
sy: 560*this.g_mapScale / h
sx: 520*this.g_mapScale / w,
sy: 269*this.g_mapScale / h
}
}, (w,h)=>{
return{
x: this.g_canvasWidth / 2,
x: this.g_canvasWidth / 4 * 3,
y: this.g_canvasHeight / 2,
}
})
element.ref.y = - (560*this.g_mapScale) * this.g_mapScale
winRight.ref.y = - (560*this.g_mapScale) * this.g_mapScale
// element.smilingAni = this.g_cartoon.createAnimation("smiling_face", 10, 500)
// element.smilingAni.setScaleXY(0.5)
// element.smilingAni.x = 0;
// element.smilingAni.y = 0;
// element.smilingAni.loop = true;
// element.smilingAni.visible = true;
// element.ref.addChild(element.smilingAni)
let eYTou_left = this.g_cartoon.createCartoonElementImageFunc(`final-win-right-EYT-left`, "bg_you_win_zuo", (w,h)=>{
return {
sx: 205 / w,
sy: 154 / h
}
}, (w,h)=>{
return{
x: -160,
y: -65,
}
})
element.in = (callback?)=>{
tweenChange(element.ref, {y: element.initY}, 0.2, ()=>{
// element.smilingAni.play()
let eYTou_right = this.g_cartoon.createCartoonElementImageFunc(`final-win-right-EYT-right`, "bg_you_win_you", (w,h)=>{
return {
sx: 205 / w,
sy: 154 / h
}
}, (w,h)=>{
return{
x: 90,
y: -65,
}
})
winRight.ref.addChild(eYTou_left.ref)
winRight.ref.addChild(eYTou_right.ref)
// winRight.smilingAni = this.g_cartoon.createAnimation("smiling_face", 10, 500)
// winRight.smilingAni.setScaleXY(0.5)
// winRight.smilingAni.x = 0;
// winRight.smilingAni.y = 0;
// winRight.smilingAni.loop = true;
// winRight.smilingAni.visible = true;
// winRight.ref.addChild(winRight.smilingAni)
winRight.in = (callback?)=>{
tweenChange(winRight.ref, {y: winRight.initY}, 0.2, ()=>{
// winRight.smilingAni.play()
rotateItem(this.g_cartoon.getCartoonElement("final-win-right-EYT-left").ref, -30, 0.2, ()=>{
rotateItem(this.g_cartoon.getCartoonElement("final-win-right-EYT-left").ref, 30, 0.4, ()=>{
rotateItem(this.g_cartoon.getCartoonElement("final-win-right-EYT-left").ref, 0, 0.2, ()=>{
callback && callback()
})
})
})
rotateItem(this.g_cartoon.getCartoonElement("final-win-right-EYT-right").ref, 30, 0.2, ()=>{
rotateItem(this.g_cartoon.getCartoonElement("final-win-right-EYT-right").ref, -30, 0.4, ()=>{
rotateItem(this.g_cartoon.getCartoonElement("final-win-right-EYT-right").ref, 0, 0.2, ()=>{
})
})
})
})
}
winRight.out = (callback?)=>{
light.out()
tweenChange(winRight.ref, {y: - 176 * this.g_mapScale}, 0.2, ()=>{
callback && callback()
})
}
element.out = (callback?)=>{
let winLeft = this.g_cartoon.createCartoonElementImageFunc(`final-win-left`, "bg_winzuo", (w,h)=>{
return {
sx: 520*this.g_mapScale / w,
sy: 269*this.g_mapScale / h
}
}, (w,h)=>{
return{
x: this.g_canvasWidth / 4,
y: this.g_canvasHeight / 2,
}
})
winLeft.ref.y = - (560*this.g_mapScale) * this.g_mapScale
eYTou_left = this.g_cartoon.createCartoonElementImageFunc(`final-win-left-EYT-left`, "bg_you_win_zuo", (w,h)=>{
return {
sx: 205 / w,
sy: 154 / h
}
}, (w,h)=>{
return{
x: -80,
y: -65,
}
})
eYTou_right = this.g_cartoon.createCartoonElementImageFunc(`final-win-left-EYT-right`, "bg_you_win_you", (w,h)=>{
return {
sx: 205 / w,
sy: 154 / h
}
}, (w,h)=>{
return{
x: 170,
y: -65,
}
})
winLeft.ref.addChild(eYTou_left.ref)
winLeft.ref.addChild(eYTou_right.ref)
// winLeft.smilingAni = this.g_cartoon.createAnimation("smiling_face", 10, 500)
// winLeft.smilingAni.setScaleXY(0.5)
// winLeft.smilingAni.x = 0;
// winLeft.smilingAni.y = 0;
// winLeft.smilingAni.loop = true;
// winLeft.smilingAni.visible = true;
// winLeft.ref.addChild(winLeft.smilingAni)
winLeft.in = (callback?)=>{
tweenChange(winLeft.ref, {y: winLeft.initY}, 0.2, ()=>{
// winLeft.smilingAni.play()
rotateItem(this.g_cartoon.getCartoonElement("final-win-left-EYT-left").ref, -30, 0.2, ()=>{
rotateItem(this.g_cartoon.getCartoonElement("final-win-left-EYT-left").ref, 30, 0.4, ()=>{
rotateItem(this.g_cartoon.getCartoonElement("final-win-left-EYT-left").ref, 0, 0.2, ()=>{
callback && callback()
})
})
})
rotateItem(this.g_cartoon.getCartoonElement("final-win-left-EYT-right").ref, 30, 0.2, ()=>{
rotateItem(this.g_cartoon.getCartoonElement("final-win-left-EYT-right").ref, -30, 0.4, ()=>{
rotateItem(this.g_cartoon.getCartoonElement("final-win-left-EYT-right").ref, 0, 0.2, ()=>{
})
})
})
})
}
winLeft.out = (callback?)=>{
light.out()
tweenChange(element.ref, {y: - 176 * this.g_mapScale}, 0.2, ()=>{
tweenChange(winLeft.ref, {y: - 176 * this.g_mapScale}, 0.2, ()=>{
callback && callback()
})
}
let pingju = this.g_cartoon.createCartoonElementImageFunc(`final-pingju`, "bg_shake_hand", (w,h)=>{
let pingju = this.g_cartoon.createCartoonElementImageFunc(`final-pingju`, "bg_winwin", (w,h)=>{
return {
sx: 560*this.g_mapScale / w,
sy: 419*this.g_mapScale / h
sx: 619*this.g_mapScale / w,
sy: 308*this.g_mapScale / h
}
}, (w,h)=>{
return{
......@@ -1029,6 +1154,32 @@ export class PlayComponent implements OnInit, OnDestroy {
})
pingju.ref.y = - 419 * this.g_mapScale
eYTou_left = this.g_cartoon.createCartoonElementImageFunc(`final-win-pingju-EYT-left`, "bg_you_win_zuo", (w,h)=>{
return {
sx: 205 / w,
sy: 154 / h
}
}, (w,h)=>{
return{
x: -200,
y: -40,
}
})
eYTou_right = this.g_cartoon.createCartoonElementImageFunc(`final-win-pingju-EYT-right`, "bg_you_win_you", (w,h)=>{
return {
sx: 205 / w,
sy: 154 / h
}
}, (w,h)=>{
return{
x: 200,
y: -40,
}
})
pingju.ref.addChild(eYTou_left.ref)
pingju.ref.addChild(eYTou_right.ref)
// pingju.eyeAni = this.g_cartoon.createAnimation("shake_hand", 25, 1500)
// pingju.eyeAni.x = 0;
// pingju.eyeAni.y = 0;
......@@ -1039,8 +1190,23 @@ export class PlayComponent implements OnInit, OnDestroy {
pingju.in = (callback?)=>{
tweenChange(pingju.ref, {y: pingju.initY}, 0.2, ()=>{
// pingju.eyeAni.play()
rotateItem(this.g_cartoon.getCartoonElement("final-win-pingju-EYT-left").ref, -30, 0.2, ()=>{
rotateItem(this.g_cartoon.getCartoonElement("final-win-pingju-EYT-left").ref, 30, 0.4, ()=>{
rotateItem(this.g_cartoon.getCartoonElement("final-win-pingju-EYT-left").ref, 0, 0.2, ()=>{
callback && callback()
})
})
})
rotateItem(this.g_cartoon.getCartoonElement("final-win-pingju-EYT-right").ref, 30, 0.2, ()=>{
rotateItem(this.g_cartoon.getCartoonElement("final-win-pingju-EYT-right").ref, -30, 0.4, ()=>{
rotateItem(this.g_cartoon.getCartoonElement("final-win-pingju-EYT-right").ref, 0, 0.2, ()=>{
})
})
})
})
}
pingju.out = (callback?)=>{
......@@ -1074,7 +1240,8 @@ export class PlayComponent implements OnInit, OnDestroy {
}
this.render(light.ref, zIndexMap.finalPannel-1)
this.render(element.ref, zIndexMap.finalPannel)
this.render(winRight.ref, zIndexMap.finalPannel)
this.render(winLeft.ref, zIndexMap.finalPannel)
this.render(pingju.ref, zIndexMap.finalPannel)
}
......
......@@ -137,9 +137,16 @@ const localImages = {
'bg_pao': 'assets/play/new/bg_pao.png',
'bg_picdi': 'assets/play/new/bg_picdi.png',
'bg_star': 'assets/play/new/bg_star.png',
'bg_winwin': 'assets/play/new/bg_winwin.png',
'bg_winwin1': 'assets/play/new/bg_winwin1.png',
'bg_winwin2': 'assets/play/new/bg_winwin2.png',
'bg_winyou': 'assets/play/new/bg_winyou.png',
'bg_winzuo': 'assets/play/new/bg_winzuo.png',
'bg_yezi1': 'assets/play/new/bg_yezi1.png',
'bg_yezi2': 'assets/play/new/bg_yezi2.png',
'bg_you': 'assets/play/new/bg_you.png',
'bg_you_win_you': 'assets/play/new/bg_you_win_you.png',
'bg_you_win_zuo': 'assets/play/new/bg_you_win_zuo.png',
'bg_zuo': 'assets/play/new/bg_zuo.png',
'btn_laba1': 'assets/play/new/btn_laba1.png',
'btn_laba2': 'assets/play/new/btn_laba2.png',
......@@ -173,10 +180,13 @@ const localAudios = {
'sm-go': 'assets/default/audio/sm-go.mp3',
'sm-ready': 'assets/default/audio/sm-ready.mp3',
'click_btn': 'assets/play/sound/click_btn.mp3',
'cuowu': 'assets/play/sound/cuowu.mp3',
'great': 'assets/play/sound/great.mp3',
'guzhang': 'assets/play/sound/guzhang.mp3',
'open': 'assets/play/sound/open.mp3',
'polie': 'assets/play/sound/polie.mp3',
'start': 'assets/play/sound/start.mp3',
'win': 'assets/play/sound/win.mp3',
};
......
......@@ -105,9 +105,16 @@
'bg_pao': 'assets/play/new/bg_pao.png',
'bg_picdi': 'assets/play/new/bg_picdi.png',
'bg_star': 'assets/play/new/bg_star.png',
'bg_winwin': 'assets/play/new/bg_winwin.png',
'bg_winwin1': 'assets/play/new/bg_winwin1.png',
'bg_winwin2': 'assets/play/new/bg_winwin2.png',
'bg_winyou': 'assets/play/new/bg_winyou.png',
'bg_winzuo': 'assets/play/new/bg_winzuo.png',
'bg_yezi1': 'assets/play/new/bg_yezi1.png',
'bg_yezi2': 'assets/play/new/bg_yezi2.png',
'bg_you': 'assets/play/new/bg_you.png',
'bg_you_win_you': 'assets/play/new/bg_you_win_you.png',
'bg_you_win_zuo': 'assets/play/new/bg_you_win_zuo.png',
'bg_zuo': 'assets/play/new/bg_zuo.png',
'btn_laba1': 'assets/play/new/btn_laba1.png',
'btn_laba2': 'assets/play/new/btn_laba2.png',
......@@ -117,9 +124,12 @@
'btn_start': 'assets/play/new/btn_start.png',
'icon_star': 'assets/play/new/icon_star.png',
'click_btn': 'assets/play/sound/click_btn.mp3',
'cuowu': 'assets/play/sound/cuowu.mp3',
'great': 'assets/play/sound/great.mp3',
'guzhang': 'assets/play/sound/guzhang.mp3',
'open': 'assets/play/sound/open.mp3',
'polie': 'assets/play/sound/polie.mp3',
'start': 'assets/play/sound/start.mp3',
'win': 'assets/play/sound/win.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