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

dev commit

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