Commit e61efcf2 authored by wildfirecode's avatar wildfirecode

1

parents 2516d5d5 571db8a0
......@@ -145,7 +145,7 @@ export default class MainBase extends eui.UILayer {
for (var i = 1; i <= 27; i++) {
RES.getResAsync("bonusFra" + i + "_png")
}
for (var i = 1; i <= 12; i++) {
for (var i = 1; i <= 19; i++) {
RES.getResAsync("eleDis" + i + "_png")
}
for (var i = 1; i <= 6; i++) {
......
......@@ -53,7 +53,7 @@
"name": "startpanel"
},
{
"keys": "yezi1_png,unlightedStar_png,targetBoard_png,stepsBoard_png,stepNumber9_png,stepNumber8_png,stepNumber7_png,stepNumber6_png,stepNumber5_png,stepNumber4_png,stepNumber3_png,stepNumber2_png,stepNumber1_png,stepNumber0_png,stepBtn_png,starProgress_png,setting_png,scoreNumber9_png,scoreNumber8_png,scoreNumber7_png,scoreNumber6_png,scoreNumber5_png,scoreNumber4_png,scoreNumber3_png,scoreNumber2_png,scoreNumber1_png,scoreNumber0_png,rock6_png,rock5_png,rock4_png,rock3_png,rock2_png,rock1_png,rightMark_png,rightArrow_png,rectLat_png,progressDown_png,playSceneBg_png,magicLionBg_png,magicLion_png,lockUp_png,lockDown_png,lineLight_png,lightedStar_png,leftArrow_png,ice6_png,ice5_png,ice4_png,ice3_png,ice2_png,ice1_png,hammerBtn_png,eleDis9_png,eleDis8_png,eleDis7_png,eleDis6_png,eleDis5_png,eleDis4_png,eleDis3_png,eleDis2_png,eleDis12_png,eleDis11_png,eleDis10_png,eleDis1_png,ele5_png,ele42_png,ele41_png,ele40_png,ele4_png,ele32_png,ele31_png,ele30_png,ele3_png,ele22_png,ele21_png,ele20_png,ele2_png,ele12_png,ele11_png,ele10_png,ele1_png,ele02_png,ele01_png,ele00_png,ele0_png,dangqianfenshu_png,chooseRect_png,boomBtn_png,boom9_png,boom8_png,boom7_png,boom6_png,boom5_png,boom4_png,boom3_png,boom2_png,boom18_png,boom17_png,boom16_png,boom15_png,boom14_png,boom13_png,boom12_png,boom11_png,boom10_png,boom1_png,mainSoundBtnOn_png,mainSettingBg_png,mainQuestionBtn_png,mainMusicBtnOn_png,mainQuitBtn_png,mainSoundBtnOff_png,mainMusicBtnOff_png,targetNumber9_png,targetNumber8_png,targetNumber7_png,targetNumber6_png,targetNumber5_png,targetNumber4_png,targetNumber3_png,targetNumber2_png,targetNumber1_png,targetNumber0_png,ele7_png,ele6_png,bonusFra9_png,bonusFra8_png,bonusFra7_png,bonusFra6_png,bonusFra5_png,bonusFra4_png,bonusFra3_png,bonusFra27_png,bonusFra26_png,bonusFra25_png,bonusFra24_png,bonusFra23_png,bonusFra22_png,bonusFra21_png,bonusFra20_png,bonusFra2_png,bonusFra19_png,bonusFra18_png,bonusFra17_png,bonusFra16_png,bonusFra15_png,bonusFra14_png,bonusFra13_png,bonusFra12_png,bonusFra11_png,bonusFra10_png,bonusFra1_png,bonusShoot_png,guideTxt5_png,guideTxt4_png,guideTxt3_png,guideTxt2_png,guideTxt1_png,guideKnowBtn_png,guideBg_png,propNum9_png,propNum8_png,propNum7_png,propNum6_png,propNum5_png,propNum4_png,propNum3_png,propNum2_png,propNum1_png,propNum0_png,propNumBg_png,bonusTime_png",
"keys": "yezi1_png,unlightedStar_png,targetBoard_png,stepsBoard_png,stepNumber9_png,stepNumber8_png,stepNumber7_png,stepNumber6_png,stepNumber5_png,stepNumber4_png,stepNumber3_png,stepNumber2_png,stepNumber1_png,stepNumber0_png,stepBtn_png,starProgress_png,setting_png,scoreNumber9_png,scoreNumber8_png,scoreNumber7_png,scoreNumber6_png,scoreNumber5_png,scoreNumber4_png,scoreNumber3_png,scoreNumber2_png,scoreNumber1_png,scoreNumber0_png,rock6_png,rock5_png,rock4_png,rock3_png,rock2_png,rock1_png,rightMark_png,rightArrow_png,rectLat_png,progressDown_png,playSceneBg_png,magicLionBg_png,magicLion_png,lockUp_png,lockDown_png,lineLight_png,lightedStar_png,leftArrow_png,ice6_png,ice5_png,ice4_png,ice3_png,ice2_png,ice1_png,hammerBtn_png,eleDis9_png,eleDis8_png,eleDis7_png,eleDis6_png,eleDis5_png,eleDis4_png,eleDis3_png,eleDis2_png,eleDis12_png,eleDis11_png,eleDis10_png,eleDis1_png,ele5_png,ele42_png,ele41_png,ele40_png,ele4_png,ele32_png,ele31_png,ele30_png,ele3_png,ele22_png,ele21_png,ele20_png,ele2_png,ele12_png,ele11_png,ele10_png,ele1_png,ele02_png,ele01_png,ele00_png,ele0_png,dangqianfenshu_png,chooseRect_png,boomBtn_png,boom9_png,boom8_png,boom7_png,boom6_png,boom5_png,boom4_png,boom3_png,boom2_png,boom18_png,boom17_png,boom16_png,boom15_png,boom14_png,boom13_png,boom12_png,boom11_png,boom10_png,boom1_png,mainSoundBtnOn_png,mainSettingBg_png,mainQuestionBtn_png,mainMusicBtnOn_png,mainQuitBtn_png,mainSoundBtnOff_png,mainMusicBtnOff_png,targetNumber9_png,targetNumber8_png,targetNumber7_png,targetNumber6_png,targetNumber5_png,targetNumber4_png,targetNumber3_png,targetNumber2_png,targetNumber1_png,targetNumber0_png,ele7_png,ele6_png,bonusFra9_png,bonusFra8_png,bonusFra7_png,bonusFra6_png,bonusFra5_png,bonusFra4_png,bonusFra3_png,bonusFra27_png,bonusFra26_png,bonusFra25_png,bonusFra24_png,bonusFra23_png,bonusFra22_png,bonusFra21_png,bonusFra20_png,bonusFra2_png,bonusFra19_png,bonusFra18_png,bonusFra17_png,bonusFra16_png,bonusFra15_png,bonusFra14_png,bonusFra13_png,bonusFra12_png,bonusFra11_png,bonusFra10_png,bonusFra1_png,bonusShoot_png,guideTxt5_png,guideTxt4_png,guideTxt3_png,guideTxt2_png,guideTxt1_png,guideKnowBtn_png,guideBg_png,propNum9_png,propNum8_png,propNum7_png,propNum6_png,propNum5_png,propNum4_png,propNum3_png,propNum2_png,propNum1_png,propNum0_png,propNumBg_png,bonusTime_png,eleDis19_png,eleDis18_png,eleDis17_png,eleDis16_png,eleDis15_png,eleDis14_png,eleDis13_png",
"name": "main"
},
{
......@@ -1474,9 +1474,39 @@
"name": "commmon_okbtn1_png"
},
{
"url": "assets/common/lightani.png",
"url": "assets/mainScene/eleDis19.png",
"type": "image",
"name": "lightani_png"
"name": "eleDis19_png"
},
{
"url": "assets/mainScene/eleDis13.png",
"type": "image",
"name": "eleDis13_png"
},
{
"url": "assets/mainScene/eleDis14.png",
"type": "image",
"name": "eleDis14_png"
},
{
"url": "assets/mainScene/eleDis15.png",
"type": "image",
"name": "eleDis15_png"
},
{
"url": "assets/mainScene/eleDis16.png",
"type": "image",
"name": "eleDis16_png"
},
{
"url": "assets/mainScene/eleDis17.png",
"type": "image",
"name": "eleDis17_png"
},
{
"url": "assets/mainScene/eleDis18.png",
"type": "image",
"name": "eleDis18_png"
}
]
}
\ No newline at end of file
......@@ -82,6 +82,9 @@ const effectBaseTimes = {
}
//三个toast和bonusTime
const movieClips: any = {}
export default class MainScene extends Scene {
get skinKey() { return 'Main' }
......@@ -137,9 +140,6 @@ export default class MainScene extends Scene {
//每一步生成的总分数
oneStepScore: number;
//三个toast
movieClips: any = {}
//皮肤上的
public starProgress: eui.Image;
public scoreTxt: eui.Label;
......@@ -199,7 +199,7 @@ export default class MainScene extends Scene {
Tool.init();
//第几关
this.chapter = (data && data.chapter) ? data.chapter : 1;
// this.chapter = 35;
// this.chapter = 27;
this.chapterTxt.text = "第" + this.chapter + "关";
//关卡数据,1期定制,70,后面35关地图一致,步数减少
var mapDataIndex = this.chapter;
......@@ -308,6 +308,7 @@ export default class MainScene extends Scene {
var parser = new window["SVGA"].Parser();
var svgas = ["amazing", "great", "wonderful", "bonusTime"]
for (let i = 0; i < svgas.length; i++) {
if (movieClips[svgas[i]]) continue;
parser.load(resPath + 'resource/assets/svgas/' + svgas[i] + ".svga", (videoItem) => {
var mv = new window["SVGA"].EgretMovieClip(videoItem);
mv.lockStep = true;
......@@ -320,10 +321,10 @@ export default class MainScene extends Scene {
mv.addEventListener(egret.Event.COMPLETE, fun = function (e) {
e.target.stop()
if (e.target.parent) {
this.removeChild(e.target)
e.target.parent.removeChild(e.target)
}
}, this)
this.movieClips[svgas[i]] = mv;
movieClips[svgas[i]] = mv;
}, function (error) {
// alert(error.message);
})
......@@ -1187,9 +1188,10 @@ export default class MainScene extends Scene {
//现在得位置的赋值
var lat = this.lattices[index];
lat.element = obj;
obj.fallAni()
//执行Tween
egret.Tween.get(obj)
.to({ x: position[0], y: position[1] }, 100/*, egret.Ease.cubicOut*/)
.to({ x: position[0], y: position[1] }, 180/*, egret.Ease.cubicOut*/)
.call(() => {
obj.x = position[0];
obj.y = position[1];
......@@ -1415,13 +1417,13 @@ export default class MainScene extends Scene {
this.commonContinuityTimes = 1;
this.effectContinuityTimes = 1;
if (this.movieClips["bonusTime"]) {
this.addChild(this.movieClips["bonusTime"])
this.movieClips["bonusTime"].gotoAndPlay(1, true)
if (movieClips["bonusTime"]) {
this.addChild(movieClips["bonusTime"])
movieClips["bonusTime"].gotoAndPlay(1, true)
setTimeout(() => {
this.terminateSteps();
if (this.movieClips["bonusTime"].parent) {
this.removeChild(this.movieClips["bonusTime"])
if (movieClips["bonusTime"].parent) {
this.removeChild(movieClips["bonusTime"])
}
}, 1930)
} else {
......@@ -1672,6 +1674,8 @@ export default class MainScene extends Scene {
this.goElementTarget(ele);
//如果格子有冰
this.iceBroke(this.lattices[index]);
//如果格子附近有石头
this.rokeBroke(this.lattices[index]);
} else {
//单纯元素消失特效
this.playAni(RecoverName.ELEDIS_ANI, p)
......@@ -1918,12 +1922,12 @@ export default class MainScene extends Scene {
playSound(SoundType.toast);
sv = "great";
}
if (sv && this.movieClips[sv]) {
this.addChild(this.movieClips[sv])
this.movieClips[sv].gotoAndPlay(1, true)
if (sv && movieClips[sv]) {
this.addChild(movieClips[sv])
movieClips[sv].gotoAndPlay(1, true)
setTimeout(() => {
if (this.movieClips[sv].parent) {
this.removeChild(this.movieClips[sv])
if (movieClips[sv].parent) {
this.removeChild(movieClips[sv])
}
}, 667)
}
......@@ -2184,15 +2188,16 @@ export default class MainScene extends Scene {
if (lat.column < Tool.colNum - 1) {
indexs.push(indexMy + 1)
}
for (var i = 0; i < indexs.length; i++) {
var lat = this.lattices[indexs[i]];
for (let i = 0; i < indexs.length; i++) {
let index = indexs[i];
let lat = this.lattices[index];
if (lat &&
lat.element &&
lat.element.type == ElementType.ROCK) {
//回收
let ele = lat.element;
//添加进emptys
this.emptys.push(lat.index)
this.emptys.push(index)
//从容器移除
this.elementContainer.removeChild(ele);
//回收元素
......@@ -2200,7 +2205,7 @@ export default class MainScene extends Scene {
//置空格子的element,
lat.element = null;
//播放动效
this.playAni(RecoverName.ROCK_ANI, Tool.getPositionByIndex(lat.index))
this.playAni(RecoverName.ROCK_ANI, Tool.getPositionByIndex(index))
}
}
}
......
......@@ -11,7 +11,7 @@ export class EleDisAni extends Ani {
super();
this.aniName = "EleDisAni";
var arr = []
for (var i = 1; i < 13; i++) {
for (var i = 1; i <= 19; i++) {
arr.push("eleDis" + i + "_png");
}
this.showImage = new ImageAni(arr);
......
......@@ -188,4 +188,11 @@ export class Element extends eui.Component {
break;
}
}
public fallAni() {
// egret.Tween.get(this, null, null, true)
// .set({ scaleY: 1 })
// .to({ scaleY: 0.7 }, 200)
// .to({ scaleY: 1 }, 100)
}
}
\ No newline at end of file
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