Commit fb9d829a authored by 邱旭's avatar 邱旭

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

parents 7bd2d8c8 d2fe0438
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<body> <body>
<div style="margin: auto;width: 100%;height: 100%;" class="egret-player" data-entry-class="Main" <div style="margin: auto;width: 100%;height: 100%;" class="egret-player" data-entry-class="Main"
data-orientation="auto" data-scale-mode="showAll" data-frame-rate="60" data-content-width="750" data-orientation="auto" data-scale-mode="showAll" data-frame-rate="60" data-content-width="750"
data-content-height="1624" data-multi-fingered="2" data-show-fps="true" data-show-log="false" data-content-height="1624" data-multi-fingered="2" data-show-fps="false" data-show-log="false"
data-show-fps-style="x:0,y:0,size:12,textColor:0xffffff,bgAlpha:0.9"> data-show-fps-style="x:0,y:0,size:12,textColor:0xffffff,bgAlpha:0.9">
</div> </div>
...@@ -46,6 +46,8 @@ ...@@ -46,6 +46,8 @@
<script src="libs/svga.egret.min.js"></script> <script src="libs/svga.egret.min.js"></script>
<script src="libs/aes.js"></script> <script src="libs/aes.js"></script>
<script src="libs/pad-zeropadding.js"></script> <script src="libs/pad-zeropadding.js"></script>
<!-- //线上不需要 -->
<script src="libs/fileSave.js"></script>
<img id="pic" style="width:100%;position: absolute;z-index: 999;display: none;" /> <img id="pic" style="width:100%;position: absolute;z-index: 999;display: none;" />
<script> <script>
window['plugs']=[1,2,3] window['plugs']=[1,2,3]
......
/*
* FileSaver.js
* A saveAs() FileSaver implementation.
*
* By Eli Grey, http://eligrey.com
*
* License : https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md (MIT)
* source : http://purl.eligrey.com/github/FileSaver.js
*/
// The one and only way of getting global scope in all environments
// https://stackoverflow.com/q/3277182/1008999
var _global = typeof window === 'object' && window.window === window
? window : typeof self === 'object' && self.self === self
? self : typeof global === 'object' && global.global === global
? global
: this
function bom (blob, opts) {
if (typeof opts === 'undefined') opts = { autoBom: false }
else if (typeof opts !== 'object') {
console.warn('Deprecated: Expected third argument to be a object')
opts = { autoBom: !opts }
}
// prepend BOM for UTF-8 XML and text/* types (including HTML)
// note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF
if (opts.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) {
return new Blob([String.fromCharCode(0xFEFF), blob], { type: blob.type })
}
return blob
}
function download (url, name, opts) {
var xhr = new XMLHttpRequest()
xhr.open('GET', url)
xhr.responseType = 'blob'
xhr.onload = function () {
saveAs(xhr.response, name, opts)
}
xhr.onerror = function () {
console.error('could not download file')
}
xhr.send()
}
function corsEnabled (url) {
var xhr = new XMLHttpRequest()
// use sync to avoid popup blocker
xhr.open('HEAD', url, false)
try {
xhr.send()
} catch (e) {}
return xhr.status >= 200 && xhr.status <= 299
}
// `a.click()` doesn't work for all browsers (#465)
function click (node) {
try {
node.dispatchEvent(new MouseEvent('click'))
} catch (e) {
var evt = document.createEvent('MouseEvents')
evt.initMouseEvent('click', true, true, window, 0, 0, 0, 80,
20, false, false, false, false, 0, null)
node.dispatchEvent(evt)
}
}
var saveAs = _global.saveAs || (
// probably in some web worker
(typeof window !== 'object' || window !== _global)
? function saveAs () { /* noop */ }
// Use download attribute first if possible (#193 Lumia mobile)
: 'download' in HTMLAnchorElement.prototype
? function saveAs (blob, name, opts) {
var URL = _global.URL || _global.webkitURL
var a = document.createElement('a')
name = name || blob.name || 'download'
a.download = name
a.rel = 'noopener' // tabnabbing
// TODO: detect chrome extensions & packaged apps
// a.target = '_blank'
if (typeof blob === 'string') {
// Support regular links
a.href = blob
if (a.origin !== location.origin) {
corsEnabled(a.href)
? download(blob, name, opts)
: click(a, a.target = '_blank')
} else {
click(a)
}
} else {
// Support blobs
a.href = URL.createObjectURL(blob)
setTimeout(function () { URL.revokeObjectURL(a.href) }, 4E4) // 40s
setTimeout(function () { click(a) }, 0)
}
}
// Use msSaveOrOpenBlob as a second approach
: 'msSaveOrOpenBlob' in navigator
? function saveAs (blob, name, opts) {
name = name || blob.name || 'download'
if (typeof blob === 'string') {
if (corsEnabled(blob)) {
download(blob, name, opts)
} else {
var a = document.createElement('a')
a.href = blob
a.target = '_blank'
setTimeout(function () { click(a) })
}
} else {
navigator.msSaveOrOpenBlob(bom(blob, opts), name)
}
}
// Fallback to using FileReader and a popup
: function saveAs (blob, name, opts, popup) {
// Open a popup immediately do go around popup blocker
// Mostly only available on user interaction and the fileReader is async so...
popup = popup || open('', '_blank')
if (popup) {
popup.document.title =
popup.document.body.innerText = 'downloading...'
}
if (typeof blob === 'string') return download(blob, name, opts)
var force = blob.type === 'application/octet-stream'
var isSafari = /constructor/i.test(_global.HTMLElement) || _global.safari
var isChromeIOS = /CriOS\/[\d]+/.test(navigator.userAgent)
if ((isChromeIOS || (force && isSafari)) && typeof FileReader !== 'undefined') {
// Safari doesn't allow downloading of blob URLs
var reader = new FileReader()
reader.onloadend = function () {
var url = reader.result
url = isChromeIOS ? url : url.replace(/^data:[^;]*;/, 'data:attachment/file;')
if (popup) popup.location.href = url
else location = url
popup = null // reverse-tabnabbing #460
}
reader.readAsDataURL(blob)
} else {
var URL = _global.URL || _global.webkitURL
var url = URL.createObjectURL(blob)
if (popup) popup.location = url
else location.href = url
popup = null // reverse-tabnabbing #460
setTimeout(function () { URL.revokeObjectURL(url) }, 4E4) // 40s
}
}
)
_global.saveAs = saveAs.saveAs = saveAs
if (typeof module !== 'undefined') {
module.exports = saveAs;
}
\ No newline at end of file
...@@ -257,6 +257,11 @@ export default class MainBase extends eui.UILayer { ...@@ -257,6 +257,11 @@ export default class MainBase extends eui.UILayer {
RES.getResAsync("bubbleStar" + i + "_png") RES.getResAsync("bubbleStar" + i + "_png")
} }
var arr = [ var arr = [
"brownBallFace",
"greyBallFace",
"eyeDownLeft",
"eyeDownRight",
"eyeSingle",
"yellowCircleDown", "yellowCircleDown",
"yellowCircleUp", "yellowCircleUp",
"greenCircleDown", "greenCircleDown",
......
...@@ -13,7 +13,7 @@ export default class PanelCtrl { ...@@ -13,7 +13,7 @@ export default class PanelCtrl {
PanelCtrl.instance.show(panel); PanelCtrl.instance.show(panel);
} }
checkPanels(){ checkPanels(){
if(this._panels.length <=0 ) return; if(!this._panels || this._panels.length <=0 ) return;
wait(300); wait(300);
const panel = this._panels.shift(); const panel = this._panels.shift();
PanelCtrl.instance.show(panel); PanelCtrl.instance.show(panel);
......
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
"name": "h5" "name": "h5"
}, },
{ {
"keys": "bonusFra1_png,bonusFra10_png,bonusFra11_png,bonusFra12_png,bonusFra13_png,bonusFra14_png,bonusFra15_png,bonusFra16_png,bonusFra17_png,bonusFra18_png,bonusFra19_png,bonusFra2_png,bonusFra20_png,bonusFra21_png,bonusFra22_png,bonusFra23_png,bonusFra24_png,bonusFra25_png,bonusFra26_png,bonusFra27_png,bonusFra3_png,bonusFra4_png,bonusFra5_png,bonusFra6_png,bonusFra7_png,bonusFra8_png,bonusFra9_png,bonusShoot_png,bonusTime_png,boom1_png,boom10_png,boom11_png,boom12_png,boom13_png,boom14_png,boom15_png,boom16_png,boom17_png,boom18_png,boom2_png,boom3_png,boom4_png,boom5_png,boom6_png,boom7_png,boom8_png,boom9_png,boomBtn_png,chooseRect_png,dangqianfenshu_png,eggPiece1_png,eggPiece2_png,eggPiece3_png,eggPiece4_png,eggPiece5_png,eggStatus0_png,eggStatus1_png,eggStatus2_png,ele0_png,ele0Exp_png,ele0Line_png,ele1_png,ele1Exp_png,ele1Line_png,ele2_png,ele2Exp_png,ele2Line_png,ele3_png,ele3Exp_png,ele3Line_png,ele4_png,ele4Exp_png,ele4Line_png,ele5_png,ele6_png,ele7_png,ele8_png,ele9_png,eleDis1_png,eleDis10_png,eleDis11_png,eleDis12_png,eleDis13_png,eleDis14_png,eleDis15_png,eleDis16_png,eleDis17_png,eleDis18_png,eleDis19_png,eleDis2_png,eleDis3_png,eleDis4_png,eleDis5_png,eleDis6_png,eleDis7_png,eleDis8_png,eleDis9_png,exLighting1_png,exLighting11_png,exLighting14_png,exLighting16_png,exLighting18_png,exLighting19_png,exLighting21_png,exLighting23_png,exLighting25_png,exLighting27_png,exLighting29_png,exLighting3_png,exLighting32_png,exLighting34_png,exLighting5_png,exLighting7_png,exLighting9_png,greenCircleDown_png,greenCircleUp_png,guidePropBoom_png,guidePropCow_png,guidePropHammer_png,guidePropHand_png,guidePropMsgPanel_png,guidePropShoe_png,hammerBtn_png,ice2_png,ice3_png,ice4_png,ice5_png,ice6_png,jellyArrow_png,leftArrow_png,lightedStar_png,lineLight_png,lockVine_png,magicLion_png,magicLionBg_png,mainMusicBtnOff_png,mainMusicBtnOn_png,mainQuestionBtn_png,mainQuitBtn_png,mainSettingBg_png,mainSoundBtnOff_png,mainSoundBtnOn_png,main_mapbottom_png,playSceneBg_jpg,progressDown_png,propNum0_png,propNum1_png,propNum2_png,propNum3_png,propNum4_png,propNum5_png,propNum6_png,propNum7_png,propNum8_png,propNum9_png,propNumBg_png,rectLat_png,rightArrow_png,rightMark_png,rock2_png,rock3_png,rock4_png,rock5_png,rock6_png,scoreNumber0_png,scoreNumber1_png,scoreNumber2_png,scoreNumber3_png,scoreNumber4_png,scoreNumber5_png,scoreNumber6_png,scoreNumber7_png,scoreNumber8_png,scoreNumber9_png,setting_png,starProgress_png,stepAni1_png,stepAni10_png,stepAni11_png,stepAni2_png,stepAni3_png,stepAni4_png,stepAni5_png,stepAni6_png,stepAni7_png,stepAni8_png,stepAni9_png,stepBtn_png,stepNumber0_png,stepNumber1_png,stepNumber2_png,stepNumber3_png,stepNumber4_png,stepNumber5_png,stepNumber6_png,stepNumber7_png,stepNumber8_png,stepNumber9_png,stepsBoard_png,targetBoard_png,targetNumber0_png,targetNumber1_png,targetNumber2_png,targetNumber3_png,targetNumber4_png,targetNumber5_png,targetNumber6_png,targetNumber7_png,targetNumber8_png,targetNumber9_png,unlightedStar_png,yellowCircleDown_png,yellowCircleUp_png,yezi1_png,bubbleStar19_png,bubleEle0_png,bubleEle1_png,bubleEle2_png,bubleEle3_png,bubleEle4_png,bubbleStar1_png,bubbleStar2_png,bubbleStar3_png,bubbleStar4_png,bubbleStar5_png,bubbleStar6_png,bubbleStar7_png,bubbleStar8_png,bubbleStar9_png,bubbleStar10_png,bubbleStar11_png,bubbleStar12_png,bubbleStar13_png,bubbleStar14_png,bubbleStar15_png,bubbleStar16_png,bubbleStar17_png,bubbleStar18_png,ele11_png,ele10_png", "keys": "bonusFra1_png,bonusFra10_png,bonusFra11_png,bonusFra12_png,bonusFra13_png,bonusFra14_png,bonusFra15_png,bonusFra16_png,bonusFra17_png,bonusFra18_png,bonusFra19_png,bonusFra2_png,bonusFra20_png,bonusFra21_png,bonusFra22_png,bonusFra23_png,bonusFra24_png,bonusFra25_png,bonusFra26_png,bonusFra27_png,bonusFra3_png,bonusFra4_png,bonusFra5_png,bonusFra6_png,bonusFra7_png,bonusFra8_png,bonusFra9_png,bonusShoot_png,bonusTime_png,boom1_png,boom10_png,boom11_png,boom12_png,boom13_png,boom14_png,boom15_png,boom16_png,boom17_png,boom18_png,boom2_png,boom3_png,boom4_png,boom5_png,boom6_png,boom7_png,boom8_png,boom9_png,boomBtn_png,chooseRect_png,dangqianfenshu_png,eggPiece1_png,eggPiece2_png,eggPiece3_png,eggPiece4_png,eggPiece5_png,eggStatus0_png,eggStatus1_png,eggStatus2_png,ele0_png,ele0Exp_png,ele0Line_png,ele1_png,ele1Exp_png,ele1Line_png,ele2_png,ele2Exp_png,ele2Line_png,ele3_png,ele3Exp_png,ele3Line_png,ele4_png,ele4Exp_png,ele4Line_png,ele5_png,ele6_png,ele7_png,ele8_png,ele9_png,eleDis1_png,eleDis10_png,eleDis11_png,eleDis12_png,eleDis13_png,eleDis14_png,eleDis15_png,eleDis16_png,eleDis17_png,eleDis18_png,eleDis19_png,eleDis2_png,eleDis3_png,eleDis4_png,eleDis5_png,eleDis6_png,eleDis7_png,eleDis8_png,eleDis9_png,exLighting1_png,exLighting11_png,exLighting14_png,exLighting16_png,exLighting18_png,exLighting19_png,exLighting21_png,exLighting23_png,exLighting25_png,exLighting27_png,exLighting29_png,exLighting3_png,exLighting32_png,exLighting34_png,exLighting5_png,exLighting7_png,exLighting9_png,greenCircleDown_png,greenCircleUp_png,guidePropBoom_png,guidePropCow_png,guidePropHammer_png,guidePropHand_png,guidePropMsgPanel_png,guidePropShoe_png,hammerBtn_png,ice2_png,ice3_png,ice4_png,ice5_png,ice6_png,jellyArrow_png,leftArrow_png,lightedStar_png,lineLight_png,lockVine_png,magicLion_png,magicLionBg_png,mainMusicBtnOff_png,mainMusicBtnOn_png,mainQuestionBtn_png,mainQuitBtn_png,mainSettingBg_png,mainSoundBtnOff_png,mainSoundBtnOn_png,main_mapbottom_png,playSceneBg_jpg,progressDown_png,propNum0_png,propNum1_png,propNum2_png,propNum3_png,propNum4_png,propNum5_png,propNum6_png,propNum7_png,propNum8_png,propNum9_png,propNumBg_png,rectLat_png,rightArrow_png,rightMark_png,rock2_png,rock3_png,rock4_png,rock5_png,rock6_png,scoreNumber0_png,scoreNumber1_png,scoreNumber2_png,scoreNumber3_png,scoreNumber4_png,scoreNumber5_png,scoreNumber6_png,scoreNumber7_png,scoreNumber8_png,scoreNumber9_png,setting_png,starProgress_png,stepAni1_png,stepAni10_png,stepAni11_png,stepAni2_png,stepAni3_png,stepAni4_png,stepAni5_png,stepAni6_png,stepAni7_png,stepAni8_png,stepAni9_png,stepBtn_png,stepNumber0_png,stepNumber1_png,stepNumber2_png,stepNumber3_png,stepNumber4_png,stepNumber5_png,stepNumber6_png,stepNumber7_png,stepNumber8_png,stepNumber9_png,stepsBoard_png,targetBoard_png,targetNumber0_png,targetNumber1_png,targetNumber2_png,targetNumber3_png,targetNumber4_png,targetNumber5_png,targetNumber6_png,targetNumber7_png,targetNumber8_png,targetNumber9_png,unlightedStar_png,yellowCircleDown_png,yellowCircleUp_png,yezi1_png,bubbleStar19_png,bubleEle0_png,bubleEle1_png,bubleEle2_png,bubleEle3_png,bubleEle4_png,bubbleStar1_png,bubbleStar2_png,bubbleStar3_png,bubbleStar4_png,bubbleStar5_png,bubbleStar6_png,bubbleStar7_png,bubbleStar8_png,bubbleStar9_png,bubbleStar10_png,bubbleStar11_png,bubbleStar12_png,bubbleStar13_png,bubbleStar14_png,bubbleStar15_png,bubbleStar16_png,bubbleStar17_png,bubbleStar18_png,ele11_png,ele10_png,brownBallFace_png,eyeDownLeft_png,eyeSingle_png,greyBallFace_png,eyeDownRight_png",
"name": "main2" "name": "main2"
}, },
{ {
...@@ -2822,6 +2822,31 @@ ...@@ -2822,6 +2822,31 @@
"url": "assets/blood2/blood2去分享按钮.png", "url": "assets/blood2/blood2去分享按钮.png",
"type": "image", "type": "image",
"name": "blood2去分享按钮_png" "name": "blood2去分享按钮_png"
},
{
"url": "assets/mainScene/eyeSingle.png",
"type": "image",
"name": "eyeSingle_png"
},
{
"url": "assets/mainScene/brownBallFace.png",
"type": "image",
"name": "brownBallFace_png"
},
{
"url": "assets/mainScene/greyBallFace.png",
"type": "image",
"name": "greyBallFace_png"
},
{
"url": "assets/mainScene/eyeDownLeft.png",
"type": "image",
"name": "eyeDownLeft_png"
},
{
"url": "assets/mainScene/eyeDownRight.png",
"type": "image",
"name": "eyeDownRight_png"
} }
] ]
} }
\ No newline at end of file
...@@ -67,10 +67,10 @@ export class GameGuide extends egret.DisplayObjectContainer { ...@@ -67,10 +67,10 @@ export class GameGuide extends egret.DisplayObjectContainer {
var p1 = Tool.getPositionByIndex(handIndexs[0]); var p1 = Tool.getPositionByIndex(handIndexs[0]);
var p2 = Tool.getPositionByIndex(handIndexs[1]); var p2 = Tool.getPositionByIndex(handIndexs[1]);
this.msg.y = Math.max(p1[1], p2[1]) + 135; this.msg.y = Math.max(p1[1], p2[1]) + 135;
//定制修改,魔力鸟第九关第一步时 //定制修改,101关毛球引导,
// if (this.thisObj.chapter == 9 && step == 0) { if (this.thisObj.chapter == 101 && step == 0) {
// this.msg.y += 80; this.msg.y += 80;
// } }
this.stepCount--; this.stepCount--;
} }
...@@ -324,6 +324,22 @@ const chapterFuns = { ...@@ -324,6 +324,22 @@ const chapterFuns = {
"小心!会蔓延的果冻!\n消除果冻旁边的动物\n就能消除果冻~" "小心!会蔓延的果冻!\n消除果冻旁边的动物\n就能消除果冻~"
] ]
}, },
//灰毛球
101: {
stepCount: 1,
showIndexs: [
[13, 22, 21, 23, 31, 40],
],
hideIndexs: [
[21, 23, 31, 40],
],
handIndexs: [
[13, 22]
],
msg: [
"灰毛球每步会随机选择\n相邻的格子跳动~\n移动一步试试吧"
]
}
} }
/** /**
......
...@@ -534,12 +534,13 @@ export default class MainScene extends Scene { ...@@ -534,12 +534,13 @@ export default class MainScene extends Scene {
case 0: case 0:
this.emptys.push(i); this.emptys.push(i);
break; break;
//基础元素,枷锁,一级毛球,二级毛球 //基础元素,枷锁,气泡,灰色毛球,褐色毛球,黑色毛球
case 1: case 1:
case 4: case 4:
case 7: case 7:
case 8: case 8:
case 9: case 9:
case 10:
var type = Tool.returnType(i, this.lattices, this.chapterData.baseElementTypes); var type = Tool.returnType(i, this.lattices, this.chapterData.baseElementTypes);
let ele: Element = Pool.takeOut(RecoverName.ELEMENT); let ele: Element = Pool.takeOut(RecoverName.ELEMENT);
if (!ele) { if (!ele) {
...@@ -554,16 +555,24 @@ export default class MainScene extends Scene { ...@@ -554,16 +555,24 @@ export default class MainScene extends Scene {
if (elements[i] == 4) { if (elements[i] == 4) {
ele.setState(StateType.LOCK, true) ele.setState(StateType.LOCK, true)
} }
//气泡
else if (elements[i] == 7) { else if (elements[i] == 7) {
//气泡要设定type //气泡要设定type
ele.setState(StateType.BUBBLE, true, type) ele.setState(StateType.BUBBLE, true, type)
} }
//灰色毛球
else if (elements[i] == 8) { else if (elements[i] == 8) {
ele.setState(StateType.BUBBLE, true, 1) ele.setState(StateType.HAIRBALLGREY, true)
} }
//褐色毛球
else if (elements[i] == 9) { else if (elements[i] == 9) {
ele.setState(StateType.BUBBLE, true, 2) ele.setState(StateType.HAIRBALLBROWN, true)
} }
//黑色毛球
else if (elements[i] == 10) {
ele.setState(StateType.HAIRBALLBLACK, true)
}
break; break;
//棒棒糖 //棒棒糖
case 3: case 3:
...@@ -642,7 +651,7 @@ export default class MainScene extends Scene { ...@@ -642,7 +651,7 @@ export default class MainScene extends Scene {
//初始化引导,游戏和道具 //初始化引导,游戏和道具
initGuide() { initGuide() {
//游戏引导 //游戏引导
const gameGuideChapterNum = [1, 2, 3, 5, 8, 9, 10, 12, 17, 25, 41] const gameGuideChapterNum = [1, 2, 3, 5, 8, 9, 10, 12, 17, 25, 41,101]
if (gameGuideChapterNum.indexOf(this.chapter >> 0) > -1) { if (gameGuideChapterNum.indexOf(this.chapter >> 0) > -1) {
if (!readCache(getCacheKey() + this.chapter)) { if (!readCache(getCacheKey() + this.chapter)) {
this.gameGuide = new GameGuide(this); this.gameGuide = new GameGuide(this);
...@@ -1505,8 +1514,9 @@ export default class MainScene extends Scene { ...@@ -1505,8 +1514,9 @@ export default class MainScene extends Scene {
let ele = Tool.getElement(type); let ele = Tool.getElement(type);
//如果未通关,有特效的话可以加 //如果未通关,有特效的话可以加
if (!this.hasPassed) ele.effectType = effectType; if (!this.hasPassed) ele.effectType = effectType;
//没有特效的时候,考虑加气泡 //不是棒棒糖,且没有特效的时候,考虑加气泡
if (effectType == null && if (type != ElementType.LOLLIPOP &&
effectType == null &&
this.chapterData.bubbleProbability && this.chapterData.bubbleProbability &&
Math.random() < this.chapterData.bubbleProbability) { Math.random() < this.chapterData.bubbleProbability) {
ele.setState(StateType.BUBBLE, true, type) ele.setState(StateType.BUBBLE, true, type)
......
import ComponentBase from "../../libs/new_wx/components/ComponentBase"; import ComponentBase from "../../libs/new_wx/components/ComponentBase";
import { NetManager } from "../../libs/tw/manager/NetManager"; import { NetManager } from "../../libs/tw/manager/NetManager";
import { DataManager } from "../../libs/tw/manager/DataManager"; import { DataManager } from "../../libs/tw/manager/DataManager";
import { getlogItem } from "../Main";
import wait from "../../libs/new_tc/wait";
export default class AdSmallComp extends ComponentBase { export default class AdSmallComp extends ComponentBase {
...@@ -26,7 +28,11 @@ export default class AdSmallComp extends ComponentBase { ...@@ -26,7 +28,11 @@ export default class AdSmallComp extends ComponentBase {
}); });
this['img'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => { this['img'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
if(data.logid)
NetManager.ins.showLog(getlogItem(data.logid));
wait(50).then(()=>{
window.location.href = result.url; window.location.href = result.url;
});
}, this); }, this);
} }
......
...@@ -58,6 +58,7 @@ export default class MapScene extends Scene { ...@@ -58,6 +58,7 @@ export default class MapScene extends Scene {
} }
if(!success) { return; } if(!success) { return; }
showToast("助力成功"); showToast("助力成功");
NetManager.ins.showLog(getlogItem(36));
}; };
if(code.indexOf("12345678") == -1){ // 邀请有礼 if(code.indexOf("12345678") == -1){ // 邀请有礼
NetManager.ins.doHelp(callBack, code, dojoin.data); NetManager.ins.doHelp(callBack, code, dojoin.data);
...@@ -290,6 +291,9 @@ export default class MapScene extends Scene { ...@@ -290,6 +291,9 @@ export default class MapScene extends Scene {
if(mapAdvert == null) if(mapAdvert == null)
mapAdvert = {enable: false, advertList: []} mapAdvert = {enable: false, advertList: []}
this['adBtn'].visible = mapAdvert.enable; this['adBtn'].visible = mapAdvert.enable;
if(this['adBtn']) {
NetManager.ins.showLog(getlogItem(32));
}
if(mapAdvert.enable) { if(mapAdvert.enable) {
let result; let result;
result = mapAdvert.advertList; result = mapAdvert.advertList;
...@@ -299,6 +303,7 @@ export default class MapScene extends Scene { ...@@ -299,6 +303,7 @@ export default class MapScene extends Scene {
} }
this['adBtn'].source = result.img; this['adBtn'].source = result.img;
this['adBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => { this['adBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(32));
window.location.href = result.url; window.location.href = result.url;
}, this); }, this);
} }
...@@ -479,6 +484,7 @@ export default class MapScene extends Scene { ...@@ -479,6 +484,7 @@ export default class MapScene extends Scene {
} }
onTap_inviteBtn() { onTap_inviteBtn() {
NetManager.ins.clickLog(getlogItem(33));
NetManager.ins.getInviteInfo((success, res) => { NetManager.ins.getInviteInfo((success, res) => {
if(!success || !res.data) { if(!success || !res.data) {
return; return;
...@@ -567,6 +573,7 @@ export default class MapScene extends Scene { ...@@ -567,6 +573,7 @@ export default class MapScene extends Scene {
switch(true) { switch(true) {
case (flag == 0): // 未完成 显示倒计时 case (flag == 0): // 未完成 显示倒计时
this["inviteGroup"].visible = true; this["inviteGroup"].visible = true;
NetManager.ins.showLog(getlogItem(33));
this["inviteTipsBg"].visible = true; this["inviteTipsBg"].visible = true;
this["inviteTips"].visible = true; this["inviteTips"].visible = true;
this.cutTime = res.data.endTime - res.data.sysTime + 5000; this.cutTime = res.data.endTime - res.data.sysTime + 5000;
...@@ -576,6 +583,7 @@ export default class MapScene extends Scene { ...@@ -576,6 +583,7 @@ export default class MapScene extends Scene {
this.inviteCutTimer(); this.inviteCutTimer();
break; break;
case (flag == 1): // 完成未开奖 待领奖 显示待领奖 case (flag == 1): // 完成未开奖 待领奖 显示待领奖
NetManager.ins.showLog(getlogItem(33));
this["inviteGroup"].visible = true; this["inviteGroup"].visible = true;
this["inviteTipsBg"].visible = true; this["inviteTipsBg"].visible = true;
this["inviteTips"].visible = true; this["inviteTips"].visible = true;
...@@ -584,17 +592,20 @@ export default class MapScene extends Scene { ...@@ -584,17 +592,20 @@ export default class MapScene extends Scene {
case (flag == 2): // 领奖成功 无角标 case (flag == 2): // 领奖成功 无角标
case (flag == 3): // 领奖失败 无角标 case (flag == 3): // 领奖失败 无角标
this["inviteGroup"].visible = true; this["inviteGroup"].visible = true;
NetManager.ins.showLog(getlogItem(33));
this["inviteTipsBg"].visible = false; this["inviteTipsBg"].visible = false;
this["inviteTips"].visible = false; this["inviteTips"].visible = false;
break; break;
case (flag == 4): // 可以开启下一次发任务 显示立即到账 case (flag == 4): // 可以开启下一次发任务 显示立即到账
this["inviteGroup"].visible = true; this["inviteGroup"].visible = true;
NetManager.ins.showLog(getlogItem(33));
this["inviteTipsBg"].visible = true; this["inviteTipsBg"].visible = true;
this["inviteTips"].visible = true; this["inviteTips"].visible = true;
this["inviteTips"].text = "立即到账"; this["inviteTips"].text = "立即到账";
break; break;
case (flag == 5): // 等待开启下一次发任务 无角标 case (flag == 5): // 等待开启下一次发任务 无角标
this["inviteGroup"].visible = true; this["inviteGroup"].visible = true;
NetManager.ins.showLog(getlogItem(33));
this["inviteTipsBg"].visible = false; this["inviteTipsBg"].visible = false;
this["inviteTips"].visible = false; this["inviteTips"].visible = false;
break; break;
......
...@@ -5,6 +5,7 @@ import { loadSvga } from "../../loadSvga"; ...@@ -5,6 +5,7 @@ import { loadSvga } from "../../loadSvga";
import getResPath from "../../../libs/new_tc/getResPath"; import getResPath from "../../../libs/new_tc/getResPath";
import getHomeData from "../../getHomeData"; import getHomeData from "../../getHomeData";
import { GDispatcher } from "../../../libs/tc/util/GDispatcher"; import { GDispatcher } from "../../../libs/tc/util/GDispatcher";
import { getlogItem } from "../../Main";
// import { loadTurntableSvga } from "../../panels/TurntablePanel/Turntable"; // import { loadTurntableSvga } from "../../panels/TurntablePanel/Turntable";
export default class TurntableIcon extends IconBase { export default class TurntableIcon extends IconBase {
...@@ -14,7 +15,7 @@ export default class TurntableIcon extends IconBase { ...@@ -14,7 +15,7 @@ export default class TurntableIcon extends IconBase {
protected start() { protected start() {
super.start(); super.start();
NetManager.ins.showLog(getlogItem(43));
//有免费次数 //有免费次数
//没有免费次数 //没有免费次数
//如果元宝足够 //如果元宝足够
...@@ -22,6 +23,7 @@ export default class TurntableIcon extends IconBase { ...@@ -22,6 +23,7 @@ export default class TurntableIcon extends IconBase {
} }
updateIcon(){ updateIcon(){
NetManager.ins.clickLog(getlogItem(43));
NetManager.ins.hc_turnableBaseInfo((success, res)=>{ NetManager.ins.hc_turnableBaseInfo((success, res)=>{
if(!success){ if(!success){
return; return;
......
import Panel from "../../libs/new_wx/components/Panel"; import Panel from "../../libs/new_wx/components/Panel";
import { NetManager } from "../../libs/tw/manager/NetManager"; import { NetManager } from "../../libs/tw/manager/NetManager";
import { DataManager } from "../../libs/tw/manager/DataManager"; import { DataManager } from "../../libs/tw/manager/DataManager";
import { getlogItem } from "../Main";
export default class ADPanel extends Panel { export default class ADPanel extends Panel {
start(data) { start(data) {
...@@ -27,7 +28,7 @@ export default class ADPanel extends Panel { ...@@ -27,7 +28,7 @@ export default class ADPanel extends Panel {
} }
showlog() { showlog() {
// NetManager.ins.showLog(getlogItem(3)); NetManager.ins.showLog(getlogItem(25));
// NetManager.ins.showLog(getlogItem(4)); // NetManager.ins.showLog(getlogItem(4));
} }
...@@ -36,6 +37,11 @@ export default class ADPanel extends Panel { ...@@ -36,6 +37,11 @@ export default class ADPanel extends Panel {
// this['inviteBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapInvite, this) // this['inviteBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapInvite, this)
} }
onTouchTap_closeBtn(){
super.onTouchTap_closeBtn();
NetManager.ins.clickLog(getlogItem(25));
}
onTapInvite() { onTapInvite() {
} }
......
...@@ -2,15 +2,17 @@ import Panel from "../../libs/new_wx/components/Panel"; ...@@ -2,15 +2,17 @@ import Panel from "../../libs/new_wx/components/Panel";
import { addAdComp } from "./BoxPanel"; import { addAdComp } from "./BoxPanel";
import { gotoNextLevel } from "./gotoNextLevel"; import { gotoNextLevel } from "./gotoNextLevel";
import { DataManager } from "../../libs/tw/manager/DataManager"; import { DataManager } from "../../libs/tw/manager/DataManager";
import { NetManager } from "../../libs/tw/manager/NetManager";
import { getlogItem } from "../Main";
export default class BackPanel extends Panel { export default class BackPanel extends Panel {
start(data) { start(data) {
super.start(); super.start();
this.showlog(); this.showlog();
addAdComp(84, 806.52, this) addAdComp(84, 806.52, this,56)
const backData = DataManager.ins.getData('hc_getBackReward'); const backData = DataManager.ins.getData('hc_getBackReward');
this.updateOption(backData.data); this.updateOption(backData.data);
NetManager.ins.showLog(getlogItem(56));
backData.data =null; backData.data =null;
} }
......
...@@ -6,6 +6,7 @@ import { getPropNums } from "../getHomeData"; ...@@ -6,6 +6,7 @@ import { getPropNums } from "../getHomeData";
import PropType from "../PropType"; import PropType from "../PropType";
import { NetManager } from "../../libs/tw/manager/NetManager"; import { NetManager } from "../../libs/tw/manager/NetManager";
import { DataManager } from "../../libs/tw/manager/DataManager"; import { DataManager } from "../../libs/tw/manager/DataManager";
import { getlogItem } from "../Main";
const getorigins = () => { const getorigins = () => {
// const pre = CFG.actId + '00'; // const pre = CFG.actId + '00';
...@@ -31,12 +32,14 @@ export default class BagPanel extends Panel { ...@@ -31,12 +32,14 @@ export default class BagPanel extends Panel {
this['btn2'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => { this['btn2'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
this['group1'].visible = true; this['group1'].visible = true;
this['group2'].visible = false; this['group2'].visible = false;
NetManager.ins.clickLog(getlogItem(39));
}, this); }, this);
this['recordbtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => { this['recordbtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
window.location.href = window['__link__']; window.location.href = window['__link__'];
}, this); }, this);
this['shopbtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => { this['shopbtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
PanelCtrl.instance.show('Shop') PanelCtrl.instance.show('Shop');
NetManager.ins.showLog(getlogItem(39));
}, this); }, this);
this.list.itemRenderer=BagItemRenderer; this.list.itemRenderer=BagItemRenderer;
......
...@@ -4,6 +4,8 @@ import BagItemRenderer from "./bag/BagItemRenderer"; ...@@ -4,6 +4,8 @@ import BagItemRenderer from "./bag/BagItemRenderer";
import BagIte2mRenderer from "./bag/BagItemRenderer2"; import BagIte2mRenderer from "./bag/BagItemRenderer2";
import { getPropNums } from "../getHomeData"; import { getPropNums } from "../getHomeData";
import PropType from "../PropType"; import PropType from "../PropType";
import { NetManager } from "../../libs/tw/manager/NetManager";
import { getlogItem } from "../Main";
export default class BagQuitPanel extends Panel { export default class BagQuitPanel extends Panel {
panel: string panel: string
...@@ -15,7 +17,7 @@ export default class BagQuitPanel extends Panel { ...@@ -15,7 +17,7 @@ export default class BagQuitPanel extends Panel {
showlog() { showlog() {
// NetManager.ins.showLog(getlogItem(3)); // NetManager.ins.showLog(getlogItem(3));
// NetManager.ins.showLog(getlogItem(4)); NetManager.ins.showLog(getlogItem(42));
} }
initEvents() { initEvents() {
...@@ -25,6 +27,7 @@ export default class BagQuitPanel extends Panel { ...@@ -25,6 +27,7 @@ export default class BagQuitPanel extends Panel {
onresumebtn() { onresumebtn() {
PanelCtrl.instance.show(this.panel) PanelCtrl.instance.show(this.panel)
NetManager.ins.clickLog(getlogItem(42));
} }
protected get closeBtns(): eui.Button[] { return [this['closeBtn'], this['quitbtn']] } protected get closeBtns(): eui.Button[] { return [this['closeBtn'], this['quitbtn']] }
......
...@@ -27,6 +27,7 @@ export default class BloodPanel extends Panel { ...@@ -27,6 +27,7 @@ export default class BloodPanel extends Panel {
showlog(){ showlog(){
NetManager.ins.showLog(getlogItem(3)); NetManager.ins.showLog(getlogItem(3));
NetManager.ins.showLog(getlogItem(4)); NetManager.ins.showLog(getlogItem(4));
NetManager.ins.showLog(getlogItem(30));
} }
private _countDown:CountDown; private _countDown:CountDown;
...@@ -65,7 +66,7 @@ export default class BloodPanel extends Panel { ...@@ -65,7 +66,7 @@ export default class BloodPanel extends Panel {
} }
onTapBuy() { onTapBuy() {
NetManager.ins.clickLog(getlogItem(3)); NetManager.ins.clickLog(getlogItem(30));
this['buyBtn'].enabled = false; this['buyBtn'].enabled = false;
NetManager.ins.hc_exchange((success) => { NetManager.ins.hc_exchange((success) => {
this['buyBtn'].enabled = true; this['buyBtn'].enabled = true;
......
import Panel from "../../libs/new_wx/components/Panel"; import Panel from "../../libs/new_wx/components/Panel";
import { addAdComp } from "./BoxPanel"; import { addAdComp } from "./BoxPanel";
import { NetManager } from "../../libs/tw/manager/NetManager";
import { getlogItem } from "../Main";
export default class Box2Panel extends Panel { export default class Box2Panel extends Panel {
start(data) { start(data) {
super.start(); super.start();
...@@ -7,13 +9,13 @@ export default class Box2Panel extends Panel { ...@@ -7,13 +9,13 @@ export default class Box2Panel extends Panel {
// NetManager.ins.clickLog(getlogItem(17)); // NetManager.ins.clickLog(getlogItem(17));
// }, this); // }, this);
// this.showlog(); this.showlog();
// this.data.img = DataManager.ins.getData('getPlugOrderStatus').lottery.imgurl; // this.data.img = DataManager.ins.getData('getPlugOrderStatus').lottery.imgurl;
addAdComp(84,739,this) addAdComp(84,739,this,27)
}
showlog() {
NetManager.ins.showLog(getlogItem(27));
} }
// showlog() {
// NetManager.ins.showLog(getlogItem(17));
// }
protected get closeBtns(): eui.Button[] { return [this['closeBtn'],this['close2Btn']] } protected get closeBtns(): eui.Button[] { return [this['closeBtn'],this['close2Btn']] }
get skinKey() { return 'Box2' } get skinKey() { return 'Box2' }
} }
\ No newline at end of file
...@@ -17,19 +17,20 @@ export default class BoxPanel extends Panel { ...@@ -17,19 +17,20 @@ export default class BoxPanel extends Panel {
const itemid = DataManager.ins.getData('getPlugOrderStatus').lottery.itemId; const itemid = DataManager.ins.getData('getPlugOrderStatus').lottery.itemId;
this.data.img = `http://yun.duiba.com.cn/db_games/${window['imgver']}/${itemid}.png`; this.data.img = `http://yun.duiba.com.cn/db_games/${window['imgver']}/${itemid}.png`;
addAdComp(84,739.52,this) addAdComp(84,739.52,this,27)
} }
showlog() { showlog() {
NetManager.ins.showLog(getlogItem(17)); NetManager.ins.showLog(getlogItem(17));
NetManager.ins.showLog(getlogItem(27));
} }
protected get closeBtns(): eui.Button[] { return [this['closeBtn'],this['close2Btn']] } protected get closeBtns(): eui.Button[] { return [this['closeBtn'],this['close2Btn']] }
get skinKey() { return 'Box' } get skinKey() { return 'Box' }
} }
export const addAdComp = (x,y,parent:egret.DisplayObjectContainer)=>{ export const addAdComp = (x,y,parent:egret.DisplayObjectContainer,logid)=>{
const comp = new AdSmallComp(); const comp = new AdSmallComp();
comp.loadSkin(); comp.loadSkin();
comp.start(); comp.start({logid:logid});
parent.addChildAt(comp,0); parent.addChildAt(comp,0);
comp.x=x; comp.x=x;
comp.y=y; comp.y=y;
......
...@@ -24,12 +24,12 @@ export default class ExchangePanel extends Panel { ...@@ -24,12 +24,12 @@ export default class ExchangePanel extends Panel {
this['moneyTxt'].text = getHomeData().wealth; this['moneyTxt'].text = getHomeData().wealth;
} }
showlog() { showlog() {
NetManager.ins.showLog(getlogItem(41));
} }
buyBtn: eui.Button buyBtn: eui.Button
get skinKey() { return 'Exchange' } get skinKey() { return 'Exchange' }
ontap() { ontap() {
NetManager.ins.clickLog(getlogItem(41));
this.buyBtn.enabled = false; this.buyBtn.enabled = false;
NetManager.ins.hc_exchange((success) => { NetManager.ins.hc_exchange((success) => {
this.buyBtn.enabled = true; this.buyBtn.enabled = true;
......
...@@ -6,6 +6,7 @@ import { getNick } from "../mapScene/MapScene"; ...@@ -6,6 +6,7 @@ import { getNick } from "../mapScene/MapScene";
import { showShare3 } from "../shareCtrl3"; import { showShare3 } from "../shareCtrl3";
import FriendItemRenderer from "./FriendItemRenderer"; import FriendItemRenderer from "./FriendItemRenderer";
import { getFriendShareUrl } from "../getFriendSharePic"; import { getFriendShareUrl } from "../getFriendSharePic";
import { getlogItem } from "../Main";
export default class FriendPanel extends Panel { export default class FriendPanel extends Panel {
public list: eui.List; public list: eui.List;
...@@ -75,6 +76,7 @@ export default class FriendPanel extends Panel { ...@@ -75,6 +76,7 @@ export default class FriendPanel extends Panel {
showlog() { showlog() {
// NetManager.ins.showLog(getlogItem(3)); // NetManager.ins.showLog(getlogItem(3));
// NetManager.ins.showLog(getlogItem(4)); // NetManager.ins.showLog(getlogItem(4));
NetManager.ins.showLog(getlogItem(28));
} }
...@@ -84,6 +86,7 @@ export default class FriendPanel extends Panel { ...@@ -84,6 +86,7 @@ export default class FriendPanel extends Panel {
} }
onTapInvite() { onTapInvite() {
NetManager.ins.clickLog(getlogItem(28));
console.log('onTapInvite'); console.log('onTapInvite');
if (iswx()) { if (iswx()) {
......
...@@ -69,7 +69,7 @@ export default class InviteCutTimePanel extends Panel { ...@@ -69,7 +69,7 @@ export default class InviteCutTimePanel extends Panel {
this.timer.addEventListener(egret.TimerEvent.TIMER, this.cutTimer, this); this.timer.addEventListener(egret.TimerEvent.TIMER, this.cutTimer, this);
this.timer.start(); this.timer.start();
this.cutTimer(); this.cutTimer();
addAdComp(84, 726.33, this); addAdComp(84, 726.33, this,38);
} }
private cutTimer() { private cutTimer() {
......
...@@ -6,6 +6,7 @@ import { iswx } from "../iswx"; ...@@ -6,6 +6,7 @@ import { iswx } from "../iswx";
import Utils from "../Utils"; import Utils from "../Utils";
import InviteRulePanel from "./InviteRulePanel"; import InviteRulePanel from "./InviteRulePanel";
import wait from "../../libs/new_tc/wait"; import wait from "../../libs/new_tc/wait";
import { getlogItem } from "../Main";
export default class InvitePanel extends Panel { export default class InvitePanel extends Panel {
public prizeImg: eui.Image; public prizeImg: eui.Image;
...@@ -59,8 +60,10 @@ export default class InvitePanel extends Panel { ...@@ -59,8 +60,10 @@ export default class InvitePanel extends Panel {
showlog() { showlog() {
// NetManager.ins.showLog(getlogItem(3)); // NetManager.ins.showLog(getlogItem(3));
// NetManager.ins.showLog(getlogItem(4)); // NetManager.ins.showLog(getlogItem(4));
NetManager.ins.showLog(getlogItem(34));
} }
initEvents() { initEvents() {
super.initEvents(); super.initEvents();
this.closeBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap_closeBtn, this); this.closeBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap_closeBtn, this);
...@@ -209,6 +212,7 @@ class InviteItem extends eui.ItemRenderer { ...@@ -209,6 +212,7 @@ class InviteItem extends eui.ItemRenderer {
dataChanged() { dataChanged() {
this.img.source = this.data.avatar || "http://yun.duiba.com.cn/db_games/default_avatar.png"; this.img.source = this.data.avatar || "http://yun.duiba.com.cn/db_games/default_avatar.png";
this.img.addEventListener(egret.TouchEvent.TOUCH_TAP, () => { this.img.addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(34));
if (this.data.callFun) { if (this.data.callFun) {
this.data.callFun(); this.data.callFun();
} }
......
...@@ -4,6 +4,8 @@ import getHomeData from "../getHomeData"; ...@@ -4,6 +4,8 @@ import getHomeData from "../getHomeData";
import { changeMapScene } from "../startScene/StartScene"; import { changeMapScene } from "../startScene/StartScene";
import { addAdComp } from "./BoxPanel"; import { addAdComp } from "./BoxPanel";
import { GDispatcher } from "../../libs/tc/util/GDispatcher"; import { GDispatcher } from "../../libs/tc/util/GDispatcher";
import { getlogItem } from "../Main";
import { NetManager } from "../../libs/tw/manager/NetManager";
/** /**
* 邀请规则面板 * 邀请规则面板
...@@ -21,6 +23,7 @@ export default class InvitePrizePanel extends Panel { ...@@ -21,6 +23,7 @@ export default class InvitePrizePanel extends Panel {
start() { start() {
super.start(); super.start();
NetManager.ins.showLog(getlogItem(38));
} }
protected onSkinComplete() { protected onSkinComplete() {
...@@ -57,12 +60,13 @@ export default class InvitePrizePanel extends Panel { ...@@ -57,12 +60,13 @@ export default class InvitePrizePanel extends Panel {
} }
onTapGoPrize() { onTapGoPrize() {
NetManager.ins.showLog(getlogItem(37));
window.location.href = window['__link__']; window.location.href = window['__link__'];
} }
initUI() { initUI() {
this.prizeImg.source = this.data.prizeImg; this.prizeImg.source = this.data.prizeImg;
addAdComp(84, 845.33, this); addAdComp(84, 845.33, this,38);
} }
protected get closeBtns(): eui.Button[] { protected get closeBtns(): eui.Button[] {
......
...@@ -4,6 +4,8 @@ import getHomeData from "../getHomeData"; ...@@ -4,6 +4,8 @@ import getHomeData from "../getHomeData";
import { changeMapScene } from "../startScene/StartScene"; import { changeMapScene } from "../startScene/StartScene";
import { addAdComp } from "./BoxPanel"; import { addAdComp } from "./BoxPanel";
import { GDispatcher } from "../../libs/tc/util/GDispatcher"; import { GDispatcher } from "../../libs/tc/util/GDispatcher";
import { NetManager } from "../../libs/tw/manager/NetManager";
import { getlogItem } from "../Main";
/** /**
* 邀请规则面板 * 邀请规则面板
...@@ -22,6 +24,7 @@ export default class ScratchPrizePanel extends Panel { ...@@ -22,6 +24,7 @@ export default class ScratchPrizePanel extends Panel {
start() { start() {
super.start(); super.start();
this.initUI(); this.initUI();
NetManager.ins.showLog(getlogItem(54));
} }
protected onSkinComplete() { protected onSkinComplete() {
...@@ -67,7 +70,7 @@ export default class ScratchPrizePanel extends Panel { ...@@ -67,7 +70,7 @@ export default class ScratchPrizePanel extends Panel {
initUI() { initUI() {
this.prizeImg.source = this.data.prizeImage; this.prizeImg.source = this.data.prizeImage;
addAdComp(84, 875, this); addAdComp(84, 875, this,54);
} }
protected get closeBtns(): eui.Button[] { protected get closeBtns(): eui.Button[] {
......
...@@ -28,11 +28,13 @@ export default class ShopPanel extends Panel { ...@@ -28,11 +28,13 @@ export default class ShopPanel extends Panel {
NetManager.ins.showLog(getlogItem(6)); NetManager.ins.showLog(getlogItem(6));
NetManager.ins.showLog(getlogItem(9)); NetManager.ins.showLog(getlogItem(9));
NetManager.ins.showLog(getlogItem(12)); NetManager.ins.showLog(getlogItem(12));
NetManager.ins.showLog(getlogItem(40));
} }
onBuy4() { onBuy4() {
PanelCtrl.instance.show('ExchangePanel'); PanelCtrl.instance.show('ExchangePanel');
NetManager.ins.clickLog(getlogItem(40));
} }
onBuy1() { onBuy1() {
......
import getSkinPath from "../../libs/new_wx/utils/getSkinPath"; import getSkinPath from "../../libs/new_wx/utils/getSkinPath";
import { NetManager } from "../../libs/tw/manager/NetManager";
import { getlogItem } from "../Main";
export default class SignItem extends eui.ItemRenderer { export default class SignItem extends eui.ItemRenderer {
...@@ -35,6 +37,9 @@ export default class SignItem extends eui.ItemRenderer { ...@@ -35,6 +37,9 @@ export default class SignItem extends eui.ItemRenderer {
this[this.data.config.type].visible=true; this[this.data.config.type].visible=true;
this['btn'+this.data.btn].visible=true; this['btn'+this.data.btn].visible=true;
if(this.data.btn ==1) {
NetManager.ins.clickLog(getlogItem(22));
}
console.log(this.data); console.log(this.data);
this['btn1'].addEventListener(egret.TouchEvent.TOUCH_TAP,()=>{ this['btn1'].addEventListener(egret.TouchEvent.TOUCH_TAP,()=>{
......
...@@ -7,6 +7,7 @@ import { updateMainTimer } from "../../libs/new_wx/MainBase"; ...@@ -7,6 +7,7 @@ import { updateMainTimer } from "../../libs/new_wx/MainBase";
import SceneCtrl from "../../libs/new_wx/ctrls/sceneCtrl"; import SceneCtrl from "../../libs/new_wx/ctrls/sceneCtrl";
import wait from "../../libs/new_tc/wait"; import wait from "../../libs/new_tc/wait";
import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl"; import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl";
import { getlogItem } from "../Main";
export default class SignPanel extends Panel { export default class SignPanel extends Panel {
...@@ -39,6 +40,7 @@ export default class SignPanel extends Panel { ...@@ -39,6 +40,7 @@ export default class SignPanel extends Panel {
} }
item['btn1'].enabled=false; item['btn1'].enabled=false;
NetManager.ins.doSign((s)=>{ NetManager.ins.doSign((s)=>{
NetManager.ins.showLog(getlogItem(22));
item['btn1'].enabled=true; item['btn1'].enabled=true;
wait(300).then(()=>{ wait(300).then(()=>{
NetManager.ins.getSignInfo(() => { NetManager.ins.getSignInfo(() => {
......
import Panel from "../../libs/new_wx/components/Panel"; import Panel from "../../libs/new_wx/components/Panel";
import { DataManager } from "../../libs/tw/manager/DataManager"; import { DataManager } from "../../libs/tw/manager/DataManager";
import { addAdComp } from "./BoxPanel"; import { addAdComp } from "./BoxPanel";
import { NetManager } from "../../libs/tw/manager/NetManager";
import { getlogItem } from "../Main";
export default class SignPrizePanel extends Panel { export default class SignPrizePanel extends Panel {
start(data) { start(data) {
...@@ -30,11 +32,17 @@ export default class SignPrizePanel extends Panel { ...@@ -30,11 +32,17 @@ export default class SignPrizePanel extends Panel {
this['img'].visible = prizeType!= 'times' && prizeType!= 'coin'; this['img'].visible = prizeType!= 'times' && prizeType!= 'coin';
this['money'].visible = prizeType=='coin'; this['money'].visible = prizeType=='coin';
this['blood'].visible = prizeType=='times'; this['blood'].visible = prizeType=='times';
addAdComp(84,698.52,this); addAdComp(84,698.52,this,24);
} }
showlog() { showlog() {
NetManager.ins.showLog(getlogItem(23));
NetManager.ins.showLog(getlogItem(24));
}
onTouchTap_closeBtn() {
super.onTouchTap_closeBtn();
NetManager.ins.clickLog(getlogItem(23));
} }
get skinKey() { return 'SignPrize' } get skinKey() { return 'SignPrize' }
......
...@@ -19,18 +19,23 @@ import TargetItemRenderer from "./TargetItemRenderer"; ...@@ -19,18 +19,23 @@ import TargetItemRenderer from "./TargetItemRenderer";
import { addRankFriendList } from "../mapScene/RankFriendList"; import { addRankFriendList } from "../mapScene/RankFriendList";
import { addAdComp } from "./BoxPanel"; import { addAdComp } from "./BoxPanel";
import { getChapterData } from "../something/chapters/getChapter"; import { getChapterData } from "../something/chapters/getChapter";
import { getlogItem } from "../Main";
export default class StartPanel extends Panel { export default class StartPanel extends Panel {
static currlevel; static currlevel;
private _level; private _level;
private list: eui.List; private list: eui.List;
showlog(){
}
start(data) { start(data) {
this.showlog()
super.start(); super.start();
const homedata = getHomeData(); const homedata = getHomeData();
if (data > homedata.levels.length) { if (data > homedata.levels.length) {
addAdComp(84, 925, this) addAdComp(84, 925, this,29);
NetManager.ins.showLog(getlogItem(29));
} }
else else
addRankFriendList(84, 925, this,data); addRankFriendList(84, 925, this,data);
......
...@@ -13,6 +13,7 @@ import getResPath from "../../../libs/new_tc/getResPath"; ...@@ -13,6 +13,7 @@ import getResPath from "../../../libs/new_tc/getResPath";
import wait from "../../../libs/new_tc/wait"; import wait from "../../../libs/new_tc/wait";
import { showToast } from "../../../libs/new_wx/ctrls/toastCtrl"; import { showToast } from "../../../libs/new_wx/ctrls/toastCtrl";
import getHomeData from "../../getHomeData"; import getHomeData from "../../getHomeData";
import { getlogItem } from "../../Main";
// export const loadTurntableSvga = (callback) => { // export const loadTurntableSvga = (callback) => {
// loadSvga(getResPath() + 'resource/assets/svgas/turntable.svga').then(async (mv: any) => { // loadSvga(getResPath() + 'resource/assets/svgas/turntable.svga').then(async (mv: any) => {
// // await wait(100); // // await wait(100);
...@@ -40,6 +41,7 @@ export default class Turntable extends Panel { ...@@ -40,6 +41,7 @@ export default class Turntable extends Panel {
async start(data?) { async start(data?) {
super.start(); super.start();
NetManager.ins.showLog(getlogItem(45));
this['container'].addChild(this.data.mv); this['container'].addChild(this.data.mv);
this.hand = await loadSvga(getResPath() + 'resource/assets/svgas/hand.svga', this['container2']) this.hand = await loadSvga(getResPath() + 'resource/assets/svgas/hand.svga', this['container2'])
this['container2'].touchEnabled = false; this['container2'].touchEnabled = false;
...@@ -74,6 +76,7 @@ export default class Turntable extends Panel { ...@@ -74,6 +76,7 @@ export default class Turntable extends Panel {
} }
onTapStart() { onTapStart() {
NetManager.ins.clickLog(getlogItem(45));
this.setBtnTouch(false); // 锁定按钮 this.setBtnTouch(false); // 锁定按钮
Loading.instace.show(); Loading.instace.show();
if(this.remainTimes <= 0 && (getHomeData().wealth < this.nextTimeNeedCoin)) { if(this.remainTimes <= 0 && (getHomeData().wealth < this.nextTimeNeedCoin)) {
......
...@@ -5,6 +5,7 @@ import PanelCtrl from "../../../libs/new_wx/ctrls/panelCtrl"; ...@@ -5,6 +5,7 @@ import PanelCtrl from "../../../libs/new_wx/ctrls/panelCtrl";
import { loadSvga } from "../../loadSvga"; import { loadSvga } from "../../loadSvga";
import getResPath from "../../../libs/new_tc/getResPath"; import getResPath from "../../../libs/new_tc/getResPath";
import { NetManager } from "../../../libs/tw/manager/NetManager"; import { NetManager } from "../../../libs/tw/manager/NetManager";
import { getlogItem } from "../../Main";
export default class TurntableNoPrizePanel extends Panel { export default class TurntableNoPrizePanel extends Panel {
...@@ -12,7 +13,7 @@ export default class TurntableNoPrizePanel extends Panel { ...@@ -12,7 +13,7 @@ export default class TurntableNoPrizePanel extends Panel {
super.start(); super.start();
this.showlog(); this.showlog();
addAdComp(84, 635, this); addAdComp(84, 635, this,48);
if (this['tips' + data.type]) if (this['tips' + data.type])
this['tips' + data.type].visible = true; this['tips' + data.type].visible = true;
NetManager.ins.hc_turnableBaseInfo((success, res) => { NetManager.ins.hc_turnableBaseInfo((success, res) => {
...@@ -26,6 +27,8 @@ export default class TurntableNoPrizePanel extends Panel { ...@@ -26,6 +27,8 @@ export default class TurntableNoPrizePanel extends Panel {
} }
showlog() { showlog() {
NetManager.ins.showLog(getlogItem(46));
NetManager.ins.showLog(getlogItem(48));
// NetManager.ins.showLog(getlogItem(3)); // NetManager.ins.showLog(getlogItem(3));
// NetManager.ins.showLog(getlogItem(4)); // NetManager.ins.showLog(getlogItem(4));
} }
...@@ -39,6 +42,7 @@ export default class TurntableNoPrizePanel extends Panel { ...@@ -39,6 +42,7 @@ export default class TurntableNoPrizePanel extends Panel {
onTap_btn1() {//再来一次 onTap_btn1() {//再来一次
//if 有免费次数或积分充足 //if 有免费次数或积分充足
//else show toast //else show toast
NetManager.ins.clickLog(getlogItem(46));
console.log('再来一次'); console.log('再来一次');
loadSvga(getResPath() + 'resource/assets/svgas/turntable.svga').then(async (mv: any) => { loadSvga(getResPath() + 'resource/assets/svgas/turntable.svga').then(async (mv: any) => {
// await wait(100); // await wait(100);
......
...@@ -6,6 +6,7 @@ import PanelCtrl from "../../../libs/new_wx/ctrls/panelCtrl"; ...@@ -6,6 +6,7 @@ import PanelCtrl from "../../../libs/new_wx/ctrls/panelCtrl";
import { NetManager } from "../../../libs/tw/manager/NetManager"; import { NetManager } from "../../../libs/tw/manager/NetManager";
import CutTimer from "../../CutTimer"; import CutTimer from "../../CutTimer";
import Utils from "../../Utils"; import Utils from "../../Utils";
import { getlogItem } from "../../Main";
export default class TurnPrize2Panel extends Panel { export default class TurnPrize2Panel extends Panel {
start(data) { start(data) {
...@@ -15,7 +16,7 @@ export default class TurnPrize2Panel extends Panel { ...@@ -15,7 +16,7 @@ export default class TurnPrize2Panel extends Panel {
this.setProgress(+data.option.completePercent); this.setProgress(+data.option.completePercent);
this.data.url = data.option.prizeImage; this.data.url = data.option.prizeImage;
this['light1'].visible = this['light2'].visible = false; this['light1'].visible = this['light2'].visible = false;
addAdComp(84, 816, this); addAdComp(84, 816, this,48);
data.mv.gotoAndPlay(10, true) data.mv.gotoAndPlay(10, true)
data.mv.once(egret.Event.COMPLETE, () => { data.mv.once(egret.Event.COMPLETE, () => {
data.mv.stop(1); data.mv.stop(1);
...@@ -68,6 +69,8 @@ export default class TurnPrize2Panel extends Panel { ...@@ -68,6 +69,8 @@ export default class TurnPrize2Panel extends Panel {
showlog() { showlog() {
// NetManager.ins.showLog(getlogItem(3)); // NetManager.ins.showLog(getlogItem(3));
// NetManager.ins.showLog(getlogItem(4)); // NetManager.ins.showLog(getlogItem(4));
NetManager.ins.showLog(getlogItem(47));
NetManager.ins.showLog(getlogItem(48));
} }
initEvents() { initEvents() {
...@@ -76,6 +79,7 @@ export default class TurnPrize2Panel extends Panel { ...@@ -76,6 +79,7 @@ export default class TurnPrize2Panel extends Panel {
} }
onTap_btn1() { onTap_btn1() {
NetManager.ins.clickLog(getlogItem(47));
console.log('onTap_btn1'); console.log('onTap_btn1');
NetManager.ins.scratchGetTaskInfo((success, res) => { NetManager.ins.scratchGetTaskInfo((success, res) => {
if (!success) { if (!success) {
......
...@@ -5,14 +5,16 @@ import PanelCtrl from "../../../libs/new_wx/ctrls/panelCtrl"; ...@@ -5,14 +5,16 @@ import PanelCtrl from "../../../libs/new_wx/ctrls/panelCtrl";
import { loadSvga } from "../../loadSvga"; import { loadSvga } from "../../loadSvga";
import getResPath from "../../../libs/new_tc/getResPath"; import getResPath from "../../../libs/new_tc/getResPath";
import { NetManager } from "../../../libs/tw/manager/NetManager"; import { NetManager } from "../../../libs/tw/manager/NetManager";
import { getlogItem } from "../../Main";
export default class TurnPrizePanel extends Panel { export default class TurnPrizePanel extends Panel {
start(data) { start(data) {
super.start(); super.start();
this.showlog(); this.showlog();
this['light1'].visible = this['light2'].visible = false; this['light1'].visible = this['light2'].visible = false;
addAdComp(84, 788, this); addAdComp(84, 788, this,48);
data.mv.gotoAndPlay(10, true) data.mv.gotoAndPlay(10, true)
data.mv.once(egret.Event.COMPLETE, () => { data.mv.once(egret.Event.COMPLETE, () => {
data.mv.stop(1); data.mv.stop(1);
...@@ -66,6 +68,8 @@ export default class TurnPrizePanel extends Panel { ...@@ -66,6 +68,8 @@ export default class TurnPrizePanel extends Panel {
} }
showlog() { showlog() {
NetManager.ins.showLog(getlogItem(46));
NetManager.ins.showLog(getlogItem(48));
// NetManager.ins.showLog(getlogItem(3)); // NetManager.ins.showLog(getlogItem(3));
// NetManager.ins.showLog(getlogItem(4)); // NetManager.ins.showLog(getlogItem(4));
} }
...@@ -77,6 +81,7 @@ export default class TurnPrizePanel extends Panel { ...@@ -77,6 +81,7 @@ export default class TurnPrizePanel extends Panel {
} }
onTap_btn1() {//再来一次 onTap_btn1() {//再来一次
NetManager.ins.clickLog(getlogItem(46));
//if 有免费次数或积分充足 //if 有免费次数或积分充足
//else show toast //else show toast
console.log('再来一次'); console.log('再来一次');
......
...@@ -69,6 +69,7 @@ export class Tool { ...@@ -69,6 +69,7 @@ export class Tool {
private static indexPositions10: number[][] = []; private static indexPositions10: number[][] = [];
/** /**
* 初始化数据 * 初始化数据
* 提前的缓存数据,千万别修改,因为给出的数据都没有深拷贝过
*/ */
public static init(isTwo: boolean = false) { public static init(isTwo: boolean = false) {
var ooox = isTwo ? 55 : 15;// 49 : 8.25 var ooox = isTwo ? 55 : 15;// 49 : 8.25
...@@ -234,7 +235,6 @@ export class Tool { ...@@ -234,7 +235,6 @@ export class Tool {
} }
/** /**
* 判断格子是否能掉落, * 判断格子是否能掉落,
* 是否能移动
* @param lat * @param lat
*/ */
public static judgeFall(lat: Lattice): boolean { public static judgeFall(lat: Lattice): boolean {
...@@ -255,6 +255,22 @@ export class Tool { ...@@ -255,6 +255,22 @@ export class Tool {
} }
} }
/**
* 格子允许手动移动
* 在允许掉落的基础上去掉,带毛球的,因为毛球能掉落,但是不能移动
* @param lat
*/
public static judgeMove(lat: Lattice): boolean {
if (this.judgeFall(lat) &&
!lat.element.hasState(StateType.HAIRBALLBLACK) &&
!lat.element.hasState(StateType.HAIRBALLGREY) &&
!lat.element.hasState(StateType.HAIRBALLBROWN)
) {
return true
}
return false
}
/** /**
* 判断格子是否可进行匹配, * 判断格子是否可进行匹配,
* 不包括魔力鸟,不包括头毛球的 * 不包括魔力鸟,不包括头毛球的
...@@ -400,7 +416,6 @@ export class Tool { ...@@ -400,7 +416,6 @@ export class Tool {
* 有返回证明不是死图, * 有返回证明不是死图,
*/ */
public static dieMapCheck(lattices: Lattice[]): Element[] { public static dieMapCheck(lattices: Lattice[]): Element[] {
var judgeFall = Tool.judgeFall;
var judgeMatch = Tool.judgeMatch; var judgeMatch = Tool.judgeMatch;
//记录有特效的元素,下面特效检测用 //记录有特效的元素,下面特效检测用
var effectElements = [] var effectElements = []
...@@ -412,14 +427,14 @@ export class Tool { ...@@ -412,14 +427,14 @@ export class Tool {
var col = rc[1]; var col = rc[1];
var lat = lattices[i]; var lat = lattices[i];
//如果自身格子空或不能交换,跳入下一个 //如果自身格子空或不能交换,跳入下一个
if (!judgeFall(lat)) continue if (!this.judgeMove(lat)) continue
if (lat.element.effectType != null) { if (lat.element.effectType != null) {
effectElements.push(lat.element); effectElements.push(lat.element);
} }
//与下交换 //与下交换
var latDown = lattices[i + Tool.colNum]; var latDown = lattices[i + Tool.colNum];
//能交换,并且类型不一致 //能交换,并且类型不一致
if (judgeFall(latDown) && lat.element.type != latDown.element.type) { if (this.judgeMove(latDown) && lat.element.type != latDown.element.type) {
//判断向下,+2,+3 lat //判断向下,+2,+3 lat
lat2 = lattices[i + Tool.colNum * 2]; lat2 = lattices[i + Tool.colNum * 2];
lat3 = lattices[i + Tool.colNum * 3]; lat3 = lattices[i + Tool.colNum * 3];
...@@ -510,7 +525,7 @@ export class Tool { ...@@ -510,7 +525,7 @@ export class Tool {
if (col != Tool.colNum - 1) { if (col != Tool.colNum - 1) {
var latRight = lattices[i + 1]; var latRight = lattices[i + 1];
//能交换,并且类型不一致,并未判断latRight是否judgeMatch,也就是未判断是否魔力鸟,但是不影响 //能交换,并且类型不一致,并未判断latRight是否judgeMatch,也就是未判断是否魔力鸟,但是不影响
if (judgeFall(latRight) && lat.element.type != latRight.element.type) { if (this.judgeMove(latRight) && lat.element.type != latRight.element.type) {
//判断向右,+2,+3 lat 先确定col<Tool.colNum - 3 //判断向右,+2,+3 lat 先确定col<Tool.colNum - 3
if (col < Tool.colNum - 3) { if (col < Tool.colNum - 3) {
lat2 = lattices[i + 2]; lat2 = lattices[i + 2];
...@@ -599,38 +614,38 @@ export class Tool { ...@@ -599,38 +614,38 @@ export class Tool {
if (effectElement.effectType == EffectType.MAGICLION) { if (effectElement.effectType == EffectType.MAGICLION) {
//上格子 //上格子
var up = lattices[effectElement.index - Tool.colNum]; var up = lattices[effectElement.index - Tool.colNum];
if (judgeFall(up) && up.element.type != ElementType.LOLLIPOP) return [effectElement, up.element]; if (this.judgeMove(up) && up.element.type != ElementType.LOLLIPOP) return [effectElement, up.element];
//下格子 //下格子
var down = lattices[effectElement.index + Tool.colNum]; var down = lattices[effectElement.index + Tool.colNum];
if (judgeFall(down) && down.element.type != ElementType.LOLLIPOP) return [effectElement, down.element]; if (this.judgeMove(down) && down.element.type != ElementType.LOLLIPOP) return [effectElement, down.element];
//左格子 //左格子
var col = Tool.indexToRc(effectElement.index)[1];//列数 var col = Tool.indexToRc(effectElement.index)[1];//列数
if (col != 0) { if (col != 0) {
var left = lattices[effectElement.index - 1]; var left = lattices[effectElement.index - 1];
if (judgeFall(left) && left.element.type != ElementType.LOLLIPOP) return [effectElement, left.element]; if (this.judgeMove(left) && left.element.type != ElementType.LOLLIPOP) return [effectElement, left.element];
} }
if (col != Tool.colNum - 1) { if (col != Tool.colNum - 1) {
var right = lattices[effectElement.index + 1]; var right = lattices[effectElement.index + 1];
if (judgeFall(right) && right.element.type != ElementType.LOLLIPOP) return [effectElement, right.element]; if (this.judgeMove(right) && right.element.type != ElementType.LOLLIPOP) return [effectElement, right.element];
} }
continue continue
} }
//是普通特效,找周围是特效的 //是普通特效,找周围是特效的
//上格子 //上格子
var up = lattices[effectElement.index - Tool.colNum]; var up = lattices[effectElement.index - Tool.colNum];
if (judgeFall(up) && up.element.effectType != null) return [effectElement, up.element]; if (this.judgeMove(up) && up.element.effectType != null) return [effectElement, up.element];
//下格子 //下格子
var down = lattices[effectElement.index + Tool.colNum]; var down = lattices[effectElement.index + Tool.colNum];
if (judgeFall(down) && down.element.effectType != null) return [effectElement, down.element]; if (this.judgeMove(down) && down.element.effectType != null) return [effectElement, down.element];
//左格子 //左格子
var col = Tool.indexToRc(effectElement.index)[1];//列数 var col = Tool.indexToRc(effectElement.index)[1];//列数
if (col != 0) { if (col != 0) {
var left = lattices[effectElement.index - 1]; var left = lattices[effectElement.index - 1];
if (judgeFall(left) && left.element.effectType != null) return [effectElement, left.element]; if (this.judgeMove(left) && left.element.effectType != null) return [effectElement, left.element];
} }
if (col != Tool.colNum) { if (col != Tool.colNum) {
var right = lattices[effectElement.index + 1]; var right = lattices[effectElement.index + 1];
if (judgeFall(right) && right.element.effectType != null) return [effectElement, right.element]; if (this.judgeMove(right) && right.element.effectType != null) return [effectElement, right.element];
} }
} }
return null return null
...@@ -676,15 +691,15 @@ export class Tool { ...@@ -676,15 +691,15 @@ export class Tool {
//右1 //右1
if (rc[1] < Tool.colNum - 1) { if (rc[1] < Tool.colNum - 1) {
var latRight1 = lattices[i + 1]; var latRight1 = lattices[i + 1];
if (Tool.judgeFall(latRight1) && latRight1.element.type != ElementType.LOLLIPOP) { if (Tool.judgeMove(latRight1) && latRight1.element.type != ElementType.LOLLIPOP) {
hasTwo = true; hasTwo = true;
} }
//右2 //右2
if (rc[1] < Tool.colNum - 2) { if (rc[1] < Tool.colNum - 2) {
var latRight2 = lattices[i + 2]; var latRight2 = lattices[i + 2];
if (Tool.judgeFall(latRight1) && if (Tool.judgeMove(latRight1) &&
latRight1.element.type != ElementType.LOLLIPOP && latRight1.element.type != ElementType.LOLLIPOP &&
Tool.judgeFall(latRight2) && Tool.judgeMove(latRight2) &&
latRight2.element.type != ElementType.LOLLIPOP) { latRight2.element.type != ElementType.LOLLIPOP) {
hasThree = true; hasThree = true;
} }
...@@ -692,7 +707,7 @@ export class Tool { ...@@ -692,7 +707,7 @@ export class Tool {
} }
//下1 //下1
var latDown1 = lattices[i + Tool.colNum]; var latDown1 = lattices[i + Tool.colNum];
if (Tool.judgeFall(latDown1) && latDown1.element.type != ElementType.LOLLIPOP) { if (Tool.judgeMove(latDown1) && latDown1.element.type != ElementType.LOLLIPOP) {
hasTwo = true; hasTwo = true;
} }
//提前判断下 //提前判断下
...@@ -700,9 +715,9 @@ export class Tool { ...@@ -700,9 +715,9 @@ export class Tool {
//下2 //下2
var latDown2 = lattices[i + Tool.colNum * 2]; var latDown2 = lattices[i + Tool.colNum * 2];
if (Tool.judgeFall(latDown1) && if (Tool.judgeMove(latDown1) &&
latDown1.element.type != ElementType.LOLLIPOP && latDown1.element.type != ElementType.LOLLIPOP &&
Tool.judgeFall(latDown2) && Tool.judgeMove(latDown2) &&
latDown2.element.type != ElementType.LOLLIPOP) { latDown2.element.type != ElementType.LOLLIPOP) {
hasThree = true; hasThree = true;
} }
......
...@@ -4,33 +4,30 @@ import { Pool } from "../Pool"; ...@@ -4,33 +4,30 @@ import { Pool } from "../Pool";
import { Element } from "../class/Element"; import { Element } from "../class/Element";
import { Ice } from "../class/Ice"; import { Ice } from "../class/Ice";
import { ElementType } from "../enum/ElementType"; import { ElementType } from "../enum/ElementType";
import { BitmapRecycle } from "../class/BitmapRecycle";
export function FlyTargetAni( export function FlyTargetAni(
type: ElementType, type: ElementType,
fromP: number[], fromP: number[],
targetP: number[], targetP: number[],
con: egret.DisplayObjectContainer con: egret.DisplayObjectContainer
) { ) {
//弄一个替代的
let eleC: egret.Bitmap = Pool.takeOut(RecoverName.FLYIMAGE);
if (!eleC) eleC = new egret.Bitmap();
var texture: egret.Texture = RES.getRes("ele" + type + "_png"); var texture: egret.Texture = RES.getRes("ele" + type + "_png");
eleC.texture = texture; //弄一个替代的
//都按格子的中心点 let eleC: BitmapRecycle = Pool.takeOut(RecoverName.BITMAPRECYCLE);
eleC.anchorOffsetX = texture.textureWidth / 2; if (!eleC) {
eleC.anchorOffsetY = texture.textureHeight / 2; eleC = new BitmapRecycle(texture);
//重置缩放 }else{
eleC.scaleX = 1; eleC.reset(texture);
eleC.scaleY = 1; }
eleC.x = fromP[0]; eleC.x = fromP[0];
eleC.y = fromP[1]; eleC.y = fromP[1];
con.addChild(eleC); con.addChild(eleC);
var a = { t: 0 };
egret.Tween.get(eleC) egret.Tween.get(eleC)
.to({ x: targetP[0], y: targetP[1], scaleX: 0.3, scaleY: 0.3 }, 500 + (Math.random() * 100) >> 0) .to({ x: targetP[0], y: targetP[1], scaleX: 0.3, scaleY: 0.3 }, 500 + (Math.random() * 100) >> 0)
.call(() => { .call(() => {
//回收 //回收
con.removeChild(eleC); con.removeChild(eleC);
Pool.recover(RecoverName.FLYIMAGE, eleC); Pool.recover(RecoverName.BITMAPRECYCLE, eleC);
con["elementTargets"].targets[type].count--; con["elementTargets"].targets[type].count--;
}) })
} }
\ No newline at end of file
import { ImageAni } from "../class/ImageAni";
import { Pool } from "../Pool";
import { RecoverName } from "../enum/RecoverName";
import { playSound, SoundType } from "../../soundCtrl";
import { Tool } from "../Tool";
import { ElementType } from "../enum/ElementType";
import { Element } from "../class/Element";
import { StateType } from "../enum/StateType";
/**
* 需要回调的
*
*/
export class HairballJumpAni extends egret.Bitmap {
constructor() {
super()
}
play(type: StateType, startP: number[], endP: number[], callback: Function) {
var source: string;
switch (type) {
case StateType.HAIRBALLBLACK:
source = "ele" + ElementType.HAIRBALLBLACK + "_png";
break;
case StateType.HAIRBALLGREY:
source = "ele" + ElementType.HAIRBALLGREY + "_png";
break;
case StateType.HAIRBALLBROWN:
source = "ele" + ElementType.HAIRBALLBROWN + "_png";
break;
default:
source = "ele" + ElementType.HAIRBALLGREY + "_png";
break
}
var texture: egret.Texture = RES.getRes(source)
this.texture = texture;
this.anchorOffsetX = texture.textureWidth / 2;
this.anchorOffsetY = texture.textureHeight;
this.x = startP[0];
this.y = startP[1] + texture.textureHeight / 2;
egret.Tween.get(this)
.to({ scaleX: 1.2, scaleY: 0.8 }, 50)
.to({ scaleX: 0.8, scaleY: 1.2 }, 50)
.to({ scaleX: 1, scaleY: 1 }, 50)
.to({ scaleX: 1.2, scaleY: 0.8 }, 50)
.to({ scaleX: 0.8, scaleY: 1.2 }, 50)
.to({ scaleX: 1, scaleY: 1 }, 50)
.call(() => {
//回收元素
if (this.parent) this.parent.removeChild(this);
Pool.recover(RecoverName.HAIRBALLJUMP_ANI, this)
//回调
callback();
})
egret.Tween.get(this)
.to({ x: endP[0], y: endP[1]+texture.textureHeight / 2 }, 300, egret.Ease.sineInOut)
}
}
\ No newline at end of file
...@@ -6,6 +6,7 @@ import { Ice } from "../class/Ice"; ...@@ -6,6 +6,7 @@ import { Ice } from "../class/Ice";
import { ElementType } from "../enum/ElementType"; import { ElementType } from "../enum/ElementType";
import { Tool } from "../Tool"; import { Tool } from "../Tool";
import MainScene from "../../mainScene/MainScene"; import MainScene from "../../mainScene/MainScene";
import { BitmapRecycle } from "../class/BitmapRecycle";
/** /**
* 孵蛋的动效 * 孵蛋的动效
...@@ -17,15 +18,22 @@ export function HatchAni(startIndex: number, endIndexs: number[], thisObj: MainS ...@@ -17,15 +18,22 @@ export function HatchAni(startIndex: number, endIndexs: number[], thisObj: MainS
for (let i = 0; i < endIndexs.length; i++) { for (let i = 0; i < endIndexs.length; i++) {
let endIndex = endIndexs[i]; let endIndex = endIndexs[i];
let endP = Tool.getPositionByIndex(endIndex); let endP = Tool.getPositionByIndex(endIndex);
let eleC: Element = Tool.getElement(ElementType.CHICKEN); var texture: egret.Texture = RES.getRes("ele" + ElementType.CHICKEN + "_png");
let eleC: BitmapRecycle = Pool.takeOut(RecoverName.BITMAPRECYCLE);
if (!eleC) {
eleC = new BitmapRecycle(texture);
}else{
eleC.reset(texture);
}
eleC.x = startP[0]; eleC.x = startP[0];
eleC.y = startP[1]; eleC.y = startP[1];
eleC.scaleX = eleC.scaleY = 0.7; eleC.scaleX = eleC.scaleY = 0.7;
thisObj.addChild(eleC); thisObj.addChild(eleC);
paraCurveAni(eleC, startP, endP, () => { paraCurveAni(eleC, startP, endP, () => {
//回收 //回收
thisObj.removeChild(eleC); thisObj.removeChild(eleC);
Pool.recover(RecoverName.ELEMENT, eleC); Pool.recover(RecoverName.BITMAPRECYCLE, eleC);
//对应的索引的类型变成鸡,抛物线动画时间都一致,其实可以在统一回调里执行数据更新,这里的数据更新迟早改掉 //对应的索引的类型变成鸡,抛物线动画时间都一致,其实可以在统一回调里执行数据更新,这里的数据更新迟早改掉
thisObj.lattices[endIndex].element.reset(ElementType.CHICKEN); thisObj.lattices[endIndex].element.reset(ElementType.CHICKEN);
//动画,和bonusTime的效果一样,暂时没加 //动画,和bonusTime的效果一样,暂时没加
...@@ -44,7 +52,7 @@ const gravity = 0.003 ...@@ -44,7 +52,7 @@ const gravity = 0.003
* @param endP * @param endP
* @param callback * @param callback
*/ */
function paraCurveAni(ele: Element, startP: number[], endP: number[], callback: Function) { function paraCurveAni(ele: BitmapRecycle, startP: number[], endP: number[], callback: Function) {
//x方向匀速,线性 //x方向匀速,线性
var deltaX = endP[0] - startP[0] var deltaX = endP[0] - startP[0]
//y方向,自由落体,y向下为正,加速度向下为正,初速度根据情况而定 //y方向,自由落体,y向下为正,加速度向下为正,初速度根据情况而定
......
import { Element } from "../class/Element"; import { Element } from "../class/Element";
import { Pool } from "../Pool"; import { Pool } from "../Pool";
import { RecoverName } from "../enum/RecoverName"; import { RecoverName } from "../enum/RecoverName";
import { BitmapRecycle } from "../class/BitmapRecycle";
const pi = Math.PI; const pi = Math.PI;
const pi2 = pi * 2; const pi2 = pi * 2;
...@@ -13,12 +14,14 @@ const pi2 = pi * 2; ...@@ -13,12 +14,14 @@ const pi2 = pi * 2;
*/ */
export function MagicRotateAni(ele: Element, p: number[], con: egret.DisplayObjectContainer) { export function MagicRotateAni(ele: Element, p: number[], con: egret.DisplayObjectContainer) {
//弄一个替代的 //弄一个替代的
let eleC: Element = Pool.takeOut(RecoverName.ELEMENT); let eleC: BitmapRecycle = Pool.takeOut(RecoverName.BITMAPRECYCLE);
var texture: egret.Texture = RES.getRes("ele" + ele.type + "_png");
if (!eleC) { if (!eleC) {
eleC = new Element(ele.type) eleC = new BitmapRecycle(texture)
} else { } else {
eleC.reset(ele.type) eleC.reset(texture)
} }
eleC.x = ele.x; eleC.x = ele.x;
eleC.y = ele.y; eleC.y = ele.y;
con.addChild(eleC); con.addChild(eleC);
...@@ -49,11 +52,11 @@ export function MagicRotateAni(ele: Element, p: number[], con: egret.DisplayObje ...@@ -49,11 +52,11 @@ export function MagicRotateAni(ele: Element, p: number[], con: egret.DisplayObje
eleC.alpha = eleC.scaleX = eleC.scaleY = 1 - a.t / tAll; eleC.alpha = eleC.scaleX = eleC.scaleY = 1 - a.t / tAll;
} }
}) })
.to({ t: 60 }, 800,egret.Ease.quadIn) .to({ t: 60 }, 800, egret.Ease.quadIn)
.call(() => { .call(() => {
//回收 //回收
con.removeChild(eleC); con.removeChild(eleC);
Pool.recover(RecoverName.ELEMENT, eleC); Pool.recover(RecoverName.BITMAPRECYCLE, eleC);
}) })
} }
......
...@@ -108,7 +108,15 @@ export const Chapters4: ChapterData[] = [ ...@@ -108,7 +108,15 @@ export const Chapters4: ChapterData[] = [
}, },
//77 //77
{ {
baseElementTypes: [0, 1, 3, 2], bubbleProbability: 20, stepCount: 20, passTarget: { type: 1, elements: [{ type: 6, count: 3 }] }, starScores: [5000, 12000, 18000], map: { lattices: [1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0], connectedLats: [[45, 2], [53, 6]], elements: [1, 0, 1, 0, 1, 0, 1, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 2, 2, 2, 0, 0, 0], baseElements: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], recycles: [55, 61, 65, 69, 75, 76, 77], generateLats: [{ index: 0, type: null }, { index: 4, type: null }, { index: 8, type: null }, { index: 10, type: null }, { index: 12, type: null }, { index: 14, type: null }, { index: 16, type: null }] } baseElementTypes: [0, 1, 3, 2],
bubbleProbability: 20,
stepCount: 20,
passTarget: { type: 1, elements: [{ type: 6, count: 3 }] },
starScores: [5000, 12000, 18000],
map: {
lattices: [1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0],
connectedLats: [[45, 2], [53, 6]],
elements: [1, 0, 1, 0, 1, 0, 1, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 2, 2, 2, 0, 0, 0], baseElements: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], recycles: [55, 61, 65, 69, 75, 76, 77], generateLats: [{ index: 0, type: null }, { index: 4, type: null }, { index: 8, type: null }, { index: 10, type: null }, { index: 12, type: null }, { index: 14, type: null }, { index: 16, type: null }] }
}, },
//78 //78
{ {
...@@ -120,6 +128,38 @@ export const Chapters4: ChapterData[] = [ ...@@ -120,6 +128,38 @@ export const Chapters4: ChapterData[] = [
}, },
//80 //80
{ {
baseElementTypes: [0, 2, 1, 3, 4], bubbleProbability: 50, stepCount: 23, passTarget: { type: 1, elements: [{ type: 1, count: 50 }, { type: 5, count: 24 }] }, starScores: [5000, 11000, 19000], map: { lattices: [0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], connectedLats: [], elements: [0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 7, 2, 7, 2, 7, 2, 7, 0, 7, 7, 2, 7, 2, 7, 2, 7, 0, 2, 7, 2, 7, 2, 7, 2, 7, 7, 2, 7, 6, 7, 6, 7, 6, 7, 2, 2, 7, 2, 7, 2, 7, 2, 7, 2, 2, 7, 2, 7, 2, 7, 2, 7, 2, 7, 7, 2, 7, 2, 7, 2, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7], baseElements: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], recycles: [], generateLats: [{ index: 1, type: null }, { index: 2, type: null }, { index: 3, type: null }, { index: 4, type: null }, { index: 5, type: null }, { index: 6, type: null }, { index: 7, type: null }, { index: 18, type: null }, { index: 26, type: null }] } baseElementTypes: [0, 2, 1, 3, 4],
bubbleProbability: 0,
stepCount: 23,
passTarget: { type: 1, elements: [{ type: 1, count: 50 }, { type: 5, count: 26 }] },
starScores: [5000, 11000, 19000],
map: {
lattices: [0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
connectedLats: [],
elements: [
0, 1, 1, 1, 1, 1, 1, 1, 0,
0, 7, 2, 7, 2, 7, 2, 7, 0,
7, 7, 2, 7, 2, 7, 2, 7, 7,
2, 7, 2, 7, 2, 7, 2, 7, 2,
2, 7, 6, 7, 6, 7, 6, 7, 2,
2, 7, 2, 7, 2, 7, 2, 7, 2,
2, 7, 2, 7, 2, 7, 2, 7, 2,
7, 7, 2, 7, 2, 7, 2, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7
],
baseElements: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
recycles: [],
generateLats: [
{ index: 1, type: null },
{ index: 2, type: null },
{ index: 3, type: null },
{ index: 4, type: null },
{ index: 5, type: null },
{ index: 6, type: null },
{ index: 7, type: null },
{ index: 18, type: null },
{ index: 26, type: null }
]
}
} }
] ]
\ No newline at end of file
This diff is collapsed.
...@@ -8,56 +8,58 @@ import { ElementType } from "../enum/ElementType"; ...@@ -8,56 +8,58 @@ import { ElementType } from "../enum/ElementType";
export const Chapters6: ChapterData[] = [ export const Chapters6: ChapterData[] = [
//101 //101
{ {
baseElementTypes: [0, 1, 2, 3, 4], baseElementTypes: [0, 1, 2, 3],
bubbleProbability: 0, bubbleProbability: 0,
stepCount: 20, stepCount: 27,
passTarget: { type: 1, elements: [{ type: 9, count: 27 }] }, passTarget: { type: 1, elements: [{ type: 10, count: 13 }] },
starScores: [5000, 12000, 25000], starScores: [6000, 12000, 18000],
map: { map: {
lattices: [ lattices: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 0, 0, 0,
0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0,
0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0,
0, 1, 2, 2, 2, 2, 2, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0,
0, 0, 2, 2, 2, 2, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
0, 0, 2, 2, 2, 2, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
0, 0, 2, 2, 2, 2, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
0, 2, 2, 2, 2, 2, 2, 2, 0 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1
], ],
connectedLats: [],
elements: [ elements: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 2, 1, 1, 1, 2, 1, 1,
0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 8, 2, 2, 1, 2, 2, 8, 1,
0, 1, 1, 1, 1, 1, 1, 1, 0, 2, 2, 2, 2, 8, 2, 2, 2, 2,
0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 2, 2, 2, 1, 1, 1,
0, 0, 2, 2, 5, 2, 2, 0, 0, 8, 2, 2, 2, 2, 2, 2, 2, 8,
0, 0, 5, 1, 1, 1, 5, 0, 0, 8, 2, 2, 2, 2, 2, 2, 2, 8,
0, 2, 2, 2, 5, 2, 2, 2, 0 8, 8, 8, 1, 1, 1, 8, 8, 8
], ],
baseElements: [ baseElements: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 10, 20, 30, 0, 0, 0,
0, 0, 0, 40, 20, 40, 0, 0, 0, 0, 0, 0, 20, 30, 20, 0, 0, 0,
0, 0, 20, 20, 30, 40, 20, 0, 0, 0, 0, 0, 0, 40, 0, 0, 0, 0,
0, 20, 40, 30, 20, 30, 30, 10, 0, 0, 0, 0, 0, 40, 0, 0, 0, 0,
0, 0, 10, 20, 10, 20, 30, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 40, 40, 20, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 20,
0, 0, 0, 0, 0, 0, 0, 0, 0 20, 0, 0, 0, 0, 0, 0, 0, 20,
30, 20, 20, 0, 0, 0, 20, 20, 30
], ],
recycles: [], recycles: [],
generateLats: [ generateLats: [
{ index: 13, type: 0 }, { index: 12, type: null },
{ index: 21, type: 0 }, { index: 13, type: null },
{ index: 23, type: 0 }, { index: 14, type: null },
{ index: 29, type: 0 }, { index: 20, type: null },
{ index: 33, type: 0 }, { index: 24, type: null },
{ index: 37, type: 0 }, { index: 28, type: null },
{ index: 43, type: 0 } { index: 34, type: null },
{ index: 36, type: null },
{ index: 44, type: null }
] ]
} }
} }
] ]
\ No newline at end of file
...@@ -3,13 +3,20 @@ import { Chapters1 } from "./Chapter1"; ...@@ -3,13 +3,20 @@ import { Chapters1 } from "./Chapter1";
import { Chapters2 } from "./Chapter2"; import { Chapters2 } from "./Chapter2";
import { Chapters3 } from "./Chapter3"; import { Chapters3 } from "./Chapter3";
import { Chapters4 } from "./Chapter4"; import { Chapters4 } from "./Chapter4";
import { Chapters5 } from "./Chapter5";
import { PassTargetData } from "../interface/PassTargetData";
import { PassType } from "../enum/PassType";
import { submitTran } from "../enum/ElementType";
import { Chapters6 } from "./Chapter6";
//所有的关卡 //所有的关卡
const chapters: ChapterData[] = [].concat( const chapters: ChapterData[] = [].concat(
Chapters1, Chapters1,
Chapters2, Chapters2,
Chapters3, Chapters3,
Chapters4 Chapters4,
Chapters5,
Chapters6,
) )
/** /**
* 获取关卡数据,返回关卡数据 * 获取关卡数据,返回关卡数据
...@@ -20,3 +27,39 @@ export function getChapterData(index: number): ChapterData { ...@@ -20,3 +27,39 @@ export function getChapterData(index: number): ChapterData {
//没有数据就返回第一关数据 //没有数据就返回第一关数据
return chapters[index] || chapters[1]; return chapters[index] || chapters[1];
} }
var a = {
"levelNum": 102,
"levelTarget": [
{ "targetType": 5, "targetNum": 40 }
],
"oneStarScore": 6000,
"twoStarScore": 15000,
"threeStarScore": 32000
};
(function exportFile(chapters: ChapterData[]) {
var obj = []
for (var i = 1; i < chapters.length; i++) {
var chapter: ChapterData = chapters[i]
var target: PassTargetData = chapter.passTarget
var a: any = {};
a["levelNum"] = i;
a["levelTarget"] = [];
if (target.type == PassType.SCORE_TARGET) {
a["levelTarget"].push({ "targetType": 1, "targetNum": target.score })
} else {
for (var j = 0; j < target.elements.length; j++) {
var element = target.elements[j];
a["levelTarget"].push({ "targetType": submitTran[element.type], "targetNum": element.count })
}
}
a["oneStarScore"] = chapter.starScores[0];
a["twoStarScore"] = chapter.starScores[1];
a["threeStarScore"] = chapter.starScores[2];
obj.push(a)
}
// var file = new File([JSON.stringify(obj)], "cfg.json", { type: "text/plain;charset=utf-8" });
// window["saveAs"](file);
})(chapters)
\ No newline at end of file
/**
* 供重复利用的位图类
* 锚点都移到中心点的
*/
export class BitmapRecycle extends egret.Bitmap {
constructor(texture: egret.Texture) {
super();
this.anchorOffsetX = texture.textureWidth / 2;
this.anchorOffsetY = texture.textureHeight / 2;
}
/**
* 重复利用时重置用
* 其他属性自己设置
*/
reset(texture: egret.Texture) {
this.texture = texture;
this.anchorOffsetX = texture.textureWidth / 2;
this.anchorOffsetY = texture.textureHeight / 2;
this.alpha = this.scaleX = this.scaleY = 1;
this.rotation = 0;
}
}
\ No newline at end of file
...@@ -12,15 +12,16 @@ export enum RecoverName { ...@@ -12,15 +12,16 @@ export enum RecoverName {
SCORE_ANI = "ScoreAni", SCORE_ANI = "ScoreAni",
//目标飞入的图片,没有相应的类,直接用egret.Bitmap //所有单图的Bitmap都用
FLYIMAGE = "flyImage", BITMAPRECYCLE = "BitmapRecycle",
//带回调的动画,和不带的合并不了,因为可能还有其他参数 //带回调的动画,和不带的合并不了,因为可能还有其他参数
BONUSSHOOT_ANI = "BonusShootAni", BONUSSHOOT_ANI = "BonusShootAni",
JELLYSPREAD_ANI = "JellySpreadAni", JELLYSPREAD_ANI = "JellySpreadAni",
PIECETOEGG_ANI = "PieceToEggAni", PIECETOEGG_ANI = "PieceToEggAni",
BUBBLE_ANI = "BubbleAni", BUBBLE_ANI = "BubbleAni",
HAIRBALLBROWNDIVIDE = "HairballBrownDivide", HAIRBALLBROWNDIVIDE_ANI = "HairballBrownDivideAni",
HAIRBALLJUMP_ANI = "HairballJumpAni", //三种毛球是一样的动画
......
/** /**
* 通关类型 * 状态类型
*/ */
export enum StateType { export enum StateType {
LOCK = 0,//锁 BUBBLE = 0,//变色气泡
BUBBLE,//变色气泡 LOCK,//锁
HAIRBALLGREY,//灰色毛球 ,一次就消除 HAIRBALLGREY,//灰色毛球 ,一次就消除
HAIRBALLBROWN,//褐色毛球 ,只能特效消除 HAIRBALLBROWN,//褐色毛球 ,只能特效消除
HAIRBALLBLACK,//黑色毛球 ,两次消除,一次闭眼 HAIRBALLBLACK,//黑色毛球 ,两次消除,一次闭眼
......
...@@ -12,6 +12,7 @@ import { StateType } from "../enum/StateType"; ...@@ -12,6 +12,7 @@ import { StateType } from "../enum/StateType";
import { BubbleAni } from "../anis/BubbleAni"; import { BubbleAni } from "../anis/BubbleAni";
import { Element } from "../class/Element"; import { Element } from "../class/Element";
import { HairballBrownState } from "../states/HairballBrownState"; import { HairballBrownState } from "../states/HairballBrownState";
import { HairballJumpAni } from "../anis/HairballJumpAni";
//孵鸡的数量 //孵鸡的数量
const chickenNum: number = 4 const chickenNum: number = 4
...@@ -413,11 +414,24 @@ export class AiControl { ...@@ -413,11 +414,24 @@ export class AiControl {
let elementEnd = thisObj.lattices[indexEnd].element; let elementEnd = thisObj.lattices[indexEnd].element;
//变成毛球 //变成毛球
elementEnd.setState(stateType, true); elementEnd.setState(stateType, true);
//动画 //先隐藏
setTimeout(() => { elementEnd.getState(stateType).visible = false;
//跳动动画
let jumpAni: HairballJumpAni = Pool.takeOut(RecoverName.HAIRBALLJUMP_ANI)
if (!jumpAni) jumpAni = new HairballJumpAni()
thisObj.addChild(jumpAni);
jumpAni.play(stateType, Tool.getPositionByIndex(indexFrom), Tool.getPositionByIndex(indexEnd), () => {
//显示
elementEnd.getState(stateType).visible = true;
//都执行了 //都执行了
if (++countJump == countJumpAll) callbackOperation(); if (++countJump == countJumpAll) callbackOperation();
}, 200); })
// setTimeout(()=>{
// //都执行了
// if (++countJump == countJumpAll) callbackOperation();
// },200)
} }
//没有则计数 //没有则计数
else { else {
......
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