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

Merge branch 'dev' of http://gitlab2.dui88.com/wanghongyuan/xiaoxiaole into dev

parents f8452261 89be3a13
......@@ -60,6 +60,8 @@ import BagQuitPanel from "../../src/panels/BagQuitPanel";
import H52Scene from "../../src/H52Scene";
import TurnPrizePanel from "../../src/panels/TurntablePanel/TurntablePrizePanel";
import TurnRulePanel from "./components/TurnRulePanel";
import TurntableNoPrizePanel from "../../src/panels/TurntablePanel/TurntableNoPrizePanel";
import TurnPrize2Panel from "../../src/panels/TurntablePanel/TurntablePrize2Panel";
export default class MainBase extends eui.UILayer {
constructor() {
......@@ -108,6 +110,8 @@ export default class MainBase extends eui.UILayer {
['turnTable', { cls: Turntable }],
['TurnRulePanel', { cls: TurnRulePanel }],
['TurnPrizePanel', { cls: TurnPrizePanel }],
['TurnPrize2Panel', { cls: TurnPrize2Panel }],
['TurntableNoPrizePanel', { cls: TurntableNoPrizePanel }],
['friend', { cls: FriendPanel }],
['ad', { cls: ADPanel }],
];
......
......@@ -81,7 +81,7 @@
"name": "signprize"
},
{
"keys": "toast_png,share_btn2_png,share_btn1_png,prizePanelbg_png,nums2_png,nums2_fnt,nums_png,nums_fnt,lightani_png,common_yuanbao_png,common_prizelight_png,common_adbg_png,commmon_okbtn1_png,closeCommonBtn_png,btn_png,alertbg_png,朋友圈中间分享蒙层1_jpg,按钮 副本 4_png,按钮 副本 3_png,exchangebtn_png",
"keys": "toast_png,share_btn2_png,share_btn1_png,prizePanelbg_png,nums2_png,nums2_fnt,nums_png,nums_fnt,lightani_png,common_yuanbao_png,common_prizelight_png,common_adbg_png,commmon_okbtn1_png,closeCommonBtn_png,btn_png,alertbg_png,朋友圈中间分享蒙层1_jpg,按钮 副本 4_png,按钮 副本 3_png,exchangebtn_png,turnnoprize再来一次2_png",
"name": "common"
},
{
......@@ -157,12 +157,24 @@
"name": "back"
},
{
"keys": "turnprize再抽一次按钮_png,turprize继续闯关按钮_png,turprizebg_png",
"keys": "turprize继续闯关按钮_png,turprizebg_png",
"name": "turntableprize"
},
{
"keys": "turnrule抽奖说明_png",
"name": "turnrule"
},
{
"keys": "turnnoprize再来一次_png,turnnoprize离奖励只差一毫米! 再来一次吧!_png,turnnoprize奖励溜走了,再试一次吧!_png,turnnoprize继续闯关_png,turnnoprize换个姿势再来一次!_png",
"name": "turntablenoprize"
},
{
"keys": "h52按钮_png",
"name": "h52"
},
{
"name": "preload",
"keys": "turnnoprizebg_png"
}
],
"resources": [
......@@ -2601,11 +2613,6 @@
"type": "image",
"name": "backbg_png"
},
{
"url": "assets/turntableprize/turnprize再抽一次按钮.png",
"type": "image",
"name": "turnprize再抽一次按钮_png"
},
{
"url": "assets/turntableprize/turprize继续闯关按钮.png",
"type": "image",
......@@ -2670,6 +2677,51 @@
"url": "assets/scratch/scratch_user2.png",
"type": "image",
"name": "scratch_user2_png"
},
{
"url": "assets/turnnoprize/turnnoprize再来一次.png",
"type": "image",
"name": "turnnoprize再来一次_png"
},
{
"url": "assets/turnnoprize/turnnoprize奖励溜走了,再试一次吧!.png",
"type": "image",
"name": "turnnoprize奖励溜走了,再试一次吧!_png"
},
{
"url": "assets/turnnoprize/turnnoprize换个姿势再来一次!.png",
"type": "image",
"name": "turnnoprize换个姿势再来一次!_png"
},
{
"url": "assets/turnnoprize/turnnoprize离奖励只差一毫米! 再来一次吧!.png",
"type": "image",
"name": "turnnoprize离奖励只差一毫米! 再来一次吧!_png"
},
{
"url": "assets/turnnoprize/turnnoprize继续闯关.png",
"type": "image",
"name": "turnnoprize继续闯关_png"
},
{
"url": "assets/h52/h52按钮.png",
"type": "image",
"name": "h52按钮_png"
},
{
"url": "assets/h52bg.jpg",
"type": "image",
"name": "h52bg_jpg"
},
{
"url": "assets/common/turnnoprize再来一次.png",
"type": "image",
"name": "turnnoprize再来一次2_png"
},
{
"name": "turnnoprizebg_png",
"type": "image",
"url": "assets/turnnoprize/turnnoprizebg.png"
}
]
}
\ No newline at end of file
......@@ -76,8 +76,9 @@
"resource/skins/Toast2Skin.exml",
"resource/skins/TurntableSkin.exml",
"resource/skins/TurnRuleSkin.exml",
"resource/skins/TurntablePrize2Skin.exml",
"resource/skins/TurntablePrizeSkin.exml",
"resource/skins/TurntableNoPrizeSkin.exml",
"resource/skins/VScrollBarSkin.exml"
],
"path": "resource/default.thm.json"
......
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="H52Skin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image source="invitebg_jpg"/>
<e:Image id="gobtn" source="h5_gobtn_png" y="995" horizontalCenter="0"/>
<e:Skin class="H52Skin" width="750" height="1624" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Group id="group" y="0" x="0">
<e:Image source="h52bg_jpg" x="0" y="0"/>
<e:Image id="gobtn" y="1196" source="h52按钮_png" alpha="0" x="135"/>
</e:Group>
<e:Image id="rulebtn" source="h5btn_png" y="954" horizontalCenter="0" visible="false"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="TurntableNoPrizeSkin" width="750" height="1624" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<w:Config id="16e02c1ad57"/>
<e:Component y="635" skinName="ADSmallSkin" horizontalCenter="0" visible="false"/>
<e:Image y="161" horizontalCenter="0.5" source="turnnoprizebg_png"/>
<e:Button id="closeBtn" label="" y="224.88" x="623">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="closeCommonBtn_png" source.down="closeCommonBtn_png" source.disabled="closeCommonBtn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Group y="494.67" horizontalCenter="0.5">
<e:Button id="btn1" label="" y="0" x="9.09">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="turnnoprize再来一次_png" source.down="turnnoprize再来一次_png" source.disabled="turnnoprize再来一次_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="btn2" label="" y="0" x="279">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="turnnoprize继续闯关_png" source.down="turnnoprize继续闯关_png" source.disabled="turnnoprize继续闯关_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Label id="satus2" text="(免费次数:1)" x="69.3" y="62.66" size="22" touchEnabled="false" visible="false"/>
<e:Group id="status1" x="52" y="60" touchChildren="false" touchEnabled="false" visible="false">
<e:Label text=")" x="132" y="2" size="22" touchEnabled="false"/>
<e:Label id="nums" text="(-50" x="0" y="0" size="22" textAlign="right" width="82" touchEnabled="false"/>
<e:Image source="common_yuanbao_png" x="91.99" y="1.67"/>
</e:Group>
</e:Group>
<e:Image id="tips1" source="turnnoprize换个姿势再来一次!_png" y="358" horizontalCenter="0" visible="false"/>
<e:Image id="tips2" source="turnnoprize奖励溜走了,再试一次吧!_png" y="360" horizontalCenter="0" visible="false"/>
<e:Image id="tips3" source="turnnoprize离奖励只差一毫米! 再来一次吧!_png" y="340" horizontalCenter="0.5" visible="false"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="TurntablePrize2" width="750" height="1624" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<w:Config id="16e02c1ad57"/>
<e:Component y="788" skinName="ADSmallSkin" horizontalCenter="0" visible="false"/>
<e:Image id="light2" source="invitebg2_png" x="376" y="317" anchorOffsetX="356" anchorOffsetY="296"/>
<e:Image id="light1" source="invitebg2_png" x="386" y="327" anchorOffsetX="356" anchorOffsetY="296"/>
<e:Group id="container" y="-45.45" x="-3"/>
<e:Image source="turprizebg_png" y="161" horizontalCenter="0.5"/>
<e:Image width="508" height="225" source="{data.url}" horizontalCenter="0" y="355.76"/>
<e:Button id="closeBtn" label="" y="242.88" x="615">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="closeCommonBtn_png" source.down="closeCommonBtn_png" source.disabled="closeCommonBtn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Group y="631.67" horizontalCenter="0.5">
<e:Button id="btn1" label="" y="0" x="9.09">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="turnnoprize再来一次_png" source.down="turnnoprize再来一次_png" source.disabled="turnnoprize再来一次_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="btn2" label="" y="0" x="279">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="turprize继续闯关按钮_png" source.down="turprize继续闯关按钮_png" source.disabled="turprize继续闯关按钮_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Group id="status1" x="52" y="60" visible="false">
<e:Label text=")" x="132" y="2" size="22" touchEnabled="false"/>
<e:Label id="nums" text="(-50" x="0" y="0" size="22" textAlign="right" width="82" touchEnabled="false"/>
<e:Image source="common_yuanbao_png" x="91.99" y="1.67"/>
</e:Group>
</e:Group>
<e:Label id="satus2" text="(免费次数:1)" x="169.3" y="693.66" size="22" touchEnabled="false" visible="false"/>
</e:Skin>
\ No newline at end of file
......@@ -19,7 +19,7 @@
<e:Button id="btn1" label="" y="0" x="9.09">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="turnprize再抽一次按钮_png" source.down="turnprize再抽一次按钮_png" source.disabled="turnprize再抽一次按钮_png"/>
<e:Image width="100%" height="100%" source="turnnoprize再来一次_png" source.down="turnnoprize再来一次_png" source.disabled="turnnoprize再来一次_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
......@@ -32,7 +32,11 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Label text=")" x="184" y="62" size="22" touchEnabled="false"/>
<e:Label id="nums" text="(-50" x="52" y="60" size="22" textAlign="right" width="82" touchEnabled="false"/>
<e:Group id="status1" x="52" y="60" visible="false">
<e:Label text=")" x="132" y="2" size="22" touchEnabled="false"/>
<e:Label id="nums" text="(-50" x="0" y="0" size="22" textAlign="right" width="82" touchEnabled="false"/>
<e:Image source="common_yuanbao_png" x="91.99" y="1.67"/>
</e:Group>
</e:Group>
<e:Label id="satus2" text="(免费次数:1)" x="169.3" y="693.66" size="22" touchEnabled="false" visible="false"/>
</e:Skin>
\ No newline at end of file
......@@ -7,6 +7,8 @@ export default class H52Scene extends Scene {
async start(data?) {
super.start();
this['group'].y = (this.stage.stageHeight -1624)/2
// this.height=this.stage.stageHeight;
// this['rulebtn'].addEventListener(egret.TouchEvent.TOUCH_TAP,()=>{
// PanelCtrl.instance.show('inviterule')
// },this);
......
......@@ -62,6 +62,7 @@ import { StateType } from '../something/enum/StateType';
import { HairballBlackState } from '../something/states/HairballBlackState';
import { HairballGreyDisAni } from '../something/anis/HairballGreyDisAni';
import { HairballBrownState } from '../something/states/HairballBrownState';
import { EleDownAni } from '../something/anis/EleDownAni';
const aniClass = {
"BoomAni": BoomAni,
......@@ -170,6 +171,14 @@ export default class MainScene extends Scene {
* 4表示都有,遍历两边,down比up小,从左先
*/
connectState: number = 2;
/**
* 应用棋盘大遮罩,还是单独对生成元素,连通元素用小方形遮罩
* 出于性能问题,用大遮罩,只遮一次,
* 但是如果出现连通口上格子的下排正下方格子不为空的情况,必须用小方形遮罩,否则元素穿帮
* 或者生成口上排正上方格子不为空时也
* 默认用大遮罩
*/
useSmallMask: boolean = false;
//皮肤上的
public starProgress: eui.Image;
public scoreTxt: eui.Label;
......@@ -245,15 +254,10 @@ export default class MainScene extends Scene {
NetManager.ins.showLog(getlogItem(10))
NetManager.ins.showLog(getlogItem(13))
//步数初始化
this.steps = this.chapterData.stepCount;
//初始化目标信息
this.initTarget();
//初始化回收口,如果是棒棒糖关卡,那么在地图底部增加棒棒糖洞,
//初始化回收口,如果是棒棒糖关卡,那么在地图底部增加棒棒糖洞,用到map
this.initRecycle();
//初始化格子
this.initLattices();
//初始化元素
this.initElement();
//重置基础元素类型及特效
......@@ -271,7 +275,6 @@ export default class MainScene extends Scene {
this.addChild(this["settingAll"])
//AiControl初始化,
AiControl.ins.init(this.lattices);
//引导
this.initGuide();
}
......@@ -312,31 +315,27 @@ export default class MainScene extends Scene {
this.stepNumber.x = 123;
this.stepNumber.y = 97;
this.addChild(this.stepNumber);
//步数初始化
this.steps = this.chapterData.stepCount;
//分数进度条,托管
this.scoreProgress = new ScoreProgress(this.starProgress, this.scoreTxt, this.chapterData.starScores);
this.scoreTxt.y -= 2;
//背景图生成
// var bg = drawBg(this.chapterData.map.paths, this.chapterData.map.lattices)
//地图生成
var path = generateMapBg(this.chapterData.map.lattices);
var bg = drawBg(path, this.chapterData.map.lattices)
this.addChild(bg);
this.map = bg;
//选择框
var textureChoosed: egret.Texture = RES.getRes("chooseRect_png")
this.choosed = new eui.Image(textureChoosed);
this.choosed.x = -textureChoosed.textureWidth / 2;
this.choosed.y = -textureChoosed.textureHeight / 2;
//初始话地图格子数据,主要因为有冰块,要添加进map,还有要判断是否需要大遮罩,所以位置在这里
this.initLattices();
//容器
this.elementContainer = new egret.DisplayObjectContainer();
this.addChild(this.elementContainer);
//加遮罩
// var mask = new egret.Shape();
// mask.graphics.beginFill(0xffffff, 1);
// mask.graphics.drawRect(Tool.offsetX, Tool.offsetY, Tool.width * Tool.colNum, Tool.height * Tool.rowNum + 100);
// mask.graphics.endFill();
// var mask = drawShape(path);
// this.elementContainer.mask = mask;
// this.addChild(mask)
if (!this.useSmallMask) {
var mask = drawShape(path);
this.elementContainer.mask = mask;
this.addChild(mask)
}
//容器事件
this.elementContainer.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.mouseDownE, this);
this.elementContainer.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.mouseMoveE, this);
......@@ -366,11 +365,16 @@ export default class MainScene extends Scene {
this[arrObj[i]].count = nums[i];
this.addChild(this[arrObj[i]])
}
//道具使用时蒙层
//选择框 无需加入场景
var textureChoosed: egret.Texture = RES.getRes("chooseRect_png")
this.choosed = new eui.Image(textureChoosed);
this.choosed.x = -textureChoosed.textureWidth / 2;
this.choosed.y = -textureChoosed.textureHeight / 2;
//道具使用时蒙层 无需加入场景
this.propGuide = new PropGuide();
this.propGuide.touchEnabled = true;
// this.addChild(this.propGuide);
//bonusTime引导,备用的
//bonusTime引导,备用的,无需加入场景
this.bonusTime = new BonusTime();
this.bonusTime.x = 375;
this.bonusTime.y = 600;
......@@ -406,7 +410,7 @@ export default class MainScene extends Scene {
if (this.passElements && this.passElements[ElementType.LOLLIPOP]) {
//初始化recycleIndexs,
var recycles = this.chapterData.map.recycles;
//如果没有就取最下层的
//如果没有就取最下层的,用地图数据格子初始化
if (!recycles || !recycles.length) {
var endRowNumHash = {}, endRowNum: number = 0;;
for (var i = 0; i < this.chapterData.map.lattices.length; i++) {
......@@ -450,7 +454,7 @@ export default class MainScene extends Scene {
this.map.addChildAt(imgs, 0);
}
}
//初始化地图格子数据
//初始化地图格子数据,包括生成口,联通口
initLattices() {
var latticesD = this.chapterData.map.lattices;
//先格子
......@@ -478,8 +482,16 @@ export default class MainScene extends Scene {
ice.y = p[1];
}
}
//生成口数据
var genLatDatas = this.chapterData.map.generateLats || [];
//设置生成口,
this.generateIndexs = Tool.setGenerateLats(this.lattices, this.chapterData.map.generateLats || [])
this.generateIndexs = Tool.setGenerateLats(this.lattices, genLatDatas)
//判断生成口上排正上方格子是否存在
for (var i = 0; i < genLatDatas.length; i++) {
var genLatData: GenerateLatData = genLatDatas[i]
var index = genLatData.index;
if (this.lattices[index - Tool.colNum]) this.useSmallMask = true;
}
var downMax: number = 0;
var upMax: number = 0;
......@@ -488,6 +500,7 @@ export default class MainScene extends Scene {
//联通口
var connectedLats = this.chapterData.map.connectedLats || [];
for (var i = 0; i < connectedLats.length; i++) {
//0是上格子,1是下格子
var connectedLat = connectedLats[i];
this.lattices[connectedLat[0]].down = connectedLat[1];
this.lattices[connectedLat[1]].up = connectedLat[0];
......@@ -496,12 +509,10 @@ export default class MainScene extends Scene {
var colDown = Tool.indexToRc(connectedLat[1])[1];
downMax = Math.max(downMax, colDown);
upMax = Math.max(upMax, colUp);
if (colUp > colDown) {
hasBigToSmall = true;
}
else if (colUp < colDown) {
hasSmallToBig = true;
}
if (colUp > colDown) hasBigToSmall = true;
else if (colUp < colDown) hasSmallToBig = true;
//连通口上格子的下排正下方格子是否存在
if (this.lattices[connectedLat[0] + Tool.colNum]) this.useSmallMask = true;
}
//1表示存在小列连通到大列,从右往左遍历
//2表示存在大列连通到小烈,从左往右遍历
......@@ -519,8 +530,7 @@ export default class MainScene extends Scene {
}
else if (hasSmallToBig) {
this.connectState = 1;
}
//否则默认的2
}//否则默认的2
}
//初始化地图元素
initElement() {
......@@ -1064,8 +1074,6 @@ 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.fallSkewEx())
if (!anis.length) {
anis = this.fallSkewEx()
if (!anis.length) {
......@@ -1216,20 +1224,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;
}
......@@ -1331,7 +1339,7 @@ export default class MainScene extends Scene {
//是竖直的。播放声音
if (isVertical) {
playSound(SoundType.fall);
deltaTime = Tool.latDeltaTime * 2 / 3;
deltaTime = Tool.latDeltaTime * 2 / 3;//加系数有问题,包括wait
}
let count = 0;
let countAll = anis.length;
......@@ -1355,18 +1363,16 @@ export default class MainScene extends Scene {
let fp = Tool.getPositionByIndex(firstIndex.index);
ele.x = fp[0];
ele.y = fp[1] - Tool.height;
//加遮罩
tween = egret.Tween.get(ele);
//有等待的话,只有多格子掉落的时候才有
if (wait) tween.wait(wait);
//加遮罩,需要遮罩写法,
if (this.useSmallMask) {
let mask = Tool.getRectMask();
mask.x = fp[0];
mask.y = fp[1];
this.elementContainer.addChild(mask);
ele.mask = mask;
tween = egret.Tween.get(ele);
//有等待的话
if (wait) {
// console.log(wait)
tween.wait(wait);
}
tween.to({ x: fp[0], y: fp[1] }, deltaTime)
.call(() => {
//移除遮罩
......@@ -1374,6 +1380,9 @@ export default class MainScene extends Scene {
//回收
mask.recover()
})
} else {
tween.to({ x: fp[0], y: fp[1] }, deltaTime)
}
wait += deltaTime
} else {
oriRow = ele.row;
......@@ -1391,22 +1400,24 @@ export default class MainScene extends Scene {
let indexUp = this.lattices[index].up;
let downPos = Tool.getPositionByIndex(index);
let upPos = Tool.getPositionByIndex(indexUp);
//加遮罩
// let mask11 = Tool.getRectMask();
// mask11.x = indexUp[0];
// mask11.y = indexUp[1];
// ele.mask = mask11;
// this.elementContainer.addChild(mask11);
EleMaskAni(ele, upPos, wait, this.elementContainer, true);
//用遮罩的写法
if (this.useSmallMask) {
//up处的动画
EleMaskAni(ele, upPos, wait, this.elementContainer, true, deltaTime);
tween.set({ alpha: 0 })
.wait(deltaTime)
.set({ alpha: 1 })
//down位置处的动画
EleMaskAni(ele, downPos, wait, this.elementContainer);
EleMaskAni(ele, downPos, wait, this.elementContainer, false, deltaTime);
} else {
tween.to({ x: upPos[0], y: upPos[1] + Tool.height }, deltaTime);
EleDownAni(ele, downPos, wait, this.elementContainer, false, deltaTime)
}
//修改oriRow
oriRow = Tool.indexToRc(index)[0];
lastX = downPos[0];
lastY = downPos[1];
wait += deltaTime;
} else {
//算间隔
var delta = Tool.indexToRc(index)[0] - oriRow;
......
......@@ -70,7 +70,8 @@ export default class Turntable extends Panel {
// this.setBtnTouch(false); // 锁定按钮
// Loading.instace.show();
// GDispatcher.dispatchEvent('queryPrize');
PanelCtrl.instance.show('TurnPrizePanel');
//1换个姿势再来一次2 奖励溜走了3 离奖励只差一毫米
PanelCtrl.instance.show('TurnPrize2Panel');
}
// 设置全部按钮是否可以点击
......
......@@ -11,7 +11,9 @@ export default class TurntableNoPrizePanel extends Panel {
super.start();
this.showlog();
addAdComp(84, 788, this);
addAdComp(84, 635, this);
if (this['tips' + data.type])
this['tips' + data.type].visible = true;
}
showlog() {
......@@ -31,7 +33,7 @@ export default class TurntableNoPrizePanel extends Panel {
console.log('再来一次');
loadSvga(getResPath() + 'resource/assets/svgas/turntable.svga').then(async (mv: any) => {
// await wait(100);
PanelCtrl.instance.show('turnTable', { onceAgain: 1,mv:mv });
PanelCtrl.instance.show('turnTable', { onceAgain: 1, mv: mv });
})
}
onTap_btn2() {
......
import Panel from "../../../libs/new_wx/components/Panel";
import { addAdComp } from "../BoxPanel";
import { gotoNextLevel } from "../gotoNextLevel";
import PanelCtrl from "../../../libs/new_wx/ctrls/panelCtrl";
import { loadSvga } from "../../loadSvga";
import getResPath from "../../../libs/new_tc/getResPath";
export default class TurnPrize2Panel extends Panel {
start(data) {
super.start();
this.showlog();
this.data.url = "http://yun.duiba.com.cn/db_games/1022/111.png";
addAdComp(84, 788, this);
}
showlog() {
// NetManager.ins.showLog(getlogItem(3));
// NetManager.ins.showLog(getlogItem(4));
}
initEvents() {
super.initEvents();
this['btn1'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_btn1, this)
this['btn2'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_btn2, this)
}
onTap_btn1() {//再来一次
//if 有免费次数或积分充足
//else show toast
console.log('再来一次');
loadSvga(getResPath() + 'resource/assets/svgas/turntable.svga').then(async (mv: any) => {
// await wait(100);
PanelCtrl.instance.show('turnTable', { onceAgain: 1,mv:mv });
})
}
onTap_btn2() {
gotoNextLevel()
}
protected get closeBtns(): eui.Button[] { return [this['closeBtn']] }
get skinKey() { return 'TurntablePrize2' }
}
\ No newline at end of file
......@@ -14,9 +14,16 @@ import { StateType } from "./enum/StateType";
export class Tool {
/**
* 每格掉落时间
* 掉落速度这个定
*/
public static latDeltaTime:number = 90;
/**
* 总行数
*/
public static latDeltaTime = 90;
public static rowNum = 9;
/**
* 总列数
*/
public static colNum = 9;
/**
* 格子宽度
......
import { Tool } from "../Tool";
import { ElementType } from "../enum/ElementType";
import { EffectType } from "../enum/EffectType";
import { Element } from "../class/Element";
import { Pool } from "../Pool";
import { RecoverName } from "../enum/RecoverName";
/**
* 元素向下的动画
* 没有遮罩
* @param eleC
* @param p
* @param con
* @param callback
*/
export function EleDownAni(
eleC: Element,
p: number[],
wait: number,
con: egret.DisplayObjectContainer,
isUp: boolean = false,
deltaTime:number,
callback?: Function
) {
let ele = Tool.getElement(eleC.type);
ele.effectType = eleC.effectType;
ele.x = p[0];
ele.y = p[1] - Tool.height * (isUp ? 0 : 1);
egret.Tween.get(ele)
.wait(wait)
.call(()=>{
con.addChild(ele);
})
.to({ x: p[0], y: p[1] + Tool.height * (isUp ? 1 : 0) }, deltaTime)
.call(() => {
//回收元素
con.removeChild(ele);
Pool.recover(RecoverName.ELEMENT, ele);
//回调
callback && callback();
})
}
\ No newline at end of file
......@@ -18,6 +18,7 @@ export function EleMaskAni(
wait: number,
con: egret.DisplayObjectContainer,
isUp: boolean = false,
deltaTime:number,
callback?: Function
) {
let ele = Tool.getElement(eleC.type);
......@@ -37,7 +38,7 @@ export function EleMaskAni(
.call(()=>{
con.addChild(ele);
})
.to({ x: p[0], y: p[1] + Tool.height * (isUp ? 1 : 0) }, Tool.latDeltaTime)
.to({ x: p[0], y: p[1] + Tool.height * (isUp ? 1 : 0) }, deltaTime)
.call(() => {
//回收元素
con.removeChild(ele);
......
import { Ani } from "../class/Ani";
import { ImageAni } from "../class/ImageAni";
import { ElementType } from "../enum/ElementType";
//原点已是中心
export class IceAni extends Ani {
......@@ -10,7 +11,7 @@ export class IceAni extends Ani {
constructor() {
super();
this.aniName = "IceAni";
this.showImage = new ImageAni(["ele7_png", "ice2_png", "ice3_png", "ice4_png", "ice5_png", "ice6_png"]);
this.showImage = new ImageAni(["ele" + ElementType.ICE + "_png", "ice2_png", "ice3_png", "ice4_png", "ice5_png", "ice6_png"]);
this.addChild(this.showImage)
}
......
......@@ -3,6 +3,7 @@ import { Pool } from "../Pool";
import { RecoverName } from "../enum/RecoverName";
import { playSound, SoundType } from "../../soundCtrl";
import { Tool } from "../Tool";
import { ElementType } from "../enum/ElementType";
const offsetX = 91 / 2;
const offsetY = 62 / 2;
......@@ -20,7 +21,7 @@ export class PieceToEggAni extends egret.DisplayObjectContainer {
eggPiece5: egret.Bitmap;
constructor() {
super()
var arr = ["ele9_png", "eggPiece1_png", "eggPiece2_png", "eggPiece3_png", "eggPiece4_png", "eggPiece5_png"];
var arr = ["ele" + ElementType.CHICKEN_EGG + "_png", "eggPiece1_png", "eggPiece2_png", "eggPiece3_png", "eggPiece4_png", "eggPiece5_png"];
var objs = ["showImage", "eggPiece1", "eggPiece2", "eggPiece3", "eggPiece4", "eggPiece5"];
for (var i = 0; i < arr.length; i++) {
......
import { Ani } from "../class/Ani";
import { ImageAni } from "../class/ImageAni";
import { ElementType } from "../enum/ElementType";
//原点已是中心
export class RockAni extends Ani {
......@@ -10,7 +11,7 @@ export class RockAni extends Ani {
constructor() {
super();
this.aniName = "RockAni";
this.showImage = new ImageAni(["ele5_png", "rock2_png", "rock3_png", "rock4_png", "rock5_png", "rock6_png"]);
this.showImage = new ImageAni(["ele" + ElementType.ROCK + "_png", "rock2_png", "rock3_png", "rock4_png", "rock5_png", "rock6_png"]);
this.addChild(this.showImage)
}
......
import { ElementType } from "../enum/ElementType";
//四种状态的图片
const images = {
3: "ele9_png",
3: "ele"+ElementType.CHICKEN_EGG+"_png",
2: "eggStatus2_png",
1: "eggStatus1_png",
0: "eggStatus0_png"
......
......@@ -161,7 +161,7 @@ export class Element extends eui.Component {
this.showImage.y = -texture.textureHeight / 2;
//特殊逻辑,因为魔力鸟动效要旋转,所以隐藏原图showImage,还有鸡蛋
if (source == "magicLion_png" || source == "ele9_png") {
if (source == "magicLion_png" || source == "ele" + ElementType.CHICKEN_EGG + "_png") {
this.showImage.alpha = 0;
} else {
this.showImage.alpha = 1;
......
......@@ -54,7 +54,8 @@ export const submitTran = {
4: 8,
5: 9,
6: 3,
7: 2,
9: 2,
10: 10
}
// SCORE(1, "分数"),
......@@ -66,3 +67,4 @@ export const submitTran = {
// LION(7, "狮子"),
// PIG(8, "猪"),
// STONE(9, "石头")
// GREYBALL(10, "灰色")
/**
* 掉落元素类型
* 没用了
*/
export enum FallEleType {
RANELE = 0,//随机元素无特效
RANEFF,//随机元素加随机特效
RABBIT,//兔子 下面的顺序和ElementType前5保持一致,不要随便修改
CHICKEN,//鸡
CATTLE,//牛
LION,//狮子
PIG,//猪
}
\ 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