Commit 6b27b6af authored by 邱旭's avatar 邱旭

1

parent ebb29f80
......@@ -189,7 +189,7 @@
"name": "hbnoprize"
},
{
"keys": "hbGameCutTimeFont_fnt,hbGameCutTimeFont_png,hbGame_CutTime_bg_png,hbGame_CutTime_progress_png,hbGame_num_bg_png,hbGame_tips_png,hbGame_1_png,hbGame_2_png,hbGame_3_png,hbGame_+1_png,hbGame_bird_touch_png,hbGame_bird_png,hbGame_cattle_png,hbGame_cattle_touch_png,hbGame_hongbao_touch_png,hbGame_+2_png,hbGame_hongbao_png,hbGame_lion_png,hbGame_lion_touch_png,hbGame_pig_touch_png,hbGame_pig_png,hbGame_rabbit_touch_png,hbGame_rabbit_png,hbGameScoreFont_fnt,hbGameScoreFont_png",
"keys": "hbGameCutTimeFont_fnt,hbGameCutTimeFont_png,hbGame_CutTime_bg_png,hbGame_CutTime_progress_png,hbGame_num_bg_png,hbGame_tips_png,hbGame_1_png,hbGame_2_png,hbGame_3_png,hbGame_+1_png,hbGame_bird_touch_png,hbGame_bird_png,hbGame_cattle_png,hbGame_cattle_touch_png,hbGame_hongbao_touch_png,hbGame_+2_png,hbGame_hongbao_png,hbGame_lion_png,hbGame_lion_touch_png,hbGame_pig_touch_png,hbGame_pig_png,hbGame_rabbit_touch_png,hbGame_rabbit_png,hbGameScoreFont_fnt,hbGameScoreFont_png,hbGame_CutTime_btn_png",
"name": "hbgame"
},
{
......@@ -3247,6 +3247,11 @@
"url": "assets/hbCutTime/hbCutTime_rule_btn.png",
"type": "image",
"name": "hbCutTime_rule_btn_png"
},
{
"url": "assets/hbGame/hbGame_CutTime_btn.png",
"type": "image",
"name": "hbGame_CutTime_btn_png"
}
]
}
\ No newline at end of file
......@@ -6,10 +6,11 @@
<e:Image y="0" source="hbGame_num_bg_png" horizontalCenter="0"/>
<e:BitmapLabel id="scoreLabel" y="33" text="0" horizontalCenter="0" font="hbGameScoreFont_fnt"/>
</e:Group>
<e:Group y="45" horizontalCenter="0">
<e:Image y="0" horizontalCenter="0" source="hbGame_CutTime_bg_png"/>
<e:Image y="30" source="hbGame_CutTime_progress_png" horizontalCenter="-0.5"/>
<e:BitmapLabel id="cutTimeLabel" y="65" text="60" font="hbGameCutTimeFont_fnt" horizontalCenter="0"/>
<e:Group y="45" horizontalCenter="0" height="154">
<e:Image id="timeBtn" y="0" horizontalCenter="0" x="10" source="hbGame_CutTime_btn_png"/>
<e:Image y="25" horizontalCenter="0" source="hbGame_CutTime_bg_png"/>
<e:Image y="32" source="hbGame_CutTime_progress_png" horizontalCenter="-0.5"/>
<e:BitmapLabel id="cutTimeLabel" y="67" text="60" font="hbGameCutTimeFont_fnt" horizontalCenter="0.5"/>
</e:Group>
<e:Group id="readyGroup" y="310.5" horizontalCenter="0" width="560" height="710" anchorOffsetY="0">
<e:Label id="tipLabel" text="抢到15个红包才有奖励哦~" y="480" fontFamily="FZY3JW" horizontalCenter="0"/>
......
......@@ -8,13 +8,14 @@ import { HtmlTextParser } from "../../../libs/new_wx/HtmlTextParser";
* 红包雨主游戏
*/
export default class HbGame extends Panel {
public rainGroup:eui.Group;
public scoreGroup:eui.Group;
public scoreLabel:eui.BitmapLabel;
public cutTimeLabel:eui.BitmapLabel;
public readyGroup:eui.Group;
public readyCutTime:eui.Image;
public tipLabel:eui.Label;
public rainGroup: eui.Group;
public scoreGroup: eui.Group;
public scoreLabel: eui.BitmapLabel;
public timeBtn: eui.Image;
public cutTimeLabel: eui.BitmapLabel;
public readyGroup: eui.Group;
public tipLabel: eui.Label;
public readyCutTime: eui.Image;
private rainMgr: RainMgr = null;
private cutTime: egret.Timer = null;
......@@ -39,7 +40,7 @@ export default class HbGame extends Panel {
this.tipLabel.textFlow = (new HtmlTextParser).parser(`抢到<b>${15}</b>个红包才有奖励哦~`);
this.time = 60;
this.cutTimeLabel.text =`${this.time}`
this.cutTimeLabel.text = `${this.time}`
}
// 加分
......@@ -53,7 +54,7 @@ export default class HbGame extends Panel {
private gameOver() {
this.cutTime.stop();
this.cutTime.removeEventListener(egret.TimerEvent.TIMER,this.timeCallFun, this);
this.cutTime.removeEventListener(egret.TimerEvent.TIMER, this.timeCallFun, this);
GDispatcher.dispatchEvent('hbRainGameOver');
}
......@@ -67,9 +68,9 @@ export default class HbGame extends Panel {
this.cutTime.start();
}
private timeCallFun(){
private timeCallFun() {
this.cutTimeLabel.text = `${--this.time}`;
if(this.time <= 0){
if(this.time <= 0) {
this.gameOver();
}
}
......@@ -94,6 +95,9 @@ export default class HbGame extends Panel {
egret.Tween.get(obj).to({scaleX: _scaleMax, scaleY: _scaleMax, alpha: 0.1}, t2).call(() => {
this.readyGroup.visible = false;
this.startGame();
egret.Tween.get(this.timeBtn).to({y: 8}, 100).call(() => {
egret.Tween.get(this.timeBtn).to({y: 0}, 100);
});
})
});
})
......
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