Commit 41b020e6 authored by zjz1994's avatar zjz1994

代码暂存

parent 0ee1c419
......@@ -19,11 +19,16 @@ export default class MapBottomPart extends ComponentBase {
const icon = this.getIcon(i);
icon.addChild(star);
icon.show = ()=>{this.addChild(icon)};
icon.hide = ()=>{this.removeChild(icon)};
icon.show = ()=>{icon.visible = true;};
icon.hide = ()=>{icon.visible = false;};
icon['nums'] = icon.getChildAt(0);
icon['bmptxt']=icon.getChildAt(1);
icon['starsp'] = star;
icon.touchEnabled = true;
icon['nums'].touchEnabled = false;
icon['bmptxt'].touchEnabled = false;
icon['starsp'].touchEnabled = false;
}
// const repeatCount =getRepeatCount();
// for (let i = 0; i < MapBottomPart.LEVEL_NUMS; i++) {
......
......@@ -24,12 +24,17 @@ export default class MapRpeatPart extends ComponentBase {
const icon = this.getIcon(i);
icon.addChild(star);
icon.show = ()=>{this.addChild(icon)};
icon.hide = ()=>{this.removeChild(icon)};
icon.show = ()=>{icon.visible = true;};
icon.hide = ()=>{icon.visible = false;};
icon['nums'] = icon.getChildAt(0);
icon['bmptxt']=icon.getChildAt(1);
icon['starsp'] = star;
// icon.hide();
icon.touchEnabled = true;
icon['nums'].touchEnabled = false;
icon['bmptxt'].touchEnabled = false;
icon['starsp'].touchEnabled = false;
}
......
......@@ -133,8 +133,10 @@ export default class MapScene extends Scene {
if(!this.pic){
let light = RES.getRes('lightani_png');
this.pic = new egret.Bitmap(light);
this.pic.name = 'water_light';
this.pic.anchorOffsetX = 76;
this.pic.anchorOffsetY = 61;
this.pic.touchEnabled = false;
}
}
initMapScene(){
......@@ -813,15 +815,24 @@ export default class MapScene extends Scene {
for(var i=0;i<mapnums;i++){
const levelOrder = startlevel + i + 1;
let icon = mappart.getIcon(i);
let havewater_light = icon.getChildByName('water_light');
icon.removeEventListener(egret.TouchEvent.TOUCH_TAP,this.showToastQd);
mappart.getTxt(i).text = levelOrder + '';
if(levelOrder>last_level){
if(havewater_light){
console.log("当前关卡,移除water_light",levelOrder);
icon.removeChild(this.pic);
}
(icon['nums'] as eui.Image).source = 'icongray_png';
(icon['bmptxt'] as eui.BitmapLabel).visible = false;
icon.addEventListener(egret.TouchEvent.TOUCH_TAP,this.showToastQd,this);
(icon['starsp'] as MapStarComp).visible = false;
setGray(icon);
}else if(levelOrder<homeData.levels.length+1){
if(havewater_light){
console.log("当前关卡,移除water_light",levelOrder);
icon.removeChild(this.pic);
}
icon.filters = null;
var leveldata = homeData.levels[levelOrder-1];
console.log("关卡测试:"+levelOrder);
......@@ -837,8 +848,11 @@ export default class MapScene extends Scene {
(icon['bmptxt'] as eui.BitmapLabel).font = 'nums_fnt';
(icon['starsp'] as MapStarComp).setStar(0);
(icon['starsp'] as MapStarComp).visible = true;
this.pic.x = icon.x+50;
this.pic.y = icon.y+37+7;
if(!havewater_light){
this.pic.x = 50;
this.pic.y = 37+7;
icon.addChild(this.pic);
egret.Tween.removeTweens(this.pic);
egret.Tween.get(this.pic, { loop: true })
.set({
......@@ -847,11 +861,17 @@ export default class MapScene extends Scene {
alpha:1
})
.to({ scaleX: 2, scaleY: 2, alpha: 0 }, 1000).wait(1000);
console.log("当前关卡,添加water_light",levelOrder,this.pic);
}
}else{
icon.filters = null;
(icon['nums'] as eui.Image).source = 'icongray_png';
(icon['bmptxt'] as eui.BitmapLabel).visible = false;
(icon['starsp'] as MapStarComp).visible = false;
if(havewater_light){
console.log("当前关卡,移除water_light",levelOrder);
icon.removeChild(this.pic);
}
}
if(!icon.hasEventListener(egret.TouchEvent.TOUCH_TAP)){
icon.addEventListener(egret.TouchEvent.TOUCH_TAP,this.clickIcon,this);
......
......@@ -14,12 +14,16 @@ export default class MapTopPart extends ComponentBase {
const icon = this.getIcon(i);
icon.addChild(star);
icon.show = ()=>{this.addChild(icon)};
icon.hide = ()=>{this.removeChild(icon)};
icon.show = ()=>{icon.visible = true;};
icon.hide = ()=>{icon.visible = false;};
icon['nums'] = icon.getChildAt(0);
icon['bmptxt']=icon.getChildAt(1);
icon['starsp'] = star;
icon.touchEnabled = true;
icon['nums'].touchEnabled = false;
icon['bmptxt'].touchEnabled = false;
icon['starsp'].touchEnabled = false;
}
// for (let i = 0; i < MapTopPart.LEVEL_NUMS; i++) {
......
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