Commit d494142d authored by wjf's avatar wjf

l

parent 7bd7cb5b
...@@ -57,12 +57,8 @@ ...@@ -57,12 +57,8 @@
"name": "startpanel" "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,iceEle_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", "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,iceEle_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,mainMusicBtnClo_png,mainMusicBtnOn_png,mainQuitBtn_png,mainSoundBtnOff_png",
"name": "mainScene" "name": "mainScene"
},
{
"name": "preload",
"keys": "eliminate_mp3,fail_mp3,fall_mp3,line_mp3,sucess_mp3,mapBg_mp3,toast_mp3,playBg_mp3,magic_mp3,boom_mp3"
} }
], ],
"resources": [ "resources": [
...@@ -1032,54 +1028,89 @@ ...@@ -1032,54 +1028,89 @@
"name": "yezi1_png" "name": "yezi1_png"
}, },
{ {
"name": "eliminate_mp3", "url": "assets/sounds/eliminate.mp3",
"type": "sound", "type": "sound",
"url": "assets/sounds/eliminate.mp3" "name": "eliminate_mp3"
}, },
{ {
"name": "fail_mp3", "url": "assets/sounds/fail.mp3",
"type": "sound", "type": "sound",
"url": "assets/sounds/fail.mp3" "name": "fail_mp3"
}, },
{ {
"name": "fall_mp3", "url": "assets/sounds/fall.mp3",
"type": "sound", "type": "sound",
"url": "assets/sounds/fall.mp3" "name": "fall_mp3"
}, },
{ {
"name": "line_mp3", "url": "assets/sounds/line.mp3",
"type": "sound", "type": "sound",
"url": "assets/sounds/line.mp3" "name": "line_mp3"
}, },
{ {
"name": "sucess_mp3", "url": "assets/sounds/sucess.mp3",
"type": "sound", "type": "sound",
"url": "assets/sounds/sucess.mp3" "name": "sucess_mp3"
}, },
{ {
"name": "mapBg_mp3", "url": "assets/sounds/mapBg.mp3",
"type": "sound", "type": "sound",
"url": "assets/sounds/mapBg.mp3" "name": "mapBg_mp3"
}, },
{ {
"name": "toast_mp3", "url": "assets/sounds/toast.mp3",
"type": "sound", "type": "sound",
"url": "assets/sounds/toast.mp3" "name": "toast_mp3"
}, },
{ {
"name": "playBg_mp3", "url": "assets/sounds/playBg.mp3",
"type": "sound", "type": "sound",
"url": "assets/sounds/playBg.mp3" "name": "playBg_mp3"
}, },
{ {
"name": "magic_mp3", "url": "assets/sounds/magic.mp3",
"type": "sound", "type": "sound",
"url": "assets/sounds/magic.mp3" "name": "magic_mp3"
}, },
{ {
"name": "boom_mp3", "url": "assets/sounds/boom.mp3",
"type": "sound", "type": "sound",
"url": "assets/sounds/boom.mp3" "name": "boom_mp3"
},
{
"url": "assets/mainScene/mainSoundBtnOn.png",
"type": "image",
"name": "mainSoundBtnOn_png"
},
{
"url": "assets/mainScene/mainMusicBtnClo.png",
"type": "image",
"name": "mainMusicBtnClo_png"
},
{
"url": "assets/mainScene/mainMusicBtnOn.png",
"type": "image",
"name": "mainMusicBtnOn_png"
},
{
"url": "assets/mainScene/mainQuestionBtn.png",
"type": "image",
"name": "mainQuestionBtn_png"
},
{
"url": "assets/mainScene/mainQuitBtn.png",
"type": "image",
"name": "mainQuitBtn_png"
},
{
"url": "assets/mainScene/mainSettingBg.png",
"type": "image",
"name": "mainSettingBg_png"
},
{
"url": "assets/mainScene/mainSoundBtnOff.png",
"type": "image",
"name": "mainSoundBtnOff_png"
} }
] ]
} }
\ No newline at end of file
{ {
"skins": {}, "skins": {},
"autoGenerateExmlsList": true, "autoGenerateExmlsList": true,
"exmls": [ "exmls": [
"resource/skins/BoxSkin.exml", "resource/skins/BoxSkin.exml",
"resource/skins/AlertSkin.exml", "resource/skins/AlertSkin.exml",
"resource/skins/ToastSkin.exml", "resource/skins/ToastSkin.exml",
"resource/skins/BloodSkin.exml", "resource/skins/BloodSkin.exml",
"resource/skins/Buy1Skin.exml", "resource/skins/Buy1Skin.exml",
"resource/skins/Buy2Skin.exml", "resource/skins/Buy2Skin.exml",
"resource/skins/Buy3Skin.exml", "resource/skins/Buy3Skin.exml",
"resource/skins/FailSkin.exml", "resource/skins/FailSkin.exml",
"resource/skins/MapBottomSkin.exml", "resource/skins/MapBottomSkin.exml",
"resource/skins/MapRepeatSkin.exml", "resource/skins/MapRepeatSkin.exml",
"resource/skins/MapSkin.exml", "resource/skins/MapSkin.exml",
"resource/skins/MapTopSkin.exml", "resource/skins/MapTopSkin.exml",
"resource/skins/NoPrizeSkin.exml", "resource/skins/NoPrizeSkin.exml",
"resource/skins/OptionItemSkin.exml", "resource/skins/OptionItemSkin.exml",
"resource/skins/OptionsSkin.exml", "resource/skins/OptionsSkin.exml",
"resource/skins/PlaySkin.exml", "resource/skins/PlaySkin.exml",
"resource/skins/PrizeSkin.exml", "resource/skins/PrizeSkin.exml",
"resource/skins/QuitSkin.exml", "resource/skins/QuitSkin.exml",
"resource/skins/RankItemSkin.exml", "resource/skins/RankItemSkin.exml",
"resource/skins/RankSkin.exml", "resource/skins/RankSkin.exml",
"resource/skins/ReliveSkin.exml", "resource/skins/ReliveSkin.exml",
"resource/skins/RuleSkin.exml", "resource/skins/RuleSkin.exml",
"resource/skins/ShopSkin.exml", "resource/skins/ShopSkin.exml",
"resource/skins/StarSkin.exml", "resource/skins/StarSkin.exml",
"resource/skins/StartPanelSkin.exml", "resource/skins/StartPanelSkin.exml",
"resource/skins/StartSkin.exml", "resource/skins/StartSkin.exml",
"resource/skins/VScrollBarSkin.exml", "resource/skins/VScrollBarSkin.exml",
"resource/skins/MainSkin.exml", "resource/skins/MainSkin.exml",
"resource/skins/IconButtonSkin.exml" "resource/skins/IconButtonSkin.exml"
], ],
"path": "resource/default.thm.json" "path": "resource/default.thm.json"
} }
\ No newline at end of file
...@@ -10,8 +10,7 @@ ...@@ -10,8 +10,7 @@
<e:Image x="162.5" y="74.85" source="yezi1_png"/> <e:Image x="162.5" y="74.85" source="yezi1_png"/>
<e:Image x="54" y="28.85" source="stepsBoard_png"/> <e:Image x="54" y="28.85" source="stepsBoard_png"/>
<e:Image x="226.5" y="88.85" source="dangqianfenshu_png"/> <e:Image x="226.5" y="88.85" source="dangqianfenshu_png"/>
<e:Button id="settingBtn" label="" anchorOffsetX="44.5" anchorOffsetY="43.5" verticalCenter="-716.5" icon="setting_png" x="682.5" skinName="ui.IconButtonSkin">
</e:Button>
<e:Label id="scoreTxt" touchEnabled="false" size="20" width="194.85" anchorOffsetY="0" height="36" textAlign="left" bold="true" anchorOffsetX="0" verticalAlign="middle" fontFamily="Microsoft YaHei" text="XXXX" y="81.85" textColor="0x00556a" x="320.85"/> <e:Label id="scoreTxt" touchEnabled="false" size="20" width="194.85" anchorOffsetY="0" height="36" textAlign="left" bold="true" anchorOffsetX="0" verticalAlign="middle" fontFamily="Microsoft YaHei" text="XXXX" y="81.85" textColor="0x00556a" x="320.85"/>
<e:Label touchEnabled="false" size="20" width="101.85" anchorOffsetY="0" height="36" textAlign="left" anchorOffsetX="0" verticalAlign="middle" fontFamily="Microsoft YaHei" text="当前分数:" y="63.85" textColor="0x00556A" x="765"/> <e:Label touchEnabled="false" size="20" width="101.85" anchorOffsetY="0" height="36" textAlign="left" anchorOffsetX="0" verticalAlign="middle" fontFamily="Microsoft YaHei" text="当前分数:" y="63.85" textColor="0x00556A" x="765"/>
<e:Label touchEnabled="false" size="19" width="115.18" anchorOffsetY="0" height="36" textAlign="center" anchorOffsetX="0" verticalAlign="middle" fontFamily="Microsoft YaHei" text="剩余步数" y="53.48" x="66.35" textColor="0xffffff"/> <e:Label touchEnabled="false" size="19" width="115.18" anchorOffsetY="0" height="36" textAlign="center" anchorOffsetX="0" verticalAlign="middle" fontFamily="Microsoft YaHei" text="剩余步数" y="53.48" x="66.35" textColor="0xffffff"/>
...@@ -19,6 +18,17 @@ ...@@ -19,6 +18,17 @@
<e:Button id="hammerBtn" label="" anchorOffsetX="67.5" anchorOffsetY="60" icon="hammerBtn_png" skinName="ui.IconButtonSkin" y="1100" x="375.5"/> <e:Button id="hammerBtn" label="" anchorOffsetX="67.5" anchorOffsetY="60" icon="hammerBtn_png" skinName="ui.IconButtonSkin" y="1100" x="375.5"/>
<e:Button id="stepBtn" label="" anchorOffsetX="67.5" anchorOffsetY="60" icon="stepBtn_png" skinName="ui.IconButtonSkin" y="1100" x="568.46"/> <e:Button id="stepBtn" label="" anchorOffsetX="67.5" anchorOffsetY="60" icon="stepBtn_png" skinName="ui.IconButtonSkin" y="1100" x="568.46"/>
<e:Button id="boomBtn" label="" anchorOffsetX="67" anchorOffsetY="60" icon="boomBtn_png" skinName="ui.IconButtonSkin" y="1100" x="185.58"/> <e:Button id="boomBtn" label="" anchorOffsetX="67" anchorOffsetY="60" icon="boomBtn_png" skinName="ui.IconButtonSkin" y="1100" x="185.58"/>
<e:Group id="settingAll" width="89" height="320" x="641" y="53">
<e:Group id="settingGroup" width="72" height="282" x="8" y="29" anchorOffsetX="0" visible="false">
<e:Image x="0" y="0" source="mainSettingBg_png"/>
<e:Image id="musicBtn" x="14" y="174" source="mainMusicBtnOn_png"/>
<e:Image id="questionBtn" x="14" y="64" source="mainQuestionBtn_png"/>
<e:Image id="soundBtn" x="14" y="119" source="mainSoundBtnOn_png"/>
<e:Image id="quitBtn" x="14" y="228" source="mainQuitBtn_png"/>
</e:Group>
<e:Image id="settingBtn" x="-0.47" y="1" source="setting_png"/>
</e:Group>
......
...@@ -31,6 +31,10 @@ import { ScoreProgress } from '../something/uis/ScoreProgress'; ...@@ -31,6 +31,10 @@ import { ScoreProgress } from '../something/uis/ScoreProgress';
import { playSound, SoundType } from '../something/soundCtrl'; import { playSound, SoundType } from '../something/soundCtrl';
import Scene from '../../libs/new_wx/components/Scene'; import Scene from '../../libs/new_wx/components/Scene';
import { showToast } from '../../libs/new_wx/ctrls/toastCtrl'; import { showToast } from '../../libs/new_wx/ctrls/toastCtrl';
import getResPath from '../../libs/new_tc/getResPath';
import PanelCtrl from '../../libs/new_wx/ctrls/panelCtrl';
import { ModuleType } from '../../libs/tc/enum/ModuleType';
import { ModuleTypes } from '../../libs/new_wx/types/sceneTypes';
// import BridgeFactory from "../../libs/JSBridge/bridge/BridgeFactory"; // import BridgeFactory from "../../libs/JSBridge/bridge/BridgeFactory";
const aniClass = { const aniClass = {
...@@ -116,12 +120,19 @@ export default class MainScene extends Scene { ...@@ -116,12 +120,19 @@ export default class MainScene extends Scene {
//皮肤上的 //皮肤上的
public starProgress: eui.Image; public starProgress: eui.Image;
public settingBtn: eui.Button;
public scoreTxt: eui.Label; public scoreTxt: eui.Label;
public chapterTxt: eui.Label; public chapterTxt: eui.Label;
public hammerBtn: eui.Button; public hammerBtn: eui.Button;
public stepBtn: eui.Button; public stepBtn: eui.Button;
public boomBtn: eui.Button; public boomBtn: eui.Button;
public settingGroup: eui.Group;
public settingbg: eui.Image;
public soundBtn: eui.Image;
public musicBtn: eui.Image;
public questionBtn: eui.Image;
public quitBtn: eui.Image;
public settingBtn: eui.Button;
/** /**
* 剩余步数 * 剩余步数
*/ */
...@@ -155,6 +166,7 @@ export default class MainScene extends Scene { ...@@ -155,6 +166,7 @@ export default class MainScene extends Scene {
} }
start(data) { start(data) {
super.start()
//第几关 //第几关
var chapter = (data && data.chapter) ? data.chapter : 1; var chapter = (data && data.chapter) ? data.chapter : 1;
this.chapterTxt.text = "第" + chapter + "关"; this.chapterTxt.text = "第" + chapter + "关";
...@@ -211,6 +223,8 @@ export default class MainScene extends Scene { ...@@ -211,6 +223,8 @@ export default class MainScene extends Scene {
//初始化元素 //初始化元素
this.initELEMENTS(); this.initELEMENTS();
this.addChild(this["settingAll"])
//开启事件,具体不应该放在这里,到时看 //开启事件,具体不应该放在这里,到时看
this.enableMouseEvt(true); this.enableMouseEvt(true);
} }
...@@ -218,11 +232,11 @@ export default class MainScene extends Scene { ...@@ -218,11 +232,11 @@ export default class MainScene extends Scene {
* 加载所有用到的svga * 加载所有用到的svga
*/ */
initSvgas() { initSvgas() {
var resPath = window["resPath"] || "../egret/resource/svgas/" var resPath = getResPath()
var parser = new window["SVGA"].Parser(); var parser = new window["SVGA"].Parser();
var svgas = ["amazing", "great", "wonderful"] var svgas = ["amazing", "great", "wonderful"]
for (let i = 0; i < svgas.length; i++) { for (let i = 0; i < svgas.length; i++) {
parser.load(resPath + svgas[i] + ".svga", (videoItem) => { parser.load(resPath + 'resource/assets/svgas/' + svgas[i] + ".svga", (videoItem) => {
var mv = new window["SVGA"].EgretMovieClip(videoItem); var mv = new window["SVGA"].EgretMovieClip(videoItem);
mv.x = (750 - 520) / 2; mv.x = (750 - 520) / 2;
mv.y = 500; mv.y = 500;
...@@ -391,12 +405,20 @@ export default class MainScene extends Scene { ...@@ -391,12 +405,20 @@ export default class MainScene extends Scene {
// 侦听事件 // 侦听事件
initEvents() { initEvents() {
this.addEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this); this.addEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
this.settingBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_settingBtn, this)
this.questionBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_questionBtn, this)
this.soundBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_soundBtnn, this)
this.musicBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_musicBtn, this)
this.quitBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_quitBtn, this)
} }
removeEvents() { removeEvents() {
this.removeEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this); this.removeEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
// this.btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_btn, this); this.settingBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_settingBtn, this);
this.questionBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_questionBtn, this)
this.soundBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_soundBtnn, this)
this.musicBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_musicBtn, this)
this.quitBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_quitBtn, this)
} }
onEnterFrame() { onEnterFrame() {
if (this.touchEnabled) { if (this.touchEnabled) {
...@@ -440,7 +462,23 @@ export default class MainScene extends Scene { ...@@ -440,7 +462,23 @@ export default class MainScene extends Scene {
} }
} }
onTap_settingBtn() {
console.log(123)
this.settingGroup.visible = !this.settingGroup.visible;
}
onTap_questionBtn() {
PanelCtrl.instance.show(ModuleTypes.RULE_PANEL);
this.onTap_settingBtn();
}
onTap_soundBtnn() {
}
onTap_musicBtn() {
}
onTap_quitBtn() {
PanelCtrl.instance.show("quit");
}
mouseDownE(e: egret.TextEvent) { mouseDownE(e: egret.TextEvent) {
// if (!this.enableTouch) return // if (!this.enableTouch) return
...@@ -463,6 +501,7 @@ export default class MainScene extends Scene { ...@@ -463,6 +501,7 @@ export default class MainScene extends Scene {
//是 //是
if (e.target.parent.type == ElementType.ROCK || e.target.parent.isLock) return if (e.target.parent.type == ElementType.ROCK || e.target.parent.isLock) return
// console.log(e.target.parent)
if (self.SELECTED && Tool.checkNeb(e.target.parent, self.SELECTED)) { if (self.SELECTED && Tool.checkNeb(e.target.parent, self.SELECTED)) {
self.exchangeElementAni(self.SELECTED, e.target.parent, self.callbackEx); self.exchangeElementAni(self.SELECTED, e.target.parent, self.callbackEx);
// self.SELECTED.removeChild(self.choosed); // self.SELECTED.removeChild(self.choosed);
...@@ -481,8 +520,6 @@ export default class MainScene extends Scene { ...@@ -481,8 +520,6 @@ export default class MainScene extends Scene {
} }
} }
} }
mouseMoveE(e) { mouseMoveE(e) {
if (this.SELECTED && e.target.parent instanceof Element) { if (this.SELECTED && e.target.parent instanceof Element) {
if (e.target.parent.type == ElementType.ROCK || e.target.parent.isLock) return if (e.target.parent.type == ElementType.ROCK || e.target.parent.isLock) return
...@@ -1069,7 +1106,7 @@ export default class MainScene extends Scene { ...@@ -1069,7 +1106,7 @@ export default class MainScene extends Scene {
this.eliminatedElements.push(re[j][k]); this.eliminatedElements.push(re[j][k]);
} else { } else {
//原先在消除队列,是交叉点,变成爆炸特效 //原先在消除队列,是交叉点,变成爆炸特效
ele.temEffectType = EffectType.EXPLOSIVE; if (ele.temEffectType != EffectType.MAGICLION) ele.temEffectType = EffectType.EXPLOSIVE;
} }
} }
} }
...@@ -1085,13 +1122,13 @@ export default class MainScene extends Scene { ...@@ -1085,13 +1122,13 @@ export default class MainScene extends Scene {
if (this.eliminatedElements.indexOf(re[j][k]) == -1) { if (this.eliminatedElements.indexOf(re[j][k]) == -1) {
this.eliminatedElements.push(re[j][k]); this.eliminatedElements.push(re[j][k]);
} else { } else {
ele.temEffectType = EffectType.EXPLOSIVE; if (ele.temEffectType != EffectType.MAGICLION) ele.temEffectType = EffectType.EXPLOSIVE;
} }
} else { } else {
if (this.eliminatedElements.indexOf(re[j][k]) == -1) { if (this.eliminatedElements.indexOf(re[j][k]) == -1) {
this.eliminatedElements.push(re[j][k]); this.eliminatedElements.push(re[j][k]);
} else { } else {
ele.temEffectType = EffectType.EXPLOSIVE; if (ele.temEffectType != EffectType.MAGICLION) ele.temEffectType = EffectType.EXPLOSIVE;
} }
} }
} }
...@@ -1200,6 +1237,7 @@ export default class MainScene extends Scene { ...@@ -1200,6 +1237,7 @@ export default class MainScene extends Scene {
//先判断步数是否为0; //先判断步数是否为0;
if (this.steps == 0) { if (this.steps == 0) {
//判断是否有加步数的道具,有则提示是否加(加完判断死图),没有则直接结束 //判断是否有加步数的道具,有则提示是否加(加完判断死图),没有则直接结束
} else { } else {
//检查死图 //检查死图
this.warningCop = this.dieMapCheck() this.warningCop = this.dieMapCheck()
...@@ -1594,20 +1632,22 @@ export default class MainScene extends Scene { ...@@ -1594,20 +1632,22 @@ export default class MainScene extends Scene {
* 一次分数的toast * 一次分数的toast
*/ */
oneStepScoreToast() { oneStepScoreToast() {
var sv: string;
if (this.oneStepScore > 5000) { if (this.oneStepScore > 5000) {
playSound(SoundType.toast) playSound(SoundType.toast);
this.addChild(this.movieClips["wonderful"]) sv = "wonderful"
this.movieClips["wonderful"].gotoAndPlay(1, true)
} }
else if (this.oneStepScore > 3000) { else if (this.oneStepScore > 3000) {
playSound(SoundType.toast); playSound(SoundType.toast);
this.addChild(this.movieClips["great"]) sv = "great"
this.movieClips["great"].gotoAndPlay(1, true)
} }
else if (this.oneStepScore > 1000) { else if (this.oneStepScore > 1000) {
playSound(SoundType.toast); playSound(SoundType.toast);
this.addChild(this.movieClips["amazing"]) sv = "amazing"
this.movieClips["amazing"].gotoAndPlay(1, true) }
if (sv && this.movieClips[sv]) {
this.addChild(this.movieClips[sv])
this.movieClips[sv].gotoAndPlay(1, true)
} }
this.oneStepScore = 0; this.oneStepScore = 0;
} }
......
...@@ -264,7 +264,7 @@ export class Tool { ...@@ -264,7 +264,7 @@ export class Tool {
// } // }
// ], // ],
// }, // },
starScores: [1000, 2000, 3000] starScores: [3000, 5000, 10000]
} }
] ]
......
...@@ -33,6 +33,9 @@ export class Element extends eui.Component { ...@@ -33,6 +33,9 @@ export class Element extends eui.Component {
set effectType(value: EffectType) { set effectType(value: EffectType) {
if (this._effectType == value) return if (this._effectType == value) return
if (value != null) { if (value != null) {
//先去掉原先有的
this.removeHas();
//赋值现在的
switch (value) { switch (value) {
case EffectType.MAGICLION: case EffectType.MAGICLION:
this.changeSource("magicLion_png"); this.changeSource("magicLion_png");
...@@ -73,29 +76,12 @@ export class Element extends eui.Component { ...@@ -73,29 +76,12 @@ export class Element extends eui.Component {
} }
this._effectType = value; this._effectType = value;
} else { } else {
// console.log(this._effectType)
//回收掉原先有的 //回收掉原先有的
switch (this._effectType) { this.removeHas();
case EffectType.MAGICLION:
this.removeChild(this.magicLionBgAni);
Pool.recover(RecoverName.MAGICLIONBG_ANI, this.magicLionBgAni);
this.magicLionBgAni = null;
break;
case EffectType.HORIZONTAL:
this.removeChild(this.horizontalBgAni);
Pool.recover(RecoverName.HORIZONTALBG_ANI, this.horizontalBgAni);
this.horizontalBgAni = null;
break;
case EffectType.VERTICAL:
this.removeChild(this.verticalBgAni);
Pool.recover(RecoverName.VERTICALBG_ANI, this.verticalBgAni);
this.verticalBgAni = null;
break;
case EffectType.EXPLOSIVE:
break;
}
this.changeSource("ele" + this.type + "_png"); this.changeSource("ele" + this.type + "_png");
this._effectType = null; this._effectType = null;
// console.log(this)
} }
} }
magicLionBgAni: MagicLionBgAni; magicLionBgAni: MagicLionBgAni;
...@@ -169,6 +155,7 @@ export class Element extends eui.Component { ...@@ -169,6 +155,7 @@ export class Element extends eui.Component {
this.changeSource("ele" + type + "_png"); this.changeSource("ele" + type + "_png");
//特效重置 //特效重置
this.effectType = null; this.effectType = null;
this.temEffectType = null;
//lock重置 //lock重置
this._isLock = false; this._isLock = false;
//回收lockImage //回收lockImage
...@@ -178,4 +165,27 @@ export class Element extends eui.Component { ...@@ -178,4 +165,27 @@ export class Element extends eui.Component {
this.lockAni = null; this.lockAni = null;
} }
} }
private removeHas() {
//回收掉原先有的
switch (this._effectType) {
case EffectType.MAGICLION:
this.removeChild(this.magicLionBgAni);
Pool.recover(RecoverName.MAGICLIONBG_ANI, this.magicLionBgAni);
this.magicLionBgAni = null;
break;
case EffectType.HORIZONTAL:
this.removeChild(this.horizontalBgAni);
Pool.recover(RecoverName.HORIZONTALBG_ANI, this.horizontalBgAni);
this.horizontalBgAni = null;
break;
case EffectType.VERTICAL:
this.removeChild(this.verticalBgAni);
Pool.recover(RecoverName.VERTICALBG_ANI, this.verticalBgAni);
this.verticalBgAni = null;
break;
case EffectType.EXPLOSIVE:
break;
}
}
} }
\ No newline at end of file
...@@ -6,17 +6,17 @@ export enum RecoverName { ...@@ -6,17 +6,17 @@ export enum RecoverName {
LATTICE = "Lattice", LATTICE = "Lattice",
ICE = "Ice", ICE = "Ice",
BITMAP_NUMBER= "BitmapNumber", BITMAP_NUMBER = "BitmapNumber",
SCORE_NUMBER="ScoreNumber", SCORE_NUMBER = "ScoreNumber",
SCORE_ANI="ScoreAni", SCORE_ANI = "ScoreAni",
//元素身上 //元素身上
LOCK_ANI = "LockAni", LOCK_ANI = "LockAni",
MAGICLIONBG_ANI = "MagicLionBgAni", MAGICLIONBG_ANI = "MagicLionBgAni",
HORIZONTALBG_ANI = "HorizontalBgAni", HORIZONTALBG_ANI = "HorizontalBgAni",
VERTICALBG_ANI="VerticalBgAni", VERTICALBG_ANI = "VerticalBgAni",
//所有继承ani的,能单独播放的 //所有继承ani的,能单独播放的
ROCK_ANI = "RockAni", ROCK_ANI = "RockAni",
......
...@@ -10,6 +10,10 @@ export class ScoreProgress { ...@@ -10,6 +10,10 @@ export class ScoreProgress {
*/ */
starScores: number[]; starScores: number[];
star1: eui.Image;
star2: eui.Image;
star3: eui.Image;
starProgress: eui.Image; starProgress: eui.Image;
scoreTxt: eui.Label; scoreTxt: eui.Label;
allScore: number; allScore: number;
...@@ -21,23 +25,52 @@ export class ScoreProgress { ...@@ -21,23 +25,52 @@ export class ScoreProgress {
if (this._score == value) return if (this._score == value) return
this._score = value this._score = value
this.scoreTxt.text = Math.ceil(value) + ""; this.scoreTxt.text = Math.ceil(value) + "";
var diss = [
188,
446,
522,
595,
663
]
var w: number, scale: number;
//先计算是否达到了3星
if (value >= this.starScores[2]) {
var aa = (value - this.starScores[2]) / (this.allScore - this.starScores[2]);
scale = aa > 1 ? 1 : aa;
if (scale >= 1) {
if (!this.hasOver) {
this.hasOver = true;
} else {
return
}
}
w = (663 - 595) * scale + 595;
if (this.star3.source != "lightedStar_png") this.star3.source = "lightedStar_png";
}
else if (value >= this.starScores[1]) {
scale = (value - this.starScores[1]) / (this.starScores[2] - this.starScores[1]);
w = (595 - 522) * scale + 522;
if (this.star2.source != "lightedStar_png") this.star2.source = "lightedStar_png";
}
else if (value >= this.starScores[0]) {
scale = (value - this.starScores[0]) / (this.starScores[1] - this.starScores[0]);
w = (522 - 446) * scale + 446;
if (this.star1.source != "lightedStar_png") this.star1.source = "lightedStar_png";
} else {
scale = value / this.starScores[0];
w = (446 - 188) * scale + 188;
}
//(466-428)/428,扩分数 //(466-428)/428,扩分数
//星星 //星星
//进度条遮罩 //进度条遮罩
var scale = value / this.allScore > 1 ? 1 : value / this.allScore;
if (scale >= 1) {
if (!this.hasOver) {
this.hasOver = true;
} else {
return
}
}
var w = (650 - 188) * scale;
var mask: any = this.starProgress.mask; var mask: any = this.starProgress.mask;
mask.graphics.clear() mask.graphics.clear()
mask.graphics.beginFill(0xff0000, 1); mask.graphics.beginFill(0xff0000, 1);
mask.graphics.drawRoundRect(188, 75, w, 48, 50) mask.graphics.drawRoundRect(0, 75, w, 48, 50)
mask.graphics.endFill(); mask.graphics.endFill();
} }
/** /**
...@@ -55,11 +88,23 @@ export class ScoreProgress { ...@@ -55,11 +88,23 @@ export class ScoreProgress {
var p = starProgress.parent; var p = starProgress.parent;
var mask = new egret.Shape(); var mask = new egret.Shape();
mask.graphics.beginFill(0xff0000, 1); mask.graphics.beginFill(0xff0000, 1);
mask.graphics.drawRoundRect(188, 75, 1, 48, 50) mask.graphics.drawRoundRect(0, 75, 188, 48, 50)
mask.graphics.endFill(); mask.graphics.endFill();
this.starProgress.mask = mask; this.starProgress.mask = mask;
p.addChild(mask); p.addChild(mask);
//星星1 //星星1 lightedStar_png
var textureStar = RES.getRes("unlightedStar_png")
this.star1 = new eui.Image(textureStar)
this.star1.x = 423;
this.star1.y = 78;
p.addChild(this.star1);
this.star2 = new eui.Image(textureStar);
this.star2.x = 498;
this.star2.y = 78;
p.addChild(this.star2);
this.star3 = new eui.Image(textureStar);
this.star3.x = 573;
this.star3.y = 76;
p.addChild(this.star3);
} }
} }
\ 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