Commit 65c3a252 authored by 李维's avatar 李维

dev commit

parent 20c67dab
...@@ -52,6 +52,7 @@ const zIndexMap = { ...@@ -52,6 +52,7 @@ const zIndexMap = {
cardBorder: 111, cardBorder: 111,
lianzi: 100, lianzi: 100,
window: 50, window: 50,
star: 1000,
animation: 9999 animation: 9999
} }
...@@ -217,10 +218,14 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -217,10 +218,14 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
endGame(){ endGame(){
this.g_cartoon.getCartoonElement("mask-layer").in(()=>{ this.g_cartoon.playAudio("xing_xing")
this.g_enableMapDown = false; this.showBlingStar(this.g_cartoon.getCartoonElement("bg-wall-star-container").ref, ()=>{
this.showEndPatal() this.g_cartoon.playAudio("gu_zhang")
this.clapHand() this.g_cartoon.getCartoonElement("mask-layer").in(()=>{
this.g_enableMapDown = false;
this.showEndPatal()
this.clapHand()
})
}) })
} }
...@@ -262,6 +267,18 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -262,6 +267,18 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
}) })
let PD = this.g_cartoon.createCartoonElementImageFunc("bg-wall-star-container", "star_container", (w, h)=>{
return {
sx: 1280 * this.g_mapScale / w,
sy: 187 * this.g_mapScale / h
}
}, (w, h)=>{
return {
x: this.g_canvasWidth / 2,
y: this.g_canvasHeight / 2 + 100 * this.g_mapScale,
}
})
this.subscribeMapUpEvent(PC.id, ()=>{ this.subscribeMapUpEvent(PC.id, ()=>{
let slider = this.g_cartoon.getCartoonElement("audio-plyer-slider") let slider = this.g_cartoon.getCartoonElement("audio-plyer-slider")
if(slider && slider.enableSlider){ if(slider && slider.enableSlider){
...@@ -272,6 +289,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -272,6 +289,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this.g_enableMapUp = true; this.g_enableMapUp = true;
}) })
this.render(PD.ref, zIndexMap.star)
this.render(PC.ref) this.render(PC.ref)
this.render(PA.ref) this.render(PA.ref)
this.render(PB.ref) this.render(PB.ref)
...@@ -667,6 +685,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -667,6 +685,7 @@ export class PlayComponent implements OnInit, OnDestroy {
let A3 = [] let A3 = []
let A4 = [] let A4 = []
let A5 = [] let A5 = []
let A6 = []
cardAll.forEach((card, index)=>{ cardAll.forEach((card, index)=>{
let pos = {x:0, y:0} let pos = {x:0, y:0}
if(index!=0){ if(index!=0){
...@@ -687,6 +706,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -687,6 +706,7 @@ export class PlayComponent implements OnInit, OnDestroy {
A3.push(temp.e3) A3.push(temp.e3)
A4.push(temp.e4) A4.push(temp.e4)
A5.push(temp.e5) A5.push(temp.e5)
A6.push(temp.e6)
}) })
// let movedDis =this.alignCenter(A1) // let movedDis =this.alignCenter(A1)
// A2.forEach(item=>{ // A2.forEach(item=>{
...@@ -719,6 +739,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -719,6 +739,7 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
}) })
this.m_allUpCards.push(`card-up-${index}`) this.m_allUpCards.push(`card-up-${index}`)
// 连接节点 // 连接节点
let dot = this.g_cartoon.createImage("icon_dian1", (w, h)=>{ let dot = this.g_cartoon.createImage("icon_dian1", (w, h)=>{
return { return {
...@@ -735,6 +756,32 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -735,6 +756,32 @@ export class PlayComponent implements OnInit, OnDestroy {
this.render(dot, zIndexMap.dot); this.render(dot, zIndexMap.dot);
card.ref.dot = dot; card.ref.dot = dot;
// 红色节点
let dot_red = this.g_cartoon.createImage("icon_dian2", (w, h)=>{
return {
sx: 37*this.g_mapScale / w,
sy: 37*this.g_mapScale / h
}
}, (w, h)=>{
return {
x: card.ref.x,
y: card.ref.y + 84*this.g_mapScale / 2
}
})
dot_red.visible = false;
this.render(dot_red, zIndexMap.dot);
card.ref.dot_red = dot_red;
card.showRedDot = ()=>{
dot.visible = false;
dot_red.visible = true;
}
card.showBlueDot = ()=>{
dot.visible = true;
dot_red.visible = false;
}
// 链接关系 // 链接关系
card.lineTo = JSON.parse(JSON.stringify(this.g_formData.textUp[index].lineTo)) card.lineTo = JSON.parse(JSON.stringify(this.g_formData.textUp[index].lineTo))
card.complete = false card.complete = false
...@@ -781,6 +828,8 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -781,6 +828,8 @@ export class PlayComponent implements OnInit, OnDestroy {
card.startAni = null; card.startAni = null;
card.showStar = (callback?)=>{ card.showStar = (callback?)=>{
this.g_cartoon.stopAudio("zheng_que")
this.g_cartoon.playAudio("zheng_que")
card.startAni = this.g_cartoon.createAnimation("bg_star", 11, 500, ()=>{ card.startAni = this.g_cartoon.createAnimation("bg_star", 11, 500, ()=>{
card.startAni.visible = false; card.startAni.visible = false;
this.deleteElementInRender(card.startAni.id) this.deleteElementInRender(card.startAni.id)
...@@ -793,6 +842,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -793,6 +842,7 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
this.subscribeMapDownEvent(card.id, ()=>{ this.subscribeMapDownEvent(card.id, ()=>{
this.g_cartoon.playAudio("dian_ji")
if(this.m_currentSelectedCard == card.id){ if(this.m_currentSelectedCard == card.id){
this.g_enableMapDown = true; this.g_enableMapDown = true;
return return
...@@ -806,6 +856,10 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -806,6 +856,10 @@ export class PlayComponent implements OnInit, OnDestroy {
}else{ }else{
result = this.g_cartoon.getCartoonElement(card.id).checkLink(this.m_currentSelectedCard) result = this.g_cartoon.getCartoonElement(card.id).checkLink(this.m_currentSelectedCard)
} }
if(!result){
this.g_cartoon.getCartoonElement(this.m_currentSelectedCard).showRedDot()
card.showRedDot()
}
this.lineTo(card.id, this.m_currentSelectedCard, result, ()=>{ this.lineTo(card.id, this.m_currentSelectedCard, result, ()=>{
if(!result){ if(!result){
this.g_cartoon.getCartoonElement(this.m_currentSelectedCard).showHideDoc(false) this.g_cartoon.getCartoonElement(this.m_currentSelectedCard).showHideDoc(false)
...@@ -838,7 +892,8 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -838,7 +892,8 @@ export class PlayComponent implements OnInit, OnDestroy {
e2: panzi, e2: panzi,
e3: label, e3: label,
e4: dot, e4: dot,
e5: card.startAni e5: card.startAni,
e6: dot_red
} }
} }
...@@ -874,6 +929,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -874,6 +929,7 @@ export class PlayComponent implements OnInit, OnDestroy {
let A3 = [] let A3 = []
let A4 = [] let A4 = []
let A5 = [] let A5 = []
let A6 = []
cardAll.forEach((card, index)=>{ cardAll.forEach((card, index)=>{
let pos = {x:0, y:0} let pos = {x:0, y:0}
if(index!=0){ if(index!=0){
...@@ -894,6 +950,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -894,6 +950,7 @@ export class PlayComponent implements OnInit, OnDestroy {
A3.push(temp.e3) A3.push(temp.e3)
A4.push(temp.e4) A4.push(temp.e4)
A5.push(temp.e5) A5.push(temp.e5)
A6.push(temp.e6)
}) })
let movedDis = this.alignCenter(A1) let movedDis = this.alignCenter(A1)
A2.forEach(item=>{ A2.forEach(item=>{
...@@ -908,6 +965,9 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -908,6 +965,9 @@ export class PlayComponent implements OnInit, OnDestroy {
A5.forEach(item=>{ A5.forEach(item=>{
item.x = item.x + movedDis item.x = item.x + movedDis
}) })
A6.forEach(item=>{
item.x = item.x + movedDis
})
} }
createCardDown(index, label, pos){ createCardDown(index, label, pos){
...@@ -953,7 +1013,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -953,7 +1013,7 @@ export class PlayComponent implements OnInit, OnDestroy {
borderRight.ref.visible = true borderRight.ref.visible = true
// 连接节点 // 连接节点
let dot = this.g_cartoon.createImage("icon_dian2", (w, h)=>{ let dot = this.g_cartoon.createImage("icon_dian1", (w, h)=>{
return { return {
sx: 37*this.g_mapScale / w, sx: 37*this.g_mapScale / w,
sy: 37*this.g_mapScale / h sy: 37*this.g_mapScale / h
...@@ -968,6 +1028,32 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -968,6 +1028,32 @@ export class PlayComponent implements OnInit, OnDestroy {
this.render(dot, zIndexMap.dot); this.render(dot, zIndexMap.dot);
card.ref.dot = dot; card.ref.dot = dot;
// 红色节点
let dot_red = this.g_cartoon.createImage("icon_dian2", (w, h)=>{
return {
sx: 37*this.g_mapScale / w,
sy: 37*this.g_mapScale / h
}
}, (w, h)=>{
return {
x: card.ref.x,
y: card.ref.y - 84*this.g_mapScale / 2
}
})
dot_red.visible = false;
this.render(dot_red, zIndexMap.dot);
card.ref.dot_red = dot_red;
card.showRedDot = ()=>{
dot.visible = false;
dot_red.visible = true;
}
card.showBlueDot = ()=>{
dot.visible = true;
dot_red.visible = false;
}
card.showHideDoc = (status)=>{ card.showHideDoc = (status)=>{
if(status){ if(status){
this.showItemDot(card.ref) this.showItemDot(card.ref)
...@@ -981,6 +1067,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -981,6 +1067,7 @@ export class PlayComponent implements OnInit, OnDestroy {
card.lined = false; card.lined = false;
this.subscribeMapDownEvent(card.id, ()=>{ this.subscribeMapDownEvent(card.id, ()=>{
this.g_cartoon.playAudio("dian_ji")
if(this.m_currentSelectedCard == card.id){ if(this.m_currentSelectedCard == card.id){
this.g_enableMapDown = true; this.g_enableMapDown = true;
return return
...@@ -994,6 +1081,10 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -994,6 +1081,10 @@ export class PlayComponent implements OnInit, OnDestroy {
}else{ }else{
result = this.g_cartoon.getCartoonElement(card.id).checkLink(this.m_currentSelectedCard) result = this.g_cartoon.getCartoonElement(card.id).checkLink(this.m_currentSelectedCard)
} }
if(!result){
this.g_cartoon.getCartoonElement(this.m_currentSelectedCard).showRedDot()
card.showRedDot()
}
this.lineTo(card.id, this.m_currentSelectedCard, result, ()=>{ this.lineTo(card.id, this.m_currentSelectedCard, result, ()=>{
if(!result){ if(!result){
this.g_cartoon.getCartoonElement(this.m_currentSelectedCard).showHideDoc(false) this.g_cartoon.getCartoonElement(this.m_currentSelectedCard).showHideDoc(false)
...@@ -1029,7 +1120,8 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1029,7 +1120,8 @@ export class PlayComponent implements OnInit, OnDestroy {
e2: label, e2: label,
e3: dot, e3: dot,
e4: borderLeft.ref, e4: borderLeft.ref,
e5: borderRight.ref e5: borderRight.ref,
e6: dot_red
} }
} }
...@@ -1161,7 +1253,10 @@ showItemDot(item) { ...@@ -1161,7 +1253,10 @@ showItemDot(item) {
item.sTween.stop(); item.sTween.stop();
} }
const dot = item.dot; const dot = item.dot;
const dot_red = item.dot_red;
dot.visible = true; dot.visible = true;
dot_red.visible = false
dot_red.setScaleXY(this.g_mapScale)
dot.setScaleXY(0); dot.setScaleXY(0);
item.sTween = scaleItem( item.sTween = scaleItem(
dot, dot,
...@@ -1180,9 +1275,11 @@ hideItemDot(item) { ...@@ -1180,9 +1275,11 @@ hideItemDot(item) {
item.sTween.stop(); item.sTween.stop();
} }
const dot = item.dot; const dot = item.dot;
dot.visible = true; const dot_red = item.dot_red;
dot.visible = false
dot_red.visible = true;
item.sTween = scaleItem( item.sTween = scaleItem(
dot, dot_red,
0, 0,
0.3, 0.3,
() => { () => {
...@@ -1217,18 +1314,20 @@ cutLine(line1, line2, callback?){ ...@@ -1217,18 +1314,20 @@ cutLine(line1, line2, callback?){
cutter.ref.visible = true cutter.ref.visible = true
tweenChange(cutter.ref, middlePos, 1, ()=>{ tweenChange(cutter.ref, middlePos, 1, ()=>{
cutter.ref.visible = false this.g_cartoon.playAudio("jian_dao", false, ()=>{
cutter.ref.x = cutter.initX cutter.ref.visible = false
cutter.ref.y = cutter.initY cutter.ref.x = cutter.initX
cutter.ref.y = cutter.initY
tweenChange(line1, {rotation: 360}, 0.5, TWEEN.Easing.Cubic.In) this.g_cartoon.playAudio("hua_luo")
tweenChange(line2, {rotation: 360}, 0.5, ()=>{ tweenChange(line1, {rotation: 360}, 1.3, TWEEN.Easing.Cubic.In)
this.m_setTimeoutIDs.push(setTimeout(() => { tweenChange(line2, {rotation: 360}, 1.3, ()=>{
this.deleteElementInRender(line1.id) this.m_setTimeoutIDs.push(setTimeout(() => {
this.deleteElementInRender(line2.id) this.deleteElementInRender(line1.id)
callback && callback() this.deleteElementInRender(line2.id)
}, 200)) callback && callback()
}, TWEEN.Easing.Cubic.In) }, 200))
}, TWEEN.Easing.Cubic.In)
})
},TWEEN.Easing.Cubic.Out) },TWEEN.Easing.Cubic.Out)
} }
...@@ -2315,15 +2414,18 @@ initBlackMask(callback?){ ...@@ -2315,15 +2414,18 @@ initBlackMask(callback?){
return (radian * Math.PI) / 180; return (radian * Math.PI) / 180;
} }
showBlingStar(element){ showBlingStar(element, callback?){
let rect = element.getBoundingBox() let rect = element.getBoundingBox()
showBlingBling(this.g_cartoon.images.get('icon_star2'), rect, element, 0.5, 1, 0.08, 2); showBlingBling(this.g_cartoon.images.get('icon_star'), rect, element, 0.5, 1, 0.08, 2);
setTimeout(()=>{ this.m_setTimeoutIDs.push(setTimeout(() => {
showBlingBling(this.g_cartoon.images.get('icon_star2'), rect, element, 0.5, 1, 0.08, 1.8); callback && callback()
},200) }, 2000))
setTimeout(()=>{ // setTimeout(()=>{
showBlingBling(this.g_cartoon.images.get('icon_star2'), rect, element, 0.5, 1, 0.08, 1.6); // showBlingBling(this.g_cartoon.images.get('icon_star'), rect, element, 0.5, 1, 0.08, 1.8);
},400) // },200)
// setTimeout(()=>{
// showBlingBling(this.g_cartoon.images.get('icon_star'), rect, element, 0.5, 1, 0.08, 1.6);
// },400)
} }
movePaoWuxian(element,dis,time,callback?){ movePaoWuxian(element,dis,time,callback?){
......
...@@ -68,6 +68,9 @@ const localImages = { ...@@ -68,6 +68,9 @@ const localImages = {
'border_right': 'assets/play/border_right.png', 'border_right': 'assets/play/border_right.png',
'line_6': "assets/play/6.png", 'line_6': "assets/play/6.png",
'line_7': "assets/play/7.png", 'line_7': "assets/play/7.png",
'star_container': "assets/play/star_container.png",
'bg_star (1)': 'assets/play/frame/bg_star (1).png', 'bg_star (1)': 'assets/play/frame/bg_star (1).png',
'bg_star (10)': 'assets/play/frame/bg_star (10).png', 'bg_star (10)': 'assets/play/frame/bg_star (10).png',
'bg_star (11)': 'assets/play/frame/bg_star (11).png', 'bg_star (11)': 'assets/play/frame/bg_star (11).png',
...@@ -112,9 +115,7 @@ const localAudios = { ...@@ -112,9 +115,7 @@ const localAudios = {
'hua_luo': 'assets/play/sound/hua_luo.mp3', 'hua_luo': 'assets/play/sound/hua_luo.mp3',
'jian_dao': 'assets/play/sound/jian_dao.mp3', 'jian_dao': 'assets/play/sound/jian_dao.mp3',
'xing_xing': 'assets/play/sound/xing_xing.mp3', 'xing_xing': 'assets/play/sound/xing_xing.mp3',
'zheng_que': 'assets/play/sound/zheng_que.mp3', 'zheng_que': 'assets/play/sound/zheng_que.mp3'
'default_long_audio': 'assets/play/sound/ThisIsTheSong.mp3',
'default_short_audio': 'assets/play/sound/short_audio.mp3',
}; };
export {localImages, localAudios}; export {localImages, localAudios};
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