Commit 2627b490 authored by wildfirecode's avatar wildfirecode

1

parents 9d03556c 03243267
......@@ -129,7 +129,7 @@
"name": "friendshare"
},
{
"keys": "scratch_bg_png,scratch_hongbao_png,scratch_help_png,scratch_progress_bg_png,scratch_wx_tip_png,scratchbg2_png,scratch_invite_png",
"keys": "scratch_bg_png,scratch_hongbao_png,scratch_help_png,scratch_progress_bg_png,scratch_wx_tip_png,scratchbg2_png,scratch_invite_png,scratch_card_92_png,scratch_card_98_png,scratch_card_96_png,scratch_card_bg_png,scratch_card_94_png,scratch_card_90_png,scratch_user2_png,scratch_user1_png",
"name": "scratch"
},
{
......
......@@ -7,7 +7,9 @@
<e:Image y="259.33" source="scratch_bg_png" horizontalCenter="0"/>
<e:Group id="con" y="-67"/>
<e:Label id="numLabel" text="共2位好友帮你刮了90.3%" y="381.33" textColor="0xF54500" size="28" horizontalCenter="0" fontFamily="Lucida Family" verticalAlign="middle" textAlign="center"/>
<e:Image id="prizeImg" y="439.33" horizontalCenter="0.5" source="" width="510" height="228"/>
<e:Image y="414" horizontalCenter="0" source="scratch_card_bg_png"/>
<e:Image id="prizeImg" y="435" source="" width="510" height="228" horizontalCenter="0"/>
<e:Image id="scratch_progress" y="414" horizontalCenter="0" x="10" source="scratch_card_90_png"/>
<e:Button id="closeBtn" label="" x="605" y="219.33">
<e:skinName>
<e:Skin states="up,down,disabled" xmlns:w="http://ns.egret.com/wing">
......
......@@ -166,8 +166,8 @@ export default class MainScene extends Scene {
* 判断连通的状态
* 1表示存在小列连通到大列,从右往左遍历
* 2表示存在大列连通到小烈,从左往右遍历
* 3表示都有,遍历两边,down大,从右先
* 4表示都有,遍历两边,down小,从左先
* 3表示都有,遍历两边,down比up大,从右先
* 4表示都有,遍历两边,down比up小,从左先
*/
connectState: number = 2;
//皮肤上的
......@@ -482,7 +482,7 @@ export default class MainScene extends Scene {
this.generateIndexs = Tool.setGenerateLats(this.lattices, this.chapterData.map.generateLats || [])
var downMax: number = 0;
var downMin: number = Tool.colNum - 1;
var upMax: number = 0;
var hasSmallToBig: boolean;
var hasBigToSmall: boolean;
//联通口
......@@ -494,6 +494,8 @@ export default class MainScene extends Scene {
var colUp = Tool.indexToRc(connectedLat[0])[1];
var colDown = Tool.indexToRc(connectedLat[1])[1];
downMax = Math.max(downMax, colDown);
upMax = Math.max(upMax, colUp);
if (colUp > colDown) {
hasBigToSmall = true;
}
......@@ -503,10 +505,14 @@ export default class MainScene extends Scene {
}
//1表示存在小列连通到大列,从右往左遍历
//2表示存在大列连通到小烈,从左往右遍历
//3表示都有,遍历两边,down大,从右先
//4表示都有,遍历两边,down小,从左先
//3表示都有,遍历两边,down比up大,从右先
//4表示都有,遍历两边,down比up小,从左先
if (hasBigToSmall && hasSmallToBig) {
if (downMax > upMax) {
this.connectState = 3;
} else {
this.connectState = 4;
}
}
else if (hasBigToSmall) {
this.connectState = 2;
......@@ -1058,7 +1064,7 @@ export default class MainScene extends Scene {
if (/*!this.fallVerMark ||*/ Tool.judgeOutOne(this.emptys, this.lattices)) {
// this.fallVerMark = true;
var anis = this.fallVerticalEx();
anis = anis.concat(this.fallVerticalEx())
// anis = anis.concat(this.fallVerticalEx())
// anis = anis.concat(this.fallSkewEx())
if (!anis.length) {
anis = this.fallSkewEx()
......@@ -1146,8 +1152,8 @@ export default class MainScene extends Scene {
fallVerticalEx() {
//1表示存在小列连通到大列,从右往左遍历
//2表示存在大列连通到小烈,从左往右遍历
//3表示都有,遍历两边,down大,从右先
//4表示都有,遍历两边,down小,从左先
//3表示都有,遍历两边,down比up大,从右先
//4表示都有,遍历两边,down比up小,从左先
var anis: FallAniData[] = []
let operation = (m) => {
//同一列,先原有的填满,再查是否有生成口
......@@ -1210,20 +1216,20 @@ export default class MainScene extends Scene {
}
}
}
if (this.connectState == 1) {
for (var m = Tool.colNum; m >= 0; m++)operation(m)
}
else if (this.connectState == 2) {
// if (this.connectState == 1) {
// for (var m = Tool.colNum; m >= 0; m++)operation(m)
// }
// else if (this.connectState == 2) {
for (var m = 0; m < Tool.colNum; m++) operation(m)
}
else if (this.connectState == 3) {
for (var m = Tool.colNum; m >= 0; m++) operation(m);
for (var m = 0; m < Tool.colNum; m++) operation(m);
}
else if (this.connectState == 4) {
for (var m = 0; m < Tool.colNum; m++) operation(m);
for (var m = Tool.colNum; m >= 0; m++) operation(m);
}
// }
// else if (this.connectState == 3) {
// for (var m = Tool.colNum; m >= 0; m++) operation(m);
// for (var m = 0; m < Tool.colNum; m++) operation(m);
// }
// else if (this.connectState == 4) {
// for (var m = 0; m < Tool.colNum; m++) operation(m);
// for (var m = Tool.colNum; m >= 0; m++) operation(m);
// }
return anis;
}
......
......@@ -8,7 +8,6 @@ import ScratchRulePanel from "./ScratchRulePanel";
import CutTimer from "../CutTimer";
export default class ScratchPanel extends Panel {
private invite_img: egret.Texture;
private cutTimer: CutTimer;
constructor(data) {
......@@ -81,21 +80,30 @@ export default class ScratchPanel extends Panel {
this.hongbaoEffect();
this.setWXShareTip();
this["progressGroup"].mask = this["progressMask"];
this.setProgress(90.3);
this['numLabel'] = `共${this.data.invitationUser.length}位好友帮你刮了${90.3}%`;
this.setProgress(98);
this["prizeImg"].source = this.data.prizeImg;
if(!this.data.invitationUser) {
this.data.invitationUser = [];
}
// 添加邀请图标
let dNum = this.data.invitationCount - this.data.invitationUser.length;
for(let i = 0; i < dNum; i++) {
this.data.invitationUser.push({
nickname: "nickname",
avatar: this.invite_img,
avatar: "scratch_invite_png",
});
}
// 添加假用户
this.data.invitationUser.unshift({
nickname: "nickname",
avatar: "scratch_user1_png",
}, {
nickname: "nickname",
avatar: "scratch_user2_png",
});
// 添加回调函数
for(let i = 0; i < this.data.invitationUser.length; i++) {
this.data.invitationUser[i]['callFun'] = () => {
NetManager.ins.getShareCode((success, res) => {
......@@ -143,11 +151,31 @@ export default class ScratchPanel extends Panel {
} else if(progress < 0) {
progress = 0;
}
this['numLabel'].text = `共${this.data.invitationUser.length + 2}位好友帮你刮了${progress}%`;
this["progressLabel"].text = `仅剩${(100 - progress).toFixed(2)}%`; // 进度条文字
let _width = this["progressBg"].width * progress / 100; // 宽度
let dProgress = Math.abs(progress - this["progress"].width / this["progressBg"].width); // 比当前进度的差值的绝对值
let _duration = 1000 * dProgress / 100; // 算出变化的时间
egret.Tween.get(this["progress"]).to({width: _width}, _duration);
let i = new eui.Image();
if(progress >= 100){
this["scratch_progress"].visible = false;
} else if(progress >= 98 && progress < 100){
this["scratch_progress"].visible = true;
this["scratch_progress"].source = "scratch_card_98_png";
}else if(progress >= 96 && progress < 98){
this["scratch_progress"].visible = true;
this["scratch_progress"].source = "scratch_card_96_png";
}else if(progress >= 94 && progress < 96){
this["scratch_progress"].visible = true;
this["scratch_progress"].source = "scratch_card_94_png";
}else if(progress >= 92 && progress < 96){
this["scratch_progress"].visible = true;
this["scratch_progress"].source = "scratch_card_92_png";
}else if(progress < 92){
this["scratch_progress"].visible = true;
this["scratch_progress"].source = "scratch_card_90_png";
}
}
private setWXShareTip() {
......@@ -177,7 +205,6 @@ export default class ScratchPanel extends Panel {
}
private async getGameRes() {
this.invite_img = await RES.getResAsync("scratch_invite_png");
}
get skinKey() {
......
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