bundle.js 197 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644
  1. var laya = (function (exports) {
  2. 'use strict';
  3. class GameConfig {
  4. constructor() { }
  5. static init() {
  6. var reg = Laya.ClassUtils.regClass;
  7. }
  8. }
  9. GameConfig.width = 720;
  10. GameConfig.height = 1280;
  11. GameConfig.scaleMode = "fixedwidth";
  12. GameConfig.screenMode = "none";
  13. GameConfig.alignV = "top";
  14. GameConfig.alignH = "left";
  15. GameConfig.startScene = "MainScene.scene";
  16. GameConfig.sceneRoot = "";
  17. GameConfig.debug = false;
  18. GameConfig.stat = false;
  19. GameConfig.physicsDebug = false;
  20. GameConfig.exportSceneToJson = true;
  21. GameConfig.init();
  22. class CheckMain {
  23. }
  24. CheckMain.Creat = false;
  25. class Main {
  26. constructor() {
  27. if (CheckMain.Creat)
  28. return;
  29. CheckMain.Creat = true;
  30. if (window["Laya3D"])
  31. Laya3D.init(GameConfig.width, GameConfig.height);
  32. else
  33. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  34. Laya["Physics"] && Laya["Physics"].enable();
  35. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  36. Laya.stage.scaleMode = GameConfig.scaleMode;
  37. Laya.stage.screenMode = GameConfig.screenMode;
  38. Laya.stage.alignV = GameConfig.alignV;
  39. Laya.stage.alignH = GameConfig.alignH;
  40. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  41. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  42. Laya.enableDebugPanel();
  43. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  44. Laya["PhysicsDebugDraw"].enable();
  45. if (GameConfig.stat)
  46. Laya.Stat.show();
  47. Laya.alertGlobalError = true;
  48. if (Laya.Browser.onWeiXin) {
  49. Laya.Browser.window.wx.showShareMenu({
  50. withShareTicket: true
  51. });
  52. Laya.Browser.window.wx.onShareAppMessage(function () {
  53. return {
  54. title: "试一下你的脑力能到第几关",
  55. imageUrl: "Game/res/Share/fx.png",
  56. };
  57. });
  58. Laya.Browser.window.wx.onShow((option) => {
  59. var shareTicket = option.shareTicket;
  60. var userId = option.query.userId;
  61. var shareTitle = option.query.shareTitle;
  62. Main.SceneNum = option.scene;
  63. WXSDK.querychannel = option.query.channel;
  64. WXSDK.shareOpenId = option.query.userId;
  65. console.log("option---", option);
  66. console.log("scene:", option.scene);
  67. if (WXSDK.querychannel != null) {
  68. console.log("onShow channel is:", WXSDK.querychannel);
  69. }
  70. if (option.referrerInfo) {
  71. WXSDK.referrerInfoappId = option.referrerInfo.appId;
  72. console.log("onShow appId is:", option.referrerInfo.appId);
  73. }
  74. });
  75. const updateManager = Laya.Browser.window.wx.getUpdateManager();
  76. updateManager.onCheckForUpdate(function (res) {
  77. console.log("最新版本:" + res.hasUpdate);
  78. });
  79. updateManager.onUpdateReady(function () {
  80. Laya.Browser.window.wx.showModal({
  81. showCancel: false,
  82. title: '更新提示',
  83. content: '新版本已经准备好,是否重启应用?',
  84. success(res) {
  85. updateManager.applyUpdate();
  86. },
  87. fail(res) {
  88. updateManager.applyUpdate();
  89. }
  90. });
  91. });
  92. }
  93. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  94. }
  95. onVersionLoaded() {
  96. Laya.AtlasInfoManager.enable("fileconfig.json", Laya.Handler.create(this, this.onConfigLoaded));
  97. }
  98. onConfigLoaded() {
  99. new LoadView();
  100. }
  101. }
  102. Main.Ver = "1.0.3";
  103. Main.CFG = "123";
  104. Main.SceneNum = "000";
  105. new Main();
  106. var AccountUser;
  107. (function (AccountUser) {
  108. AccountUser[AccountUser["buyed_kun"] = 0] = "buyed_kun";
  109. AccountUser[AccountUser["diamond"] = 1] = "diamond";
  110. AccountUser[AccountUser["equip_themes"] = 2] = "equip_themes";
  111. AccountUser[AccountUser["favorite_times"] = 3] = "favorite_times";
  112. AccountUser[AccountUser["game_times"] = 4] = "game_times";
  113. AccountUser[AccountUser["get_themes"] = 5] = "get_themes";
  114. AccountUser[AccountUser["list_kun"] = 6] = "list_kun";
  115. AccountUser[AccountUser["moeny"] = 7] = "moeny";
  116. AccountUser[AccountUser["progress_themes"] = 8] = "progress_themes";
  117. AccountUser[AccountUser["revival"] = 9] = "revival";
  118. AccountUser[AccountUser["stage"] = 10] = "stage";
  119. })(AccountUser || (AccountUser = {}));
  120. class PlayerData {
  121. constructor(_token, _config, _appSetting, _user, _userbase, _useInvite, _user_stage = null, _user_sign, _user_achievement, lottery) {
  122. this.openid = "";
  123. this.userId = "";
  124. this.jianglidic = {};
  125. this.shitidic = {};
  126. this.chengjiuliebiao = {};
  127. this.zhengshu = _token;
  128. this.netzheshe = _appSetting;
  129. this.account = _user;
  130. this.accountssss = _userbase;
  131. this.qiandao = _user_sign;
  132. this.renwu = _user_achievement;
  133. this.userId = this.account["user_id"];
  134. this.openid = this.accountssss["openid"];
  135. this.m_invite = _useInvite;
  136. this.lottery = lottery;
  137. console.log("user_id:" + this.userId);
  138. }
  139. GainCollocation(_type) {
  140. return this.peizhis[_type];
  141. }
  142. GainAccount(_type) {
  143. return this.account[_type];
  144. }
  145. get fenxiang() {
  146. return this.netzheshe["share"] == "1";
  147. }
  148. get fenxiangneirong() {
  149. return this.netzheshe["sharecontent"];
  150. }
  151. get fuhuocishu() {
  152. return Number(this.netzheshe["revivenum"]);
  153. }
  154. get wudishijian() {
  155. return Number(this.netzheshe["Invincibletime"]);
  156. }
  157. get wudaoshijian() {
  158. return Number(this.netzheshe["cheattime"]);
  159. }
  160. get banner() {
  161. return this.netzheshe["banner"] == "1";
  162. }
  163. get video() {
  164. return this.netzheshe["video"] == "1";
  165. }
  166. get wudao() {
  167. return this.netzheshe["cheat"] == "1";
  168. }
  169. get jiancechangjin() {
  170. return this.netzheshe["checkscence"] == 1;
  171. }
  172. get reviverate() {
  173. return Number(this.netzheshe["revive"]);
  174. }
  175. get uintid() {
  176. return this.netzheshe["uintid"];
  177. }
  178. get music() {
  179. return this.netzheshe["music"] == "1";
  180. }
  181. get skin() {
  182. return this.netzheshe["skinget"] == "1";
  183. }
  184. get aicheatspeed() {
  185. return Number(this.netzheshe["aicheatspeed"]);
  186. }
  187. get aispeedtime() {
  188. return Number(this.netzheshe["aispeedtime"]);
  189. }
  190. get videoshare() {
  191. return this.netzheshe["videoshare"] == "1";
  192. }
  193. get trial() {
  194. return this.netzheshe["trial"] == "1";
  195. }
  196. get invite() {
  197. return this.netzheshe["invite"] == 1;
  198. }
  199. get re() {
  200. return this.netzheshe["re"] == 1;
  201. }
  202. get autosign() {
  203. return this.netzheshe["autosign"] == 1;
  204. }
  205. get showgift() {
  206. return this.netzheshe["showgift"] == 1;
  207. }
  208. get showshop() {
  209. return this.netzheshe["showshop"] == 1;
  210. }
  211. get lotteryTimer() {
  212. if (this.netzheshe["lotteryTimer"])
  213. return Number(this.netzheshe["lotteryTimer"]);
  214. return 0;
  215. }
  216. get falldownline() {
  217. return this.netzheshe["FallDownLine"];
  218. }
  219. get Restitution() {
  220. return this.netzheshe["restitution"];
  221. }
  222. get MergeSpeed() {
  223. return this.netzheshe["MergeSpeed"];
  224. }
  225. get CheckLose() {
  226. return this.netzheshe["CheckLose"];
  227. }
  228. get Save() {
  229. return this.netzheshe["Save"];
  230. }
  231. get GuideHeight() {
  232. return this.netzheshe["GuideHeight"];
  233. }
  234. get ShakeNum() {
  235. return this.netzheshe["ShakeNum"];
  236. }
  237. get Distance() {
  238. return this.netzheshe["Distance"];
  239. }
  240. get touchsize() {
  241. return Number(this.netzheshe["touchsize"]);
  242. }
  243. get touchsmoothness() {
  244. return Number(this.netzheshe["touchsmoothness"]);
  245. }
  246. GainQinDao(_key) {
  247. return this.qiandao[_key];
  248. }
  249. GainShiTi(_key, shuxing) {
  250. return this.shitidic[_key][shuxing];
  251. }
  252. GainJiangLi(_rewardid) {
  253. var reward = this.jianglidic[_rewardid];
  254. return reward;
  255. }
  256. GetPropNum(_index) {
  257. var type = this.account["functions"];
  258. var num = type[_index.toString()];
  259. if (num) {
  260. return num;
  261. }
  262. else {
  263. return 0;
  264. }
  265. }
  266. HasRole(_id) {
  267. var data = this.GainAccount("get_themes");
  268. for (var i = 0; i < data.length; i++) {
  269. var hd = data[i];
  270. if (_id == hd) {
  271. return true;
  272. }
  273. }
  274. return false;
  275. }
  276. HasGun(_id) {
  277. var data = this.GainAccount("functions");
  278. for (var i = 0; i < data.length; i++) {
  279. var hd = data[i];
  280. if (_id == hd) {
  281. return true;
  282. }
  283. }
  284. return false;
  285. }
  286. GetProgress(_id) {
  287. var config = this.account["progress_themes"];
  288. var progress = config[_id] ? config[_id] : 0;
  289. return progress;
  290. }
  291. GetJiangLiLieBiao() {
  292. var peiz = this.GainCollocation("rewards");
  293. for (var key in peiz) {
  294. this.jianglidic[peiz[key].id] = peiz[key];
  295. }
  296. }
  297. GetShiTiLieBiao() {
  298. var peiz = this.GainCollocation("entity");
  299. for (var key in peiz) {
  300. this.shitidic[peiz[key].entity_id] = peiz[key];
  301. }
  302. }
  303. GetChengJiuLieBiao() {
  304. var shujiu = this.GainCollocation("achievement");
  305. var aadsadsdas = {};
  306. for (var key1 in shujiu) {
  307. var type1 = shujiu[key1].type;
  308. if (aadsadsdas[type1]) {
  309. continue;
  310. }
  311. var fasas = [];
  312. for (var key2 in shujiu) {
  313. var type2 = shujiu[key2].type;
  314. if (type1 == type2) {
  315. fasas.push(shujiu[key2]);
  316. }
  317. }
  318. aadsadsdas[type1] = fasas;
  319. }
  320. this.chengjiuliebiao = aadsadsdas;
  321. }
  322. }
  323. var HttpRequest = Laya.HttpRequest;
  324. var Event = Laya.Event;
  325. const BlastToMergeApi = "https://btmapi.xwxgame.com/";
  326. class BlastToMerge {
  327. }
  328. BlastToMerge.DengLu = "user/login";
  329. BlastToMerge.KaiShi = "game/start";
  330. BlastToMerge.JieShu = "game/play";
  331. BlastToMerge.Use = "game/use";
  332. BlastToMerge.GetProgress = "game/progress";
  333. BlastToMerge.Save = "game/save";
  334. BlastToMerge.WithDraw = "qtt/withdraw";
  335. BlastToMerge.CheckCoin = "qtt/balance";
  336. BlastToMerge.GetCoin = "qtt/rewards";
  337. BlastToMerge.QianDao = "sign/sign";
  338. BlastToMerge.Chengjiu = "achievement/getRewards";
  339. BlastToMerge.Config = "config/table";
  340. BlastToMerge.FenXiang = "fission/share";
  341. BlastToMerge.LiXian = "fission/offline";
  342. BlastToMerge.vd = "fission/vd";
  343. BlastToMerge.FuHuo = "game/revival";
  344. BlastToMerge.gadagdag = "treasure/click";
  345. BlastToMerge.Invite = "invite/getRewards";
  346. BlastToMerge.Lottery = "lottery/lottery";
  347. BlastToMerge.ShareGetSkin = "theme/fission";
  348. BlastToMerge.WearEquip = "theme/equip";
  349. BlastToMerge.BuyEquip = "theme/buy";
  350. BlastToMerge.ShouQuan = "user/auth";
  351. BlastToMerge.JinBi = "user/sync";
  352. class ServerManager {
  353. constructor() { }
  354. static get Instance() {
  355. if (ServerManager.ins) {
  356. return ServerManager.ins;
  357. }
  358. else {
  359. return new ServerManager();
  360. }
  361. }
  362. Login(progresscb, completecb, errorcb) {
  363. var Account = AccountManager.Instance;
  364. var ver = Main.Ver;
  365. let Data = `code=${Account.code}&nickname=${Account.nickName}&avatar=${Account.avatarUrl}&gender=${Account.gender}&country=${Account.country}&province=${Account.province}&city=${Account.city}& device=${Account.device}$&share_id=${Account.share_id}&scene=${Account.scene}&v=${ver}`;
  366. let httpRequest = new HttpRequest();
  367. httpRequest.once(Event.PROGRESS, this, this.Progress, [progresscb, httpRequest]);
  368. httpRequest.once(Event.COMPLETE, this, this.Complete, [completecb, httpRequest]);
  369. httpRequest.once(Event.ERROR, this, this.Errorcb, [errorcb, httpRequest]);
  370. httpRequest.send(BlastToMergeApi + BlastToMerge.DengLu, Data, "post", "text");
  371. }
  372. Progress(_progresscb, _httpreq) {
  373. if (_progresscb) {
  374. _progresscb.run();
  375. }
  376. }
  377. Complete(_completecb, _httpreq) {
  378. let data = JSON.parse(_httpreq.data);
  379. console.log(data);
  380. if (data["code"] != "0") {
  381. console.log("登录异常错误!错误信息sssssssss:", _httpreq.data["code"]);
  382. return;
  383. }
  384. console.log("-----------sss", data["t"]);
  385. AccountManager.Instance.SFSFSF = data["t"];
  386. this.RessetConfig(data, _completecb);
  387. }
  388. RessetConfig(data, completecb) {
  389. AccountManager.Instance.ReSetting(data, (flag) => {
  390. if (flag) {
  391. completecb.runWith(data);
  392. }
  393. else {
  394. this.RessetConfig(data, completecb);
  395. }
  396. });
  397. }
  398. Errorcb(_errorcb, _httpreq) {
  399. if (_errorcb != null) {
  400. _errorcb.runWith(_httpreq);
  401. }
  402. }
  403. SendHttp(protocol, param, completecb, errorcb, hasToken = true) {
  404. let sfaasfsfa = "";
  405. let daadsads = BlastToMergeApi + protocol;
  406. if (hasToken == true) {
  407. sfaasfsfa = `token=${AccountManager.Instance.curplayerData.zhengshu}&`;
  408. }
  409. if (protocol == BlastToMerge.KaiShi || protocol == BlastToMerge.JieShu || protocol == BlastToMerge.vd || protocol == BlastToMerge.Lottery) {
  410. let asddsa = "abcdefghijkimnopqrstuvwxyz0123456789";
  411. let adsassda = "{";
  412. let saafsafs = "";
  413. for (let i = 0; i < 4; i++) {
  414. saafsafs += asddsa[Math.floor(Math.random() * 100) % asddsa.length];
  415. }
  416. for (let i = 0; i < param.length; i++) {
  417. for (let key in param[i]) {
  418. adsassda += `\"${key}\":\"${param[i][key]}\"`;
  419. }
  420. if (i < param.length - 1) {
  421. adsassda += ",";
  422. }
  423. else {
  424. adsassda += "}";
  425. }
  426. }
  427. sfaasfsfa += "_r=" + saafsafs + this.SFGSGSG(adsassda);
  428. }
  429. else {
  430. if (param != null) {
  431. for (let i = 0; i < param.length; i++) {
  432. for (let key in param[i]) {
  433. let val = param[i][key];
  434. sfaasfsfa += `${key}=${val}`;
  435. if (i < param.length - 1) {
  436. sfaasfsfa += "&";
  437. }
  438. }
  439. }
  440. }
  441. }
  442. let httpRequest = new HttpRequest();
  443. httpRequest.once(Event.COMPLETE, this, this.onHttpRequestComplete, [completecb, errorcb, httpRequest]);
  444. httpRequest.once(Event.ERROR, this, this.Errorcb, [errorcb, httpRequest]);
  445. httpRequest.send(daadsads, sfaasfsfa, "post", "text");
  446. }
  447. onHttpRequestComplete(succeedcb, failurecb, httpRequest) {
  448. let data = JSON.parse(httpRequest.data);
  449. if (data["code"] == 0) {
  450. AccountManager.Instance.ReSetting(data);
  451. if (succeedcb != null) {
  452. succeedcb.runWith(data);
  453. }
  454. }
  455. else {
  456. if (failurecb != null) {
  457. failurecb.runWith(data);
  458. }
  459. console.log("Error! Http request complete error, code: " + data["code"] + " message: " + data["message"]);
  460. }
  461. }
  462. SFGSGSG(str) {
  463. var c1, c2, c3;
  464. var SFSFFSFSFSFS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  465. var i = 0, len = str.length, SFFSSFFS = '';
  466. while (i < len) {
  467. c1 = str.charCodeAt(i++) & 0xff;
  468. if (i == len) {
  469. SFFSSFFS += SFSFFSFSFSFS.charAt(c1 >> 2);
  470. SFFSSFFS += SFSFFSFSFSFS.charAt((c1 & 0x3) << 4);
  471. SFFSSFFS += "==";
  472. break;
  473. }
  474. c2 = str.charCodeAt(i++);
  475. if (i == len) {
  476. SFFSSFFS += SFSFFSFSFSFS.charAt(c1 >> 2);
  477. SFFSSFFS += SFSFFSFSFSFS.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
  478. SFFSSFFS += SFSFFSFSFSFS.charAt((c2 & 0xF) << 2);
  479. SFFSSFFS += "=";
  480. break;
  481. }
  482. c3 = str.charCodeAt(i++);
  483. SFFSSFFS += SFSFFSFSFSFS.charAt(c1 >> 2);
  484. SFFSSFFS += SFSFFSFSFSFS.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
  485. SFFSSFFS += SFSFFSFSFSFS.charAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >> 6));
  486. SFFSSFFS += SFSFFSFSFSFS.charAt(c3 & 0x3F);
  487. }
  488. return SFFSSFFS;
  489. }
  490. }
  491. class AccountManager {
  492. constructor(_code, _userinfo, _nickname, _avatarurl, _gender, _province, _city, _country, _device, _shareid, _scene, _v) {
  493. this.createTime = Laya.timer.currTimer;
  494. AccountManager.ins = this;
  495. this.code = _code;
  496. this.userInfo = _userinfo;
  497. this.nickName = _nickname;
  498. this.avatarUrl = _avatarurl;
  499. this.gender = _gender;
  500. this.province = _province;
  501. this.city = _city;
  502. this.country = _country;
  503. this.device = _device;
  504. this.share_id = _shareid;
  505. this.scene = _scene;
  506. this.v = _v;
  507. }
  508. static get Instance() {
  509. if (AccountManager.ins == null) {
  510. new AccountManager("222222", "你找谁?", "1233", "123", 1, "中国", "上海", "上海", "iphone6s", "123", "123", "123");
  511. }
  512. return AccountManager.ins;
  513. }
  514. ReSetting(data, cb = null) {
  515. var zhengshu = data["token"];
  516. var netset = data["app_setting"];
  517. var user = data["user"];
  518. var jichu = data["user_base"];
  519. var qiandao = data["user_sign"];
  520. var chengjiu = data["user_achievement"];
  521. var invite = data["user_invite"];
  522. var lottery = data["user_lottery"];
  523. if (this.curplayerData == null) {
  524. this.curplayerData = new PlayerData(zhengshu, null, netset, user, jichu, invite, null, qiandao, chengjiu, lottery);
  525. this.JundgCfg(data.table_version, cb);
  526. }
  527. else {
  528. if (netset) {
  529. this.curplayerData.netzheshe = netset;
  530. }
  531. if (user) {
  532. this.curplayerData.account = user;
  533. }
  534. if (jichu) {
  535. this.curplayerData.accountssss = jichu;
  536. }
  537. if (qiandao) {
  538. this.curplayerData.qiandao = qiandao;
  539. }
  540. if (chengjiu) {
  541. this.curplayerData.renwu = chengjiu;
  542. }
  543. }
  544. }
  545. JundgCfg(ver, callball) {
  546. var cfg = Laya.LocalStorage.getJSON(Main.CFG);
  547. if (cfg) {
  548. if (cfg.VER == ver) {
  549. console.log("已经拥有,不用更新");
  550. this.SetCfg(cfg);
  551. if (callball)
  552. callball(true);
  553. }
  554. else {
  555. console.log("cfg存在但是过期了");
  556. Laya.LocalStorage.removeItem(Main.CFG);
  557. ServerManager.Instance.SendHttp(BlastToMerge.Config, null, Laya.Handler.create(this, (data) => {
  558. data.configs.VER = ver;
  559. Laya.LocalStorage.setJSON(Main.CFG, data.configs);
  560. this.SetCfg(data.configs);
  561. if (callball)
  562. callball(true);
  563. }), Laya.Handler.create(this, (data) => {
  564. console.log("配置获取失败" + data);
  565. if (callball)
  566. callball(false);
  567. return;
  568. }));
  569. }
  570. }
  571. else {
  572. console.log("本地没有cfg");
  573. ServerManager.Instance.SendHttp(BlastToMerge.Config, null, Laya.Handler.create(this, (data) => {
  574. data.configs.VER = ver;
  575. Laya.LocalStorage.setJSON(Main.CFG, data.configs);
  576. this.SetCfg(data.configs);
  577. if (callball)
  578. callball(true);
  579. }), Laya.Handler.create(this, (data) => {
  580. console.log("配置获取失败" + data);
  581. }));
  582. }
  583. }
  584. SetCfg(data) {
  585. this.curplayerData.peizhis = data;
  586. this.curplayerData.GetJiangLiLieBiao();
  587. this.curplayerData.GetShiTiLieBiao();
  588. this.curplayerData.GetChengJiuLieBiao();
  589. }
  590. RessetConfig() {
  591. ServerManager.Instance.SendHttp(BlastToMerge.Config, null, Laya.Handler.create(this, (data) => {
  592. this.curplayerData.peizhis = data["configs"];
  593. this.curplayerData.GetJiangLiLieBiao();
  594. this.curplayerData.GetShiTiLieBiao();
  595. this.curplayerData.GetChengJiuLieBiao();
  596. }), null);
  597. }
  598. get ServerTime() {
  599. let time = Laya.timer.currTimer;
  600. let stime = this.SFSFSF + Math.ceil((time - this.createTime) / 1000);
  601. return stime;
  602. }
  603. }
  604. class RankPan {
  605. constructor() {
  606. this.Width = 0;
  607. this.Height = 0;
  608. this.shareCanvas = Laya.Browser.window.sharedCanvas;
  609. this.ShareSprite = new Laya.Sprite();
  610. this.ShareSprite.zOrder = 1008;
  611. this.ShareSprite.pos(0, 0);
  612. this.ShareSprite.cacheAs = "normal";
  613. Laya.stage.addChild(this.ShareSprite);
  614. this.SSSS = new Laya.Texture2D();
  615. this.TTTT = new Laya.Texture(this.SSSS);
  616. }
  617. ShuShi(_width = 720, _heigth = 1280) {
  618. this.Width = Laya.stage.width;
  619. this.Height = Laya.stage.height;
  620. this.shareCanvas.width = _width;
  621. this.shareCanvas.height = _heigth;
  622. }
  623. open() {
  624. Laya.timer.frameLoop(10, this, this.gengxin);
  625. this.ShareSprite.visible = true;
  626. }
  627. close() {
  628. Laya.timer.clear(this, this.gengxin);
  629. this.ShareSprite.visible = false;
  630. }
  631. gengxin() {
  632. this.HuaTu();
  633. }
  634. HuaTu() {
  635. this.SSSS.loadImageSource(this.shareCanvas);
  636. this.TTTT.setTo(this.SSSS);
  637. this.ShareSprite.graphics.clear();
  638. this.ShareSprite.graphics.drawTexture(this.TTTT, 0, 0, this.TTTT.width, this.TTTT.height);
  639. }
  640. draw2d() {
  641. this.AAAA.drawImage(this.shareCanvas, 0, 0, this.shareCanvas.width, this.shareCanvas.height);
  642. }
  643. }
  644. class RankSDK {
  645. constructor() { }
  646. static ShuShi() {
  647. if (!Laya.Browser.onWeiXin)
  648. return;
  649. this.SetScreen();
  650. this.RankPan = new RankPan();
  651. this.RankPan.ShuShi();
  652. }
  653. static OpenRank(keyName = "Level") {
  654. if (Laya.Browser.onWeiXin) {
  655. this.Send(keyName, "show_friend_rank");
  656. console.log("打开排行榜---openrank");
  657. }
  658. }
  659. static Leftpe() {
  660. if (Laya.Browser.onWeiXin)
  661. this.Send("", "show_up_page");
  662. }
  663. static Rightpe() {
  664. if (Laya.Browser.onWeiXin)
  665. this.Send("", "show_next_page");
  666. }
  667. static OpenPan() {
  668. console.log("Laya.Browser.onWeiXin", Laya.Browser.onWeiXin);
  669. if (Laya.Browser.window.wx)
  670. this.RankPan.open();
  671. }
  672. static ClosePan() {
  673. if (Laya.Browser.onWeiXin)
  674. this.RankPan.close();
  675. }
  676. static SetScreen() {
  677. if (!Laya.Browser.onWeiXin)
  678. return;
  679. let width = Laya.stage.width;
  680. let height = Laya.stage.height;
  681. let data = { width: width, height: height };
  682. this.Send("", "canvase_width_height", data);
  683. }
  684. static Send(keyName, action, data) {
  685. console.log("消息发送成功0---send");
  686. Laya.Browser.window.wx.postMessage({
  687. keyName: keyName,
  688. action: action,
  689. data: data
  690. });
  691. console.log("消息发送成功---send");
  692. }
  693. static SetStage(keyName, value, callBack = null) {
  694. let obj = [{
  695. key: keyName,
  696. value: value
  697. }];
  698. Laya.Browser.window.wx.setUserCloudStorage({
  699. KVDataList: obj,
  700. success: function (res) {
  701. console.log("数据上传成功" + res);
  702. if (callBack) {
  703. callBack();
  704. }
  705. },
  706. fail: function (res) {
  707. console.log("数据上传失败" + res);
  708. if (callBack) {
  709. callBack();
  710. }
  711. }
  712. });
  713. }
  714. }
  715. class WXSDK {
  716. constructor() {
  717. WXSDK.ins = this;
  718. }
  719. static get Instance() {
  720. if (WXSDK.ins) {
  721. return WXSDK.ins;
  722. }
  723. else {
  724. return new WXSDK();
  725. }
  726. }
  727. static Init() {
  728. Laya.Browser.window.wx.showShareMenu({
  729. withShareTicket: true
  730. });
  731. Laya.Browser.window.wx.onShareAppMessage(function () {
  732. return {
  733. title: "",
  734. imageUrl: "gameResources/res/share/sharepictrue.png",
  735. };
  736. });
  737. Laya.Browser.window.wx.onShow((option) => {
  738. var shareTicket = option.shareTicket;
  739. var userId = option.query.userId;
  740. var shareTitle = option.query.shareTitle;
  741. Main.SceneNum = option.scene;
  742. WXSDK.querychannel = option.query.channel;
  743. WXSDK.shareOpenId = option.query.userId;
  744. console.log("option---", option);
  745. console.log("scene:", option.scene);
  746. if (WXSDK.querychannel != null) {
  747. console.log("onShow channel is:", WXSDK.querychannel);
  748. }
  749. if (option.referrerInfo) {
  750. WXSDK.referrerInfoappId = option.referrerInfo.appId;
  751. console.log("onShow appId is:", option.referrerInfo.appId);
  752. }
  753. });
  754. }
  755. static DengLu(_complete) {
  756. var that = this;
  757. Laya.Browser.window.wx.login({
  758. success: function (res) {
  759. if (res.code) {
  760. console.log("微信登陆成功----");
  761. that.codeValue = res.code;
  762. RankSDK.ShuShi();
  763. console.log("shareid:" + WXSDK.shareOpenId);
  764. new AccountManager(res.code, "", "", "", 0, "", "", "", "", WXSDK.shareOpenId, WXSDK.shareOpenId, Main.Ver);
  765. _complete(res);
  766. }
  767. else {
  768. WXSDK.DengLu(WXSDK.DengLu);
  769. console.log('wx no code' + res.errMsg);
  770. }
  771. },
  772. fail: function (res) { console.log("wx.login: failed, res=" + res); }
  773. });
  774. }
  775. static ShowTxt(text) {
  776. if (Laya.Browser.window.wx) {
  777. Laya.Browser.window.wx.showToast({ title: text });
  778. }
  779. else {
  780. console.log(text);
  781. }
  782. }
  783. static ShortShake() {
  784. Laya.Browser.window.wx.vibrateShort({});
  785. }
  786. static LongShake() {
  787. Laya.Browser.window.wx.vibrateLong({});
  788. }
  789. static Shake(_short = true) {
  790. if (Laya.Browser.onWeiXin && WXSDK.shake) {
  791. if (_short) {
  792. this.ShortShake();
  793. }
  794. else {
  795. this.LongShake();
  796. }
  797. }
  798. }
  799. static LoadSubPackage(name, _complete) {
  800. if (Laya.Browser.onWeiXin) {
  801. const loadTask = Laya.Browser.window.wx.loadSubpackage({
  802. name: 'Game',
  803. success: function (res) {
  804. _complete && _complete(true);
  805. console.log("分包加载成功");
  806. },
  807. fail: function (res) {
  808. _complete && _complete(false);
  809. console.log("分包加载失败");
  810. }
  811. });
  812. }
  813. else {
  814. console.log("未进行分包加载");
  815. _complete && _complete(true);
  816. }
  817. }
  818. static UpdateScore(_level) {
  819. var kvDataList = new Array();
  820. let date = new Date().getTime();
  821. var myValue = JSON.stringify({
  822. "wxgame": {
  823. "Level": _level,
  824. "update_time": date.toString(),
  825. }
  826. });
  827. kvDataList.push({ key: "Level", value: myValue });
  828. if (Laya.Browser.onWeiXin) {
  829. Laya.Browser.window.wx.setUserCloudStorage({
  830. KVDataList: kvDataList,
  831. success: r => {
  832. console.log("KVDATALIST---", kvDataList);
  833. console.log("上传分数成功:" + _level);
  834. }
  835. });
  836. }
  837. }
  838. IsNeedUpdate() {
  839. if (!Laya.Browser.onWeiXin)
  840. return;
  841. const updateManager = Laya.Browser.window.wx.getUpdateManager();
  842. updateManager.onCheckForUpdate(function (res) {
  843. console.log("最新版本:" + res.hasUpdate);
  844. });
  845. updateManager.onUpdateReady(function () {
  846. Laya.Browser.window.wx.showModal({
  847. showCancel: false,
  848. title: '更新提示',
  849. content: '新版本已经准备好,是否重启应用?',
  850. success(res) {
  851. updateManager.applyUpdate();
  852. },
  853. fail(res) {
  854. updateManager.applyUpdate();
  855. }
  856. });
  857. });
  858. }
  859. }
  860. WXSDK.codeValue = "";
  861. WXSDK.shareOpenId = "";
  862. WXSDK.openId = 0;
  863. WXSDK.shareScene = "";
  864. WXSDK.uid = "123";
  865. WXSDK.querychannel = "";
  866. WXSDK.referrerInfoappId = "";
  867. WXSDK.shake = true;
  868. var REG = Laya.ClassUtils.regClass;
  869. var ui;
  870. (function (ui) {
  871. class FailureViewUI extends Laya.Scene {
  872. constructor() { super(); }
  873. createChildren() {
  874. super.createChildren();
  875. this.createView(FailureViewUI.uiView);
  876. }
  877. }
  878. FailureViewUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "var": "BG", "top": 0, "skin": "WinView/black.png", "sizeGrid": "12,14,14,13", "right": 0, "left": 0, "bottom": 0 }, "compId": 8 }, { "type": "Image", "props": { "y": 525, "x": 360, "width": 720, "skin": "ReviveView/fuhuo-1-1.png", "height": 994, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 5, "child": [{ "type": "Image", "props": { "y": 252, "x": 285, "skin": "FailureView/shibai-1-1.png" }, "compId": 4 }, { "type": "Button", "props": { "y": 506, "x": 360, "var": "BackBtn", "stateNum": 1, "skin": "FailureView/shibai-1-2.png", "anchorY": 0.5, "anchorX": 0.5 }, "compId": 6 }, { "type": "Button", "props": { "y": 627, "x": 360, "var": "TryBtn", "stateNum": 1, "skin": "FailureView/shibai-1-3.png", "anchorY": 0.5, "anchorX": 0.5 }, "compId": 7 }] }], "loadList": ["WinView/black.png", "ReviveView/fuhuo-1-1.png", "FailureView/shibai-1-1.png", "FailureView/shibai-1-2.png", "FailureView/shibai-1-3.png"], "loadList3D": [] };
  879. ui.FailureViewUI = FailureViewUI;
  880. REG("ui.FailureViewUI", FailureViewUI);
  881. class GetRewardViewUI extends Laya.Scene {
  882. constructor() { super(); }
  883. createChildren() {
  884. super.createChildren();
  885. this.createView(GetRewardViewUI.uiView);
  886. }
  887. }
  888. GetRewardViewUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 488, "x": 360, "width": 696, "skin": "WinView/guoguan-1-7.png", "pivotY": 376, "pivotX": 348, "height": 720 }, "compId": 3, "child": [{ "type": "Image", "props": { "y": 182, "x": 328, "width": 126, "var": "skillicon", "pivotY": 62, "pivotX": 63, "height": 124 }, "compId": 4 }, { "type": "Text", "props": { "y": 440, "x": 347, "width": 433, "var": "des1", "valign": "middle", "text": "获得二倍道具", "pivotY": 44, "pivotX": 217, "height": 88, "fontSize": 40, "align": "center", "runtime": "laya.display.Text" }, "compId": 6 }, { "type": "Text", "props": { "y": 536, "x": 347, "width": 435, "var": "des2", "valign": "middle", "text": "将一个球变为2倍", "pivotY": 44, "pivotX": 218, "height": 88, "fontSize": 40, "align": "center", "runtime": "laya.display.Text" }, "compId": 7 }] }, { "type": "Button", "props": { "y": 759, "x": 360, "width": 264, "var": "GetBtn", "stateNum": 1, "skin": "WinView/guoguan-1-6.png", "pivotY": 53, "pivotX": 132, "height": 106 }, "compId": 5 }], "loadList": ["WinView/guoguan-1-7.png", "WinView/guoguan-1-6.png"], "loadList3D": [] };
  889. ui.GetRewardViewUI = GetRewardViewUI;
  890. REG("ui.GetRewardViewUI", GetRewardViewUI);
  891. class InGameSceneUI extends Laya.Scene {
  892. constructor() { super(); }
  893. createChildren() {
  894. super.createChildren();
  895. this.createView(InGameSceneUI.uiView);
  896. }
  897. }
  898. InGameSceneUI.uiView = { "type": "Scene", "props": { "width": 720, "pref": "@Prefab:Pr", "height": 1280, "autoDestroyAtClosed": true }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 892, "x": 0, "width": 729, "visible": true, "var": "BottomCollider", "skin": "InGameView/colliderbottom.png", "scaleY": 1, "scaleX": 1, "name": "BottomCollider", "height": 211, "bottom": 177, "alpha": 1 }, "compId": 58, "child": [{ "type": "Script", "props": { "points": "-2,-1,78,-1,78,65,83,81,110,108,147,129,190,145,248,157,291,164,353,166,423,164,486,156,551,139,596,119,626,96,642,72,643,0,732,0", "runtime": "laya.physics.ChainCollider" }, "compId": 200 }, { "type": "Script", "props": { "type": "static", "runtime": "laya.physics.RigidBody" }, "compId": 201 }] }, { "type": "Image", "props": { "y": 937, "x": 720, "width": 82, "var": "RightCollider", "skin": "InGameView/0.png", "pivotY": 939, "pivotX": 79, "name": "RightCollider", "height": 957, "alpha": 1 }, "compId": 55, "child": [{ "type": "Script", "props": { "y": 0, "x": 0, "points": "230,-454,82,-1,81,1404,2,1405,0,716,1,631,0,571,7,478,23,332,31,235,32,191,31,169,34,143,39,121,49,81,58,36,61,-1,84,0", "runtime": "laya.physics.ChainCollider" }, "compId": 195 }, { "type": "Script", "props": { "type": "static", "runtime": "laya.physics.RigidBody" }, "compId": 196 }] }, { "type": "Image", "props": { "y": 943, "x": 78, "width": 80, "var": "LeftCollider", "skin": "InGameView/1.png", "scaleY": 1, "scaleX": 1, "pivotY": 939, "pivotX": 80, "name": "LeftCollider", "height": 885, "alpha": 1 }, "compId": 52, "child": [{ "type": "Script", "props": { "y": 0, "x": 0, "points": "-153,-466,-1,-5,9,1434,0,-1,15,-1,18,32,25,67,39,115,44,144,46,165,46,198,49,254,57,312,63,366,80,533,80,678,83,1432", "runtime": "laya.physics.ChainCollider" }, "compId": 197 }, { "type": "Script", "props": { "type": "static", "runtime": "laya.physics.RigidBody" }, "compId": 198 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "var": "BG", "top": 0, "skin": "InGameView/groundplane.png", "sizeGrid": "179,113,184,121", "right": 0, "left": 0, "bottom": 0 }, "compId": 4 }, { "type": "Image", "props": { "x": 78, "width": 514, "skin": "InGameView/borderbottom.png", "scaleX": 1.1, "name": "bottom", "height": 160, "bottom": 222 }, "compId": 37 }, { "type": "Image", "props": { "y": 0, "x": 14, "width": 346, "top": 0, "skin": "InGameView/border2.png", "scaleY": 2, "scaleX": 2, "name": "area", "bottom": 380 }, "compId": 36 }, { "type": "Image", "props": { "skin": "InGameView/blast-35.png", "right": 0, "name": "prop", "left": 0, "bottom": 0 }, "compId": 3, "child": [{ "type": "Button", "props": { "y": 132, "x": 629, "width": 82, "var": "arrowbtn", "stateNum": 1, "skin": "Skillicon/BoosterArrow1_00239.png", "pivotY": 37, "pivotX": 41, "name": "", "height": 73 }, "compId": 383, "child": [{ "type": "Image", "props": { "y": 62, "x": 84, "width": 29, "skin": "InGameView/blast-45.png", "pivotY": 14, "pivotX": 15, "name": "cycle", "height": 28 }, "compId": 20 }, { "type": "Text", "props": { "y": 64, "x": 84, "width": 32, "var": "Func5num", "valign": "middle", "text": "10", "pivotY": 9, "pivotX": 16, "height": 18, "fontSize": 20, "font": "Microsoft YaHei", "color": "#ffffff", "bold": false, "align": "center", "runtime": "laya.display.Text" }, "compId": 21 }] }, { "type": "Button", "props": { "y": 130, "x": 88, "width": 79, "var": "doublebtn", "stateNum": 1, "skin": "Skillicon/BoosterExplode1_00239.png", "pivotY": 29, "pivotX": 40, "height": 55 }, "compId": 384, "child": [{ "type": "Image", "props": { "y": 57, "x": 80, "width": 29, "skin": "InGameView/blast-45.png", "pivotY": 14, "pivotX": 15, "name": "cycle", "height": 28 }, "compId": 12 }, { "type": "Text", "props": { "y": 60, "x": 79, "width": 28, "var": "Func1num", "valign": "middle", "text": "10", "pivotY": 10, "pivotX": 14, "height": 20, "fontSize": 20, "font": "Microsoft YaHei", "color": "#ffffff", "bold": false, "align": "center", "runtime": "laya.display.Text" }, "compId": 13 }] }, { "type": "Button", "props": { "y": 166, "x": 222, "width": 85, "var": "zhunxin1btn", "stateNum": 1, "skin": "Skillicon/BoosterFire1_00239.png", "pivotY": 40, "pivotX": 43, "height": 80 }, "compId": 385, "child": [{ "type": "Image", "props": { "y": 57, "x": 79, "width": 29, "skin": "InGameView/blast-45.png", "pivotY": 14, "pivotX": 15, "name": "cycle", "height": 28 }, "compId": 14 }, { "type": "Text", "props": { "y": 59.5, "x": 79, "width": 27, "var": "Func2num", "valign": "middle", "text": "10", "pivotY": 12, "pivotX": 14, "height": 23, "fontSize": 20, "font": "Microsoft YaHei", "color": "#ffffff", "bold": false, "align": "center", "runtime": "laya.display.Text" }, "compId": 15 }] }, { "type": "Button", "props": { "y": 175, "x": 361, "width": 77, "var": "zhunxin2btn", "stateNum": 1, "skin": "Skillicon/BoosterShoot1_00240.png", "pivotY": 37, "pivotX": 39, "height": 73 }, "compId": 386, "child": [{ "type": "Image", "props": { "y": 58, "x": 76, "width": 29, "skin": "InGameView/blast-45.png", "pivotY": 14, "pivotX": 15, "name": "cycle", "height": 28 }, "compId": 16 }, { "type": "Text", "props": { "y": 61, "x": 76, "width": 31, "var": "Func3num", "valign": "middle", "text": "10", "pivotY": 11, "pivotX": 16, "height": 22, "fontSize": 20, "font": "Microsoft YaHei", "color": "#ffffff", "bold": false, "align": "center", "runtime": "laya.display.Text" }, "compId": 17 }] }, { "type": "Button", "props": { "y": 165, "x": 499, "width": 68, "var": "hammerbtn", "stateNum": 1, "skin": "Skillicon/BoosterHammer1_00238.png", "pivotY": 39, "pivotX": 34, "height": 78 }, "compId": 388, "child": [{ "type": "Image", "props": { "y": 56, "x": 84, "width": 29, "skin": "InGameView/blast-45.png", "pivotY": 14, "pivotX": 15, "name": "cycle", "height": 28 }, "compId": 18 }, { "type": "Text", "props": { "y": 58, "x": 84, "width": 31, "var": "Func4num", "valign": "middle", "text": "10", "pivotY": 12, "pivotX": 16, "height": 24, "fontSize": 20, "font": "Microsoft YaHei", "color": "#ffffff", "bold": false, "align": "center", "runtime": "laya.display.Text" }, "compId": 19 }] }] }, { "type": "Sprite", "props": { "y": 8, "x": 8, "width": 16, "var": "prefabbox", "pivotY": 8, "pivotX": 8, "height": 16 }, "compId": 677 }, { "type": "ProgressBar", "props": { "x": 360, "width": 281, "var": "LevelProgress", "value": 0, "top": 120, "skin": "InGameView/jindutiao-1-2.png", "pivotY": 22, "pivotX": 141, "height": 44 }, "compId": 574, "child": [{ "type": "Image", "props": { "y": 22, "x": -14, "width": 73, "skin": "InGameView/jindutiao-1-3.png", "pivotY": 37, "pivotX": 37, "height": 73 }, "compId": 570, "child": [{ "type": "FontClip", "props": { "y": 36, "x": 36, "width": 25, "var": "NowLv", "value": "1", "skin": "Ball/43.png", "sheet": "0123456789", "pivotY": 15, "pivotX": 13, "height": 29, "align": "center" }, "compId": 578 }] }, { "type": "Image", "props": { "y": 22, "x": 298, "width": 73, "skin": "InGameView/jindutiao-1-3.png", "pivotY": 37, "pivotX": 37, "height": 73 }, "compId": 571, "child": [{ "type": "FontClip", "props": { "y": 36.5, "x": 36.5, "width": 25, "var": "NextLv", "value": "2", "skin": "Ball/43.png", "sheet": "0123456789", "pivotY": 15, "pivotX": 13, "height": 29, "align": "center" }, "compId": 576 }] }, { "type": "Text", "props": { "y": -22, "x": 38, "width": 117, "var": "NowScore", "valign": "middle", "text": "0", "pivotY": 13, "pivotX": 19, "height": 26, "fontSize": 30, "color": "#ffffff", "align": "right", "runtime": "laya.display.Text" }, "compId": 674 }, { "type": "Text", "props": { "y": -21, "x": 208, "width": 124, "var": "RequireScore", "valign": "middle", "text": "0", "pivotY": 14, "pivotX": 62, "height": 27, "fontSize": 30, "color": "#ffffff", "align": "left", "runtime": "laya.display.Text" }, "compId": 675 }, { "type": "Text", "props": { "y": -34, "x": 136, "width": 10, "text": "/", "height": 25, "fontSize": 30, "color": "#ffffff", "runtime": "laya.display.Text" }, "compId": 676 }] }, { "type": "Image", "props": { "y": 49, "x": 0, "visible": false, "var": "Effect", "skin": "InGameView/youxinei-1-2.png", "right": 0, "left": 0 }, "compId": 558, "child": [{ "type": "Button", "props": { "y": 883, "x": 360, "width": 298, "var": "EffectBtn", "stateNum": 1, "skin": "InGameView/youxinei-1-5.png", "pivotY": 53, "pivotX": 149, "height": 106 }, "compId": 564 }, { "type": "Image", "props": { "y": 95, "x": 626, "width": 69, "pivotY": 36, "pivotX": 35, "name": "ICON", "height": 72 }, "compId": 565 }, { "type": "Image", "props": { "x": 0, "width": 72, "top": -48, "skin": "InGameView/youxinei-1-1.png", "name": "Left", "height": 1280 }, "compId": 566 }, { "type": "Image", "props": { "x": 684, "width": 72, "top": -48, "skin": "InGameView/youxinei-1-1.png", "rotation": 180, "pivotY": 640, "pivotX": 36, "name": "Right", "height": 1280 }, "compId": 567 }, { "type": "Text", "props": { "y": 52, "x": 318, "width": 153, "valign": "middle", "text": "消除所有的", "pivotY": 28, "pivotX": 77, "name": "describe", "height": 55, "fontSize": 30, "font": "Microsoft YaHei", "color": "#ffffff", "align": "left", "runtime": "laya.display.Text" }, "compId": 579, "child": [{ "type": "Text", "props": { "y": 26, "x": 176, "width": 40, "var": "ClearNum", "valign": "middle", "text": "2", "pivotY": 23, "pivotX": 20, "height": 45, "fontSize": 35, "color": "#ffffff", "align": "center", "runtime": "laya.display.Text" }, "compId": 580 }] }, { "type": "Text", "props": { "y": 52, "x": 362, "width": 241, "valign": "middle", "text": "消除你所砸到的球", "pivotY": 28, "pivotX": 121, "name": "describe2", "height": 55, "fontSize": 30, "font": "Microsoft YaHei", "color": "#ffffff", "align": "left", "runtime": "laya.display.Text" }, "compId": 678 }] }, { "type": "Image", "props": { "x": 311, "width": 124, "visible": false, "var": "Guide", "skin": "InGameView/yindao.png", "pivotY": 32, "pivotX": 31, "height": 148, "bottom": 160 }, "compId": 734, "child": [{ "type": "Image", "props": { "y": -40, "x": -55, "skin": "InGameView/zhujiemian-1-9.png" }, "compId": 736 }] }], "animations": [{ "nodes": [{ "target": 383, "keyframes": { "var": [{ "value": "arrowbtn", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "var", "index": 0 }], "skin": [{ "value": "Skillicon/BoosterArrow1_00239.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 0 }, { "value": "Skillicon/BoosterArrow1_00240.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 1 }, { "value": "Skillicon/BoosterArrow1_00241.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 2 }, { "value": "Skillicon/BoosterArrow1_00242.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 3 }, { "value": "Skillicon/BoosterArrow1_00243.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 4 }, { "value": "Skillicon/BoosterArrow1_00244.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 5 }, { "value": "Skillicon/BoosterArrow1_00245.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 6 }, { "value": "Skillicon/BoosterArrow1_00246.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 7 }, { "value": "Skillicon/BoosterArrow1_00247.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 8 }, { "value": "Skillicon/BoosterArrow1_00248.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 9 }, { "value": "Skillicon/BoosterArrow1_00249.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 10 }, { "value": "Skillicon/BoosterArrow1_00250.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 11 }, { "value": "Skillicon/BoosterArrow1_00251.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 12 }, { "value": "Skillicon/BoosterArrow1_00252.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 13 }, { "value": "Skillicon/BoosterArrow1_00253.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 14 }, { "value": "Skillicon/BoosterArrow1_00254.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 15 }, { "value": "Skillicon/BoosterArrow1_00255.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 16 }], "name": [{ "value": "", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "name", "index": 0 }] } }], "name": "ani1", "id": 1, "frameRate": 24, "action": 0 }, { "nodes": [{ "target": 384, "keyframes": { "skin": [{ "value": "Skillicon/BoosterExplode1_00239.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 0 }, { "value": "Skillicon/BoosterExplode1_00240.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 1 }, { "value": "Skillicon/BoosterExplode1_00241.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 2 }, { "value": "Skillicon/BoosterExplode1_00242.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 3 }, { "value": "Skillicon/BoosterExplode1_00243.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 4 }, { "value": "Skillicon/BoosterExplode1_00244.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 5 }, { "value": "Skillicon/BoosterExplode1_00245.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 6 }, { "value": "Skillicon/BoosterExplode1_00246.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 7 }, { "value": "Skillicon/BoosterExplode1_00247.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 8 }, { "value": "Skillicon/BoosterExplode1_00248.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 9 }, { "value": "Skillicon/BoosterExplode1_00249.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 10 }, { "value": "Skillicon/BoosterExplode1_00250.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 11 }, { "value": "Skillicon/BoosterExplode1_00251.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 12 }, { "value": "Skillicon/BoosterExplode1_00252.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 13 }, { "value": "Skillicon/BoosterExplode1_00253.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 14 }, { "value": "Skillicon/BoosterExplode1_00254.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 15 }, { "value": "Skillicon/BoosterExplode1_00255.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 16 }] } }], "name": "ani2", "id": 2, "frameRate": 24, "action": 0 }, { "nodes": [{ "target": 385, "keyframes": { "skin": [{ "value": "Skillicon/BoosterFire1_00239.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 0 }, { "value": "Skillicon/BoosterFire1_00240.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 1 }, { "value": "Skillicon/BoosterFire1_00241.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 2 }, { "value": "Skillicon/BoosterFire1_00242.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 3 }, { "value": "Skillicon/BoosterFire1_00243.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 4 }, { "value": "Skillicon/BoosterFire1_00244.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 5 }, { "value": "Skillicon/BoosterFire1_00245.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 6 }, { "value": "Skillicon/BoosterFire1_00246.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 7 }, { "value": "Skillicon/BoosterFire1_00247.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 8 }, { "value": "Skillicon/BoosterFire1_00248.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 9 }, { "value": "Skillicon/BoosterFire1_00249.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 10 }, { "value": "Skillicon/BoosterFire1_00250.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 11 }, { "value": "Skillicon/BoosterFire1_00251.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 12 }, { "value": "Skillicon/BoosterFire1_00252.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 13 }, { "value": "Skillicon/BoosterFire1_00253.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 14 }, { "value": "Skillicon/BoosterFire1_00254.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 15 }, { "value": "Skillicon/BoosterFire1_00255.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 16 }] } }], "name": "ani3", "id": 3, "frameRate": 24, "action": 0 }, { "nodes": [{ "target": 386, "keyframes": { "skin": [{ "value": "Skillicon/BoosterShoot1_00240.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 0 }, { "value": "Skillicon/BoosterShoot1_00241.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 1 }, { "value": "Skillicon/BoosterShoot1_00242.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 2 }, { "value": "Skillicon/BoosterShoot1_00243.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 3 }, { "value": "Skillicon/BoosterShoot1_00244.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 4 }, { "value": "Skillicon/BoosterShoot1_00245.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 5 }, { "value": "Skillicon/BoosterShoot1_00246.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 6 }, { "value": "Skillicon/BoosterShoot1_00247.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 7 }, { "value": "Skillicon/BoosterShoot1_00248.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 8 }, { "value": "Skillicon/BoosterShoot1_00249.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 9 }, { "value": "Skillicon/BoosterShoot1_00250.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 10 }, { "value": "Skillicon/BoosterShoot1_00251.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 11 }, { "value": "Skillicon/BoosterShoot1_00252.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 12 }, { "value": "Skillicon/BoosterShoot1_00253.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 13 }, { "value": "Skillicon/BoosterShoot1_00254.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 14 }, { "value": "Skillicon/BoosterShoot1_00255.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 15 }, { "value": "Skillicon/BoosterShoot1_00256.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 16 }] } }], "name": "ani4", "id": 4, "frameRate": 24, "action": 0 }, { "nodes": [{ "target": 388, "keyframes": { "skin": [{ "value": "Skillicon/BoosterHammer1_00238.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 0 }, { "value": "Skillicon/BoosterHammer1_00239.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 1 }, { "value": "Skillicon/BoosterHammer1_00240.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 2 }, { "value": "Skillicon/BoosterHammer1_00241.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 3 }, { "value": "Skillicon/BoosterHammer1_00242.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 4 }, { "value": "Skillicon/BoosterHammer1_00243.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 5 }, { "value": "Skillicon/BoosterHammer1_00244.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 6 }, { "value": "Skillicon/BoosterHammer1_00245.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 7 }, { "value": "Skillicon/BoosterHammer1_00246.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 8 }, { "value": "Skillicon/BoosterHammer1_00247.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 9 }, { "value": "Skillicon/BoosterHammer1_00248.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 10 }, { "value": "Skillicon/BoosterHammer1_00249.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 11 }, { "value": "Skillicon/BoosterHammer1_00250.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 12 }, { "value": "Skillicon/BoosterHammer1_00251.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 13 }, { "value": "Skillicon/BoosterHammer1_00252.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 14 }, { "value": "Skillicon/BoosterHammer1_00253.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 15 }, { "value": "Skillicon/BoosterHammer1_00254.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 16 }] } }], "name": "ani5", "id": 5, "frameRate": 24, "action": 0 }, { "nodes": [{ "target": 734, "keyframes": { "scaleY": [{ "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleY", "index": 0 }, { "value": 0.95, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleY", "index": 5 }, { "value": 0.9, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleY", "index": 10 }, { "value": 0.95, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleY", "index": 15 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleY", "index": 20 }, { "value": 0.95, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleY", "index": 25 }, { "value": 0.9, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleY", "index": 30 }, { "value": 0.95, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleY", "index": 35 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleY", "index": 40 }], "scaleX": [{ "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleX", "index": 0 }, { "value": 0.95, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleX", "index": 5 }, { "value": 0.9, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleX", "index": 10 }, { "value": 0.95, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleX", "index": 15 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleX", "index": 20 }, { "value": 0.95, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleX", "index": 25 }, { "value": 0.9, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleX", "index": 30 }, { "value": 0.95, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleX", "index": 35 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleX", "index": 40 }] } }], "name": "guide", "id": 6, "frameRate": 24, "action": 0 }], "loadList": ["InGameView/colliderbottom.png", "InGameView/0.png", "InGameView/1.png", "InGameView/groundplane.png", "InGameView/borderbottom.png", "InGameView/border2.png", "InGameView/blast-35.png", "Skillicon/BoosterArrow1_00239.png", "InGameView/blast-45.png", "Skillicon/BoosterExplode1_00239.png", "Skillicon/BoosterFire1_00239.png", "Skillicon/BoosterShoot1_00240.png", "Skillicon/BoosterHammer1_00238.png", "InGameView/jindutiao-1-2.png", "InGameView/jindutiao-1-3.png", "Ball/43.png", "InGameView/youxinei-1-2.png", "InGameView/youxinei-1-5.png", "InGameView/youxinei-1-1.png", "InGameView/yindao.png", "InGameView/zhujiemian-1-9.png", "Skillicon/BoosterArrow1_00240.png", "Skillicon/BoosterArrow1_00241.png", "Skillicon/BoosterArrow1_00242.png", "Skillicon/BoosterArrow1_00243.png", "Skillicon/BoosterArrow1_00244.png", "Skillicon/BoosterArrow1_00245.png", "Skillicon/BoosterArrow1_00246.png", "Skillicon/BoosterArrow1_00247.png", "Skillicon/BoosterArrow1_00248.png", "Skillicon/BoosterArrow1_00249.png", "Skillicon/BoosterArrow1_00250.png", "Skillicon/BoosterArrow1_00251.png", "Skillicon/BoosterArrow1_00252.png", "Skillicon/BoosterArrow1_00253.png", "Skillicon/BoosterArrow1_00254.png", "Skillicon/BoosterArrow1_00255.png", "Skillicon/BoosterExplode1_00240.png", "Skillicon/BoosterExplode1_00241.png", "Skillicon/BoosterExplode1_00242.png", "Skillicon/BoosterExplode1_00243.png", "Skillicon/BoosterExplode1_00244.png", "Skillicon/BoosterExplode1_00245.png", "Skillicon/BoosterExplode1_00246.png", "Skillicon/BoosterExplode1_00247.png", "Skillicon/BoosterExplode1_00248.png", "Skillicon/BoosterExplode1_00249.png", "Skillicon/BoosterExplode1_00250.png", "Skillicon/BoosterExplode1_00251.png", "Skillicon/BoosterExplode1_00252.png", "Skillicon/BoosterExplode1_00253.png", "Skillicon/BoosterExplode1_00254.png", "Skillicon/BoosterExplode1_00255.png", "Skillicon/BoosterFire1_00240.png", "Skillicon/BoosterFire1_00241.png", "Skillicon/BoosterFire1_00242.png", "Skillicon/BoosterFire1_00243.png", "Skillicon/BoosterFire1_00244.png", "Skillicon/BoosterFire1_00245.png", "Skillicon/BoosterFire1_00246.png", "Skillicon/BoosterFire1_00247.png", "Skillicon/BoosterFire1_00248.png", "Skillicon/BoosterFire1_00249.png", "Skillicon/BoosterFire1_00250.png", "Skillicon/BoosterFire1_00251.png", "Skillicon/BoosterFire1_00252.png", "Skillicon/BoosterFire1_00253.png", "Skillicon/BoosterFire1_00254.png", "Skillicon/BoosterFire1_00255.png", "Skillicon/BoosterShoot1_00241.png", "Skillicon/BoosterShoot1_00242.png", "Skillicon/BoosterShoot1_00243.png", "Skillicon/BoosterShoot1_00244.png", "Skillicon/BoosterShoot1_00245.png", "Skillicon/BoosterShoot1_00246.png", "Skillicon/BoosterShoot1_00247.png", "Skillicon/BoosterShoot1_00248.png", "Skillicon/BoosterShoot1_00249.png", "Skillicon/BoosterShoot1_00250.png", "Skillicon/BoosterShoot1_00251.png", "Skillicon/BoosterShoot1_00252.png", "Skillicon/BoosterShoot1_00253.png", "Skillicon/BoosterShoot1_00254.png", "Skillicon/BoosterShoot1_00255.png", "Skillicon/BoosterShoot1_00256.png", "Skillicon/BoosterHammer1_00239.png", "Skillicon/BoosterHammer1_00240.png", "Skillicon/BoosterHammer1_00241.png", "Skillicon/BoosterHammer1_00242.png", "Skillicon/BoosterHammer1_00243.png", "Skillicon/BoosterHammer1_00244.png", "Skillicon/BoosterHammer1_00245.png", "Skillicon/BoosterHammer1_00246.png", "Skillicon/BoosterHammer1_00247.png", "Skillicon/BoosterHammer1_00248.png", "Skillicon/BoosterHammer1_00249.png", "Skillicon/BoosterHammer1_00250.png", "Skillicon/BoosterHammer1_00251.png", "Skillicon/BoosterHammer1_00252.png", "Skillicon/BoosterHammer1_00253.png", "Skillicon/BoosterHammer1_00254.png"], "loadList3D": [] };
  899. ui.InGameSceneUI = InGameSceneUI;
  900. REG("ui.InGameSceneUI", InGameSceneUI);
  901. class LotteryViewUI extends Laya.View {
  902. constructor() { super(); }
  903. createChildren() {
  904. super.createChildren();
  905. this.createView(LotteryViewUI.uiView);
  906. }
  907. }
  908. LotteryViewUI.uiView = { "type": "View", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 460, "x": 337, "var": "dial", "skin": "LotteryView/choujiang-1-1.png", "anchorY": 0.5, "anchorX": 0.5 }, "compId": 4, "child": [{ "type": "Box", "props": { "y": 171, "x": 344, "width": 93, "rotation": 0, "pivotY": 46, "pivotX": 47, "height": 91 }, "compId": 8, "child": [{ "type": "Image", "props": { "y": 46, "x": 47, "width": 87, "skin": "LotteryView/func1.png", "rotation": 221, "pivotY": 43, "pivotX": 44, "height": 86 }, "compId": 9 }, { "type": "Text", "props": { "y": 2, "x": 91, "width": 68, "valign": "middle", "text": "X1", "rotation": 225, "pivotY": 13, "pivotX": 34, "height": 25, "fontSize": 20, "color": "#ffffff", "align": "center", "runtime": "laya.display.Text" }, "compId": 10 }] }, { "type": "Box", "props": { "y": 277, "x": 403, "width": 93, "rotation": 12, "pivotY": 46, "pivotX": 47, "height": 91 }, "compId": 14, "child": [{ "type": "Image", "props": { "y": 46, "x": 47, "width": 87, "skin": "LotteryView/func4.png", "rotation": 253, "pivotY": 43, "pivotX": 44, "height": 86 }, "compId": 15 }, { "type": "Text", "props": { "y": 33, "x": 110, "width": 68, "valign": "middle", "text": "X2", "rotation": 254, "pivotY": 13, "pivotX": 34, "height": 25, "fontSize": 20, "color": "#ffffff", "align": "center", "runtime": "laya.display.Text" }, "compId": 16 }] }, { "type": "Box", "props": { "y": 395, "x": 345, "width": 93, "rotation": 60, "pivotY": 46, "pivotX": 47, "height": 91 }, "compId": 17, "child": [{ "type": "Image", "props": { "y": 46, "x": 47, "width": 87, "skin": "LotteryView/func5.png", "rotation": -86, "pivotY": 43, "pivotX": 44, "height": 86 }, "compId": 18 }, { "type": "Text", "props": { "y": 45.5, "x": 109, "width": 68, "valign": "middle", "text": "X1", "rotation": -91, "pivotY": 13, "pivotX": 34, "height": 25, "fontSize": 20, "color": "#ffffff", "align": "center", "runtime": "laya.display.Text" }, "compId": 19 }] }, { "type": "Box", "props": { "y": 395, "x": 207, "width": 93, "rotation": 120, "pivotY": 46, "pivotX": 47, "height": 91 }, "compId": 20, "child": [{ "type": "Image", "props": { "y": 46, "x": 47, "width": 87, "skin": "LotteryView/func5.png", "rotation": -87, "pivotY": 43, "pivotX": 44, "height": 86 }, "compId": 21 }, { "type": "Text", "props": { "y": 45.5, "x": 109, "width": 68, "valign": "middle", "text": "X2", "rotation": -91, "pivotY": 13, "pivotX": 34, "height": 25, "fontSize": 20, "color": "#ffffff", "align": "center", "runtime": "laya.display.Text" }, "compId": 22 }] }, { "type": "Box", "props": { "y": 277, "x": 139, "width": 93, "rotation": 180, "pivotY": 46, "pivotX": 47, "height": 91 }, "compId": 23, "child": [{ "type": "Image", "props": { "y": 46, "x": 47, "width": 87, "skin": "LotteryView/func1.png", "rotation": -83, "pivotY": 43, "pivotX": 44, "height": 86 }, "compId": 24 }, { "type": "Text", "props": { "y": 45.5, "x": 109, "width": 68, "valign": "middle", "text": "X2", "rotation": -91, "pivotY": 13, "pivotX": 34, "height": 25, "fontSize": 20, "color": "#ffffff", "align": "center", "runtime": "laya.display.Text" }, "compId": 25 }] }, { "type": "Box", "props": { "y": 162, "x": 207, "width": 93, "rotation": 236, "pivotY": 46, "pivotX": 47, "height": 91 }, "compId": 26, "child": [{ "type": "Image", "props": { "y": 46, "x": 47, "width": 87, "skin": "LotteryView/func2.png", "rotation": 90, "pivotY": 43, "pivotX": 44, "height": 86 }, "compId": 27 }, { "type": "Text", "props": { "y": 45.5, "x": 109, "width": 68, "valign": "middle", "text": "X1", "rotation": -91, "pivotY": 13, "pivotX": 34, "height": 25, "fontSize": 20, "color": "#ffffff", "align": "center", "runtime": "laya.display.Text" }, "compId": 28 }] }] }, { "type": "Button", "props": { "y": 227, "x": 614, "var": "CloseBtn", "stateNum": 1, "skin": "LotteryView/choujiang-1-4.png" }, "compId": 5 }, { "type": "Image", "props": { "y": 437, "x": 337, "width": 87, "skin": "LotteryView/choujiang-1-2.png", "pivotY": 77, "pivotX": 44, "name": "Pointer", "height": 153 }, "compId": 6 }, { "type": "Button", "props": { "y": 931, "x": 360, "width": 298, "var": "LotteryBtn", "stateNum": 1, "skin": "LotteryView/choujiang-1-3.png", "pivotY": 53, "pivotX": 149, "height": 106 }, "compId": 7 }], "loadList": ["LotteryView/choujiang-1-1.png", "LotteryView/func1.png", "LotteryView/func4.png", "LotteryView/func5.png", "LotteryView/func2.png", "LotteryView/choujiang-1-4.png", "LotteryView/choujiang-1-2.png", "LotteryView/choujiang-1-3.png"], "loadList3D": [] };
  909. ui.LotteryViewUI = LotteryViewUI;
  910. REG("ui.LotteryViewUI", LotteryViewUI);
  911. class MainSceneUI extends Laya.View {
  912. constructor() { super(); }
  913. createChildren() {
  914. super.createChildren();
  915. this.createView(MainSceneUI.uiView);
  916. }
  917. }
  918. MainSceneUI.uiView = { "type": "View", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "var": "BG", "top": 0, "skin": "MainView/zhujiemian-1-8.png", "sizeGrid": "15,17,13,9", "right": 0, "left": 0, "bottom": 0, "alpha": 1 }, "compId": 13 }, { "type": "Button", "props": { "y": 258, "x": 42, "width": 42, "var": "SetBtn", "stateNum": 1, "skin": "MainView/zhujiemian-1-6.png", "pivotY": 21, "pivotX": 21, "height": 42 }, "compId": 30 }, { "type": "Box", "props": { "x": 97, "width": 555, "height": 173, "bottom": 180 }, "compId": 56, "child": [{ "type": "Button", "props": { "y": 25, "x": 220, "var": "RankBtn", "stateNum": 1, "skin": "MainView/zhujiemian-1-3(1).png" }, "compId": 31 }, { "type": "Button", "props": { "y": 16, "x": 436, "var": "LotteryBtn", "stateNum": 1, "skin": "MainView/zhujiemian-1-4(1).png" }, "compId": 32 }, { "type": "Button", "props": { "y": 16, "x": 19, "var": "SignBtn", "stateNum": 1, "skin": "MainView/zhujiemian-1-2(1).png" }, "compId": 33 }] }, { "type": "Image", "props": { "x": 360, "width": 629, "top": 2, "skin": "MainView/zhujiemian-1-7.png", "pivotY": 468, "pivotX": 315, "height": 936 }, "compId": 60, "child": [{ "type": "Button", "props": { "y": 832.5, "x": 298, "width": 207, "var": "StartBtn", "stateNum": 1, "skin": "MainView/zhujiemian-1-5.png", "pivotY": 104, "pivotX": 104, "height": 207 }, "compId": 9 }] }, { "type": "Image", "props": { "y": 205, "x": 375, "width": 526, "skin": "MainView/logo.png", "pivotY": 153, "pivotX": 263, "height": 305 }, "compId": 57 }], "loadList": ["MainView/zhujiemian-1-8.png", "MainView/zhujiemian-1-6.png", "MainView/zhujiemian-1-3(1).png", "MainView/zhujiemian-1-4(1).png", "MainView/zhujiemian-1-2(1).png", "MainView/zhujiemian-1-7.png", "MainView/zhujiemian-1-5.png", "MainView/logo.png"], "loadList3D": [] };
  919. ui.MainSceneUI = MainSceneUI;
  920. REG("ui.MainSceneUI", MainSceneUI);
  921. class RankViewUI extends Laya.View {
  922. constructor() { super(); }
  923. createChildren() {
  924. super.createChildren();
  925. this.createView(RankViewUI.uiView);
  926. }
  927. }
  928. RankViewUI.uiView = { "type": "View", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 513, "x": 360, "width": 555, "skin": "SetView/shezhi-1-1.png", "sizeGrid": "98,159,125,118", "height": 767, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 5, "child": [{ "type": "Image", "props": { "y": 14, "x": 198, "skin": "RankView/paihang-1-1.png" }, "compId": 6 }] }, { "type": "Button", "props": { "y": 139, "x": 573, "var": "CloseBtn", "stateNum": 1, "skin": "SetView/shezhi-1-3.png" }, "compId": 7 }, { "type": "Box", "props": { "y": 231, "x": 118, "width": 495, "height": 623 }, "compId": 9, "child": [{ "type": "Image", "props": { "y": 6, "x": 12, "width": 459, "skin": "RankView/paihang-1-2.png", "sizeGrid": "22,39,25,23", "height": 65 }, "compId": 8 }, { "type": "Image", "props": { "y": 84, "x": 12, "width": 459, "skin": "RankView/paihang-1-2.png", "sizeGrid": "22,39,25,23", "height": 65 }, "compId": 11 }, { "type": "Image", "props": { "y": 163, "x": 12, "width": 459, "skin": "RankView/paihang-1-2.png", "sizeGrid": "22,39,25,23", "height": 65 }, "compId": 12 }, { "type": "Image", "props": { "y": 246.5, "x": 12, "width": 459, "skin": "RankView/paihang-1-2.png", "sizeGrid": "22,39,25,23", "height": 65 }, "compId": 13 }, { "type": "Image", "props": { "y": 328, "x": 12, "width": 459, "skin": "RankView/paihang-1-2.png", "sizeGrid": "22,39,25,23", "height": 65 }, "compId": 14 }, { "type": "Image", "props": { "y": 407, "x": 12, "width": 459, "skin": "RankView/paihang-1-2.png", "sizeGrid": "22,39,25,23", "height": 65 }, "compId": 15 }, { "type": "Image", "props": { "y": 551, "x": 2, "width": 487, "skin": "RankView/paihang-1-7.png", "sizeGrid": "25,31,28,24", "height": 70 }, "compId": 16 }] }, { "type": "Button", "props": { "y": 733, "x": 194, "var": "UpPageBtn", "stateNum": 1, "skin": "RankView/paihang-1-6.png" }, "compId": 17 }, { "type": "Button", "props": { "y": 744, "x": 476, "width": 69, "var": "DownPageBtn", "stateNum": 1, "skin": "RankView/paihang-1-6.png", "rotation": 180, "pivotY": 16, "pivotX": 35, "height": 31 }, "compId": 18 }], "loadList": ["SetView/shezhi-1-1.png", "RankView/paihang-1-1.png", "SetView/shezhi-1-3.png", "RankView/paihang-1-2.png", "RankView/paihang-1-7.png", "RankView/paihang-1-6.png"], "loadList3D": [] };
  929. ui.RankViewUI = RankViewUI;
  930. REG("ui.RankViewUI", RankViewUI);
  931. class ReviveViewUI extends Laya.Scene {
  932. constructor() { super(); }
  933. createChildren() {
  934. super.createChildren();
  935. this.createView(ReviveViewUI.uiView);
  936. }
  937. }
  938. ReviveViewUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "var": "BG", "top": 0, "skin": "WinView/black.png", "sizeGrid": "10,12,13,13", "right": 0, "left": 0, "bottom": 0 }, "compId": 10 }, { "type": "Image", "props": { "y": 17, "x": 0, "skin": "ReviveView/fuhuo-1-1.png" }, "compId": 4, "child": [{ "type": "Image", "props": { "y": 250, "x": 285, "skin": "ReviveView/fuhuo-1-2.png" }, "compId": 5 }] }, { "type": "Image", "props": { "y": 449, "x": 370, "width": 147, "skin": "ReviveView/fuhuo-1-4.png", "pivotY": 74, "pivotX": 74, "height": 147 }, "compId": 6, "child": [{ "type": "Text", "props": { "y": 70, "x": 74, "width": 103, "var": "Time", "valign": "middle", "text": "9", "pivotY": 58, "pivotX": 52, "height": 117, "fontSize": 125, "color": "#f05929", "align": "center", "runtime": "laya.display.Text" }, "compId": 7 }] }, { "type": "Button", "props": { "y": 760, "x": 304.5, "var": "NoBtn", "stateNum": 1, "skin": "ReviveView/fuhuo-1-5.png" }, "compId": 8 }, { "type": "Button", "props": { "y": 583, "x": 304.5, "var": "VideoBtn", "stateNum": 1, "skin": "ReviveView/fuhuo-1-3.png" }, "compId": 9 }], "loadList": ["WinView/black.png", "ReviveView/fuhuo-1-1.png", "ReviveView/fuhuo-1-2.png", "ReviveView/fuhuo-1-4.png", "ReviveView/fuhuo-1-5.png", "ReviveView/fuhuo-1-3.png"], "loadList3D": [] };
  939. ui.ReviveViewUI = ReviveViewUI;
  940. REG("ui.ReviveViewUI", ReviveViewUI);
  941. class SetViewUI extends Laya.View {
  942. constructor() { super(); }
  943. createChildren() {
  944. super.createChildren();
  945. this.createView(SetViewUI.uiView);
  946. }
  947. }
  948. SetViewUI.uiView = { "type": "View", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 380, "x": 360, "width": 550, "skin": "SetView/shezhi-1-1.png", "pivotY": 178, "pivotX": 275, "height": 355, "alpha": 1, "sizeGrid": "98,159,125,118" }, "compId": 4, "child": [{ "type": "Image", "props": { "y": 17, "x": 225, "skin": "SetView/shezhi-1-2.png" }, "compId": 5 }] }, { "type": "Button", "props": { "y": 226, "x": 574, "var": "CloseBtn", "stateNum": 1, "skin": "SetView/shezhi-1-3.png" }, "compId": 6 }, { "type": "Sprite", "props": { "y": 335, "x": 191, "texture": "SetView/shezhi-1-4.png", "name": "SoundSprite" }, "compId": 7 }, { "type": "Sprite", "props": { "y": 431, "x": 193, "texture": "SetView/shezhi-1-5.png", "name": "ShakeSprite" }, "compId": 8 }, { "type": "Box", "props": { "y": 325, "x": 427, "width": 100, "var": "Sound", "height": 51 }, "compId": 9, "child": [{ "type": "Image", "props": { "y": 21, "x": 0, "skin": "SetView/shezhi-1-6.png" }, "compId": 10 }, { "type": "Image", "props": { "y": 26, "x": 70, "width": 51, "skin": "SetView/shezhi-1-8.png", "pivotY": 26, "pivotX": 26, "name": "open", "height": 51 }, "compId": 11 }, { "type": "Image", "props": { "y": 26, "x": 32, "width": 51, "skin": "SetView/shezhi-1-9.png", "pivotY": 26, "pivotX": 26, "name": "close", "height": 51 }, "compId": 12 }, { "type": "Button", "props": { "y": 26, "x": 50, "width": 100, "pivotY": 26, "pivotX": 50, "name": "btn", "height": 51 }, "compId": 17 }] }, { "type": "Box", "props": { "y": 423, "x": 427, "width": 100, "var": "Shake", "height": 54 }, "compId": 13, "child": [{ "type": "Image", "props": { "y": 23, "x": 0, "skin": "SetView/shezhi-1-7.png" }, "compId": 14 }, { "type": "Image", "props": { "y": 28, "x": 70, "width": 51, "skin": "SetView/shezhi-1-8.png", "pivotY": 26, "pivotX": 26, "name": "open", "height": 51 }, "compId": 15 }, { "type": "Image", "props": { "y": 28, "x": 32, "width": 51, "skin": "SetView/shezhi-1-9.png", "pivotY": 26, "pivotX": 26, "name": "close", "height": 51 }, "compId": 16 }, { "type": "Button", "props": { "y": 28, "x": 50, "width": 100, "pivotY": 26, "pivotX": 50, "name": "btn", "height": 51 }, "compId": 18 }] }, { "type": "Text", "props": { "y": 515, "x": 285, "width": 128, "valign": "middle", "text": "UserID:", "pivotY": 26, "pivotX": 64, "height": 52, "fontSize": 30, "align": "center", "runtime": "laya.display.Text" }, "compId": 19 }, { "type": "Text", "props": { "y": 493, "x": 360, "width": 189, "var": "userid", "valign": "middle", "height": 45, "fontSize": 30, "align": "left", "runtime": "laya.display.Text" }, "compId": 20 }], "loadList": ["SetView/shezhi-1-1.png", "SetView/shezhi-1-2.png", "SetView/shezhi-1-3.png", "SetView/shezhi-1-4.png", "SetView/shezhi-1-5.png", "SetView/shezhi-1-6.png", "SetView/shezhi-1-8.png", "SetView/shezhi-1-9.png", "SetView/shezhi-1-7.png"], "loadList3D": [] };
  949. ui.SetViewUI = SetViewUI;
  950. REG("ui.SetViewUI", SetViewUI);
  951. class SignViewUI extends Laya.Scene {
  952. constructor() { super(); }
  953. createChildren() {
  954. super.createChildren();
  955. this.createView(SignViewUI.uiView);
  956. }
  957. }
  958. SignViewUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 581, "x": 360, "width": 555, "skin": "SetView/shezhi-1-1.png", "sizeGrid": "98,159,125,118", "height": 871, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 3, "child": [{ "type": "Image", "props": { "y": 13, "x": 225, "skin": "SignView/qiandao-1-1.png" }, "compId": 4 }, { "type": "Box", "props": { "y": 109, "x": 27, "width": 497, "var": "ItemList", "height": 572 }, "compId": 5, "child": [{ "type": "Box", "props": { "y": 3, "x": 0, "width": 150, "height": 188 }, "compId": 6, "child": [{ "type": "Image", "props": { "y": 32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-3.png", "sizeGrid": "9,45,22,34", "height": 157 }, "compId": 7, "child": [{ "type": "Image", "props": { "y": -32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-2.png", "height": 46 }, "compId": 8 }, { "type": "Image", "props": { "y": -23, "x": 39, "skin": "SignView/qiandao-1-4.png" }, "compId": 9 }, { "type": "Text", "props": { "y": -23, "x": 66.548095703125, "text": "1", "fontSize": 25, "color": "#ffffff", "runtime": "laya.display.Text" }, "compId": 10 }] }, { "type": "Button", "props": { "y": 114, "x": 74, "width": 147, "pivotY": 73, "pivotX": 74, "name": "btn", "height": 145 }, "compId": 11 }, { "type": "Image", "props": { "y": 94, "x": 74, "width": 100, "pivotY": 50, "pivotX": 50, "name": "icon", "height": 100 }, "compId": 12, "child": [{ "type": "Text", "props": { "y": 119, "x": 50, "width": 99, "valign": "middle", "text": "X3", "pivotY": 16, "pivotX": 50, "name": "num", "height": 31, "fontSize": 25, "align": "center", "runtime": "laya.display.Text" }, "compId": 13 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "width": 148, "visible": false, "skin": "SignView/qiandao-1-7(1).png", "name": "complete", "height": 186 }, "compId": 14, "child": [{ "type": "Image", "props": { "y": 93, "x": 74, "width": 51, "skin": "SignView/qiandao-1-8.png", "pivotY": 26, "pivotX": 26, "height": 51 }, "compId": 15 }] }] }, { "type": "Box", "props": { "y": 3, "x": 173.5, "width": 150, "height": 188 }, "compId": 16, "child": [{ "type": "Image", "props": { "y": 32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-3.png", "sizeGrid": "9,45,22,34", "height": 157 }, "compId": 17, "child": [{ "type": "Image", "props": { "y": -32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-2.png", "height": 46 }, "compId": 18 }, { "type": "Image", "props": { "y": -23, "x": 39, "skin": "SignView/qiandao-1-4.png" }, "compId": 19 }, { "type": "Text", "props": { "y": -23, "x": 66.548095703125, "text": "2", "fontSize": 25, "color": "#ffffff", "runtime": "laya.display.Text" }, "compId": 20 }] }, { "type": "Button", "props": { "y": 114, "x": 74, "width": 147, "pivotY": 73, "pivotX": 74, "name": "btn", "height": 145 }, "compId": 21 }, { "type": "Image", "props": { "y": 94, "x": 74, "width": 100, "pivotY": 50, "pivotX": 50, "name": "icon", "height": 100 }, "compId": 22, "child": [{ "type": "Text", "props": { "y": 119, "x": 50, "width": 99, "valign": "middle", "text": "X3", "pivotY": 16, "pivotX": 50, "name": "num", "height": 31, "fontSize": 25, "align": "center", "runtime": "laya.display.Text" }, "compId": 23 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "width": 148, "visible": false, "skin": "SignView/qiandao-1-7(1).png", "name": "complete", "height": 186 }, "compId": 24, "child": [{ "type": "Image", "props": { "y": 93, "x": 74, "width": 51, "skin": "SignView/qiandao-1-8.png", "pivotY": 26, "pivotX": 26, "height": 51 }, "compId": 25 }] }] }, { "type": "Box", "props": { "y": 3, "x": 347, "width": 150, "height": 188 }, "compId": 26, "child": [{ "type": "Image", "props": { "y": 32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-3.png", "sizeGrid": "9,45,22,34", "height": 157 }, "compId": 27, "child": [{ "type": "Image", "props": { "y": -32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-2.png", "height": 46 }, "compId": 28 }, { "type": "Image", "props": { "y": -23, "x": 39, "skin": "SignView/qiandao-1-4.png" }, "compId": 29 }, { "type": "Text", "props": { "y": -23, "x": 66.548095703125, "text": "3", "fontSize": 25, "color": "#ffffff", "runtime": "laya.display.Text" }, "compId": 30 }] }, { "type": "Button", "props": { "y": 114, "x": 74, "width": 147, "pivotY": 73, "pivotX": 74, "name": "btn", "height": 145 }, "compId": 31 }, { "type": "Image", "props": { "y": 94, "x": 74, "width": 100, "pivotY": 50, "pivotX": 50, "name": "icon", "height": 100 }, "compId": 32, "child": [{ "type": "Text", "props": { "y": 119, "x": 50, "width": 99, "valign": "middle", "text": "X3", "pivotY": 16, "pivotX": 50, "name": "num", "height": 31, "fontSize": 25, "align": "center", "runtime": "laya.display.Text" }, "compId": 33 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "width": 148, "visible": false, "skin": "SignView/qiandao-1-7(1).png", "name": "complete", "height": 186 }, "compId": 34, "child": [{ "type": "Image", "props": { "y": 93, "x": 74, "width": 51, "skin": "SignView/qiandao-1-8.png", "pivotY": 26, "pivotX": 26, "height": 51 }, "compId": 35 }] }] }, { "type": "Box", "props": { "y": 217, "x": 0, "width": 150, "height": 188 }, "compId": 36, "child": [{ "type": "Image", "props": { "y": 32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-3.png", "sizeGrid": "9,45,22,34", "height": 157 }, "compId": 37, "child": [{ "type": "Image", "props": { "y": -32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-2.png", "height": 46 }, "compId": 38 }, { "type": "Image", "props": { "y": -23, "x": 39, "skin": "SignView/qiandao-1-4.png" }, "compId": 39 }, { "type": "Text", "props": { "y": -23, "x": 66.548095703125, "text": "4", "fontSize": 25, "color": "#ffffff", "runtime": "laya.display.Text" }, "compId": 40 }] }, { "type": "Button", "props": { "y": 114, "x": 74, "width": 147, "pivotY": 73, "pivotX": 74, "name": "btn", "height": 145 }, "compId": 41 }, { "type": "Image", "props": { "y": 94, "x": 74, "width": 100, "pivotY": 50, "pivotX": 50, "name": "icon", "height": 100 }, "compId": 42, "child": [{ "type": "Text", "props": { "y": 119, "x": 50, "width": 99, "valign": "middle", "text": "X3", "pivotY": 16, "pivotX": 50, "name": "num", "height": 31, "fontSize": 25, "align": "center", "runtime": "laya.display.Text" }, "compId": 43 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "width": 148, "visible": false, "skin": "SignView/qiandao-1-7(1).png", "name": "complete", "height": 186 }, "compId": 44, "child": [{ "type": "Image", "props": { "y": 93, "x": 74, "width": 51, "skin": "SignView/qiandao-1-8.png", "pivotY": 26, "pivotX": 26, "height": 51 }, "compId": 45 }] }] }, { "type": "Box", "props": { "y": 217, "x": 173.5, "width": 150, "height": 188 }, "compId": 46, "child": [{ "type": "Image", "props": { "y": 32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-3.png", "sizeGrid": "9,45,22,34", "height": 157 }, "compId": 47, "child": [{ "type": "Image", "props": { "y": -32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-2.png", "height": 46 }, "compId": 48 }, { "type": "Image", "props": { "y": -23, "x": 39, "skin": "SignView/qiandao-1-4.png" }, "compId": 49 }, { "type": "Text", "props": { "y": -23, "x": 66.548095703125, "text": "5", "fontSize": 25, "color": "#ffffff", "runtime": "laya.display.Text" }, "compId": 50 }] }, { "type": "Button", "props": { "y": 114, "x": 74, "width": 147, "pivotY": 73, "pivotX": 74, "name": "btn", "height": 145 }, "compId": 51 }, { "type": "Image", "props": { "y": 94, "x": 74, "width": 100, "pivotY": 50, "pivotX": 50, "name": "icon", "height": 100 }, "compId": 52, "child": [{ "type": "Text", "props": { "y": 119, "x": 50, "width": 99, "valign": "middle", "text": "X3", "pivotY": 16, "pivotX": 50, "name": "num", "height": 31, "fontSize": 25, "align": "center", "runtime": "laya.display.Text" }, "compId": 53 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "width": 148, "visible": false, "skin": "SignView/qiandao-1-7(1).png", "name": "complete", "height": 186 }, "compId": 54, "child": [{ "type": "Image", "props": { "y": 93, "x": 74, "width": 51, "skin": "SignView/qiandao-1-8.png", "pivotY": 26, "pivotX": 26, "height": 51 }, "compId": 55 }] }] }, { "type": "Box", "props": { "y": 217, "x": 347, "width": 150, "height": 188 }, "compId": 56, "child": [{ "type": "Image", "props": { "y": 32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-3.png", "sizeGrid": "9,45,22,34", "height": 157 }, "compId": 57, "child": [{ "type": "Image", "props": { "y": -32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-2.png", "height": 46 }, "compId": 58 }, { "type": "Image", "props": { "y": -23, "x": 39, "skin": "SignView/qiandao-1-4.png" }, "compId": 59 }, { "type": "Text", "props": { "y": -23, "x": 66.548095703125, "text": "6", "fontSize": 25, "color": "#ffffff", "runtime": "laya.display.Text" }, "compId": 60 }] }, { "type": "Button", "props": { "y": 114, "x": 74, "width": 147, "pivotY": 73, "pivotX": 74, "name": "btn", "height": 145 }, "compId": 61 }, { "type": "Image", "props": { "y": 94, "x": 74, "width": 100, "pivotY": 50, "pivotX": 50, "name": "icon", "height": 100 }, "compId": 62, "child": [{ "type": "Text", "props": { "y": 119, "x": 50, "width": 99, "valign": "middle", "text": "X3", "pivotY": 16, "pivotX": 50, "name": "num", "height": 31, "fontSize": 25, "align": "center", "runtime": "laya.display.Text" }, "compId": 63 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "width": 148, "visible": false, "skin": "SignView/qiandao-1-7(1).png", "name": "complete", "height": 186 }, "compId": 64, "child": [{ "type": "Image", "props": { "y": 93, "x": 74, "width": 51, "skin": "SignView/qiandao-1-8.png", "pivotY": 26, "pivotX": 26, "height": 51 }, "compId": 65 }] }] }, { "type": "Box", "props": { "y": 413, "x": 1, "width": 490, "height": 158 }, "compId": 66, "child": [{ "type": "Image", "props": { "y": 2, "x": 3, "skin": "SignView/qiandao-1-6.png" }, "compId": 67, "child": [{ "type": "Image", "props": { "y": 20, "x": 243.5, "width": 69, "skin": "SignView/qiandao-1-4.png", "pivotY": 14, "pivotX": 35, "height": 28 }, "compId": 68 }, { "type": "Text", "props": { "y": 6, "x": 237, "text": "7", "fontSize": 25, "color": "#ffffff", "runtime": "laya.display.Text" }, "compId": 69 }] }, { "type": "Button", "props": { "y": 43, "x": 4, "width": 485, "name": "btn", "height": 113 }, "compId": 70 }, { "type": "Image", "props": { "y": 79, "x": 245, "width": 71, "pivotY": 32, "pivotX": 34, "name": "icon", "height": 69 }, "compId": 71, "child": [{ "type": "Text", "props": { "y": 86, "x": 34, "width": 99, "valign": "middle", "text": "X3", "pivotY": 16, "pivotX": 50, "name": "num", "height": 31, "fontSize": 25, "align": "center", "runtime": "laya.display.Text" }, "compId": 72 }] }, { "type": "Image", "props": { "y": 0, "x": 2, "width": 489, "visible": false, "skin": "SignView/qiandao-1-7(1).png", "name": "complete", "height": 157 }, "compId": 73, "child": [{ "type": "Image", "props": { "y": 78.5, "x": 244.5, "width": 51, "skin": "SignView/qiandao-1-8.png", "pivotY": 26, "pivotX": 26, "height": 51 }, "compId": 74 }] }] }] }, { "type": "Button", "props": { "y": 17, "x": 490, "var": "CloseBtn", "stateNum": 1, "skin": "SetView/shezhi-1-3.png" }, "compId": 75 }, { "type": "Button", "props": { "y": 765, "x": 278, "width": 298, "var": "SignBtn", "stateNum": 1, "skin": "SignView/qiandao-1-5.png", "pivotY": 53, "pivotX": 149, "height": 106 }, "compId": 76 }] }], "loadList": ["SetView/shezhi-1-1.png", "SignView/qiandao-1-1.png", "SignView/qiandao-1-3.png", "SignView/qiandao-1-2.png", "SignView/qiandao-1-4.png", "SignView/qiandao-1-7(1).png", "SignView/qiandao-1-8.png", "SignView/qiandao-1-6.png", "SetView/shezhi-1-3.png", "SignView/qiandao-1-5.png"], "loadList3D": [] };
  959. ui.SignViewUI = SignViewUI;
  960. REG("ui.SignViewUI", SignViewUI);
  961. class WinViewUI extends Laya.Scene {
  962. constructor() { super(); }
  963. createChildren() {
  964. super.createChildren();
  965. this.createView(WinViewUI.uiView);
  966. }
  967. }
  968. WinViewUI.uiView = { "type": "Scene", "props": { "width": 720, "visible": true, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "var": "BG", "top": 0, "skin": "WinView/black.png", "sizeGrid": "12,14,12,12", "right": 0, "left": 0, "bottom": 0 }, "compId": 8 }, { "type": "Image", "props": { "y": 520, "x": 360, "width": 720, "skin": "WinView/guoguan-1-1.png", "pivotY": 510, "pivotX": 360, "height": 994 }, "compId": 4, "child": [{ "type": "Image", "props": { "y": 249, "x": 283, "visible": true, "skin": "WinView/guoguan-1-2.png" }, "compId": 5 }] }, { "type": "Button", "props": { "y": 487, "x": 252, "var": "BackBtn", "stateNum": 1, "skin": "WinView/guoguan-1-3.png" }, "compId": 6 }, { "type": "Button", "props": { "y": 600, "x": 228, "var": "NextBtn", "stateNum": 1, "skin": "WinView/guoguan-1-4.png" }, "compId": 7 }], "loadList": ["WinView/black.png", "WinView/guoguan-1-1.png", "WinView/guoguan-1-2.png", "WinView/guoguan-1-3.png", "WinView/guoguan-1-4.png"], "loadList3D": [] };
  969. ui.WinViewUI = WinViewUI;
  970. REG("ui.WinViewUI", WinViewUI);
  971. })(ui || (ui = {}));
  972. var PropEffecf;
  973. (function (PropEffecf) {
  974. PropEffecf[PropEffecf["NONE"] = 0] = "NONE";
  975. PropEffecf[PropEffecf["DOUBLE"] = 1] = "DOUBLE";
  976. PropEffecf[PropEffecf["HAMMER"] = 2] = "HAMMER";
  977. PropEffecf[PropEffecf["UP"] = 3] = "UP";
  978. PropEffecf[PropEffecf["CLEARLAST"] = 4] = "CLEARLAST";
  979. PropEffecf[PropEffecf["CLEARTWO"] = 5] = "CLEARTWO";
  980. })(PropEffecf || (PropEffecf = {}));
  981. var StageMode;
  982. (function (StageMode) {
  983. StageMode[StageMode["ReStart"] = 0] = "ReStart";
  984. StageMode[StageMode["Start"] = 1] = "Start";
  985. StageMode[StageMode["Lose"] = 2] = "Lose";
  986. StageMode[StageMode["Win"] = 3] = "Win";
  987. StageMode[StageMode["Clone"] = 4] = "Clone";
  988. StageMode[StageMode["Over"] = 5] = "Over";
  989. StageMode[StageMode["Revive"] = 6] = "Revive";
  990. StageMode[StageMode["Refresh"] = 7] = "Refresh";
  991. StageMode[StageMode["Check"] = 8] = "Check";
  992. StageMode[StageMode["GetReward"] = 9] = "GetReward";
  993. })(StageMode || (StageMode = {}));
  994. class EventManager {
  995. static EventOn(_mode, caller, fun, args = []) {
  996. EventManager.Instance.on(PropEffecf[_mode], caller, fun, args);
  997. }
  998. static EventOff(_mode, caller, fun, args = []) {
  999. EventManager.Instance.off(PropEffecf[_mode], caller, fun);
  1000. }
  1001. static EventTrigger(_mode, args = []) {
  1002. EventManager.Instance.event(PropEffecf[_mode], args);
  1003. EventManager.PropState = _mode;
  1004. }
  1005. static StageOn(_mode, caller, fun, args = []) {
  1006. EventManager.Instance.on(StageMode[_mode], caller, fun, args);
  1007. }
  1008. static StageOff(_mode, caller, fun, args = []) {
  1009. EventManager.Instance.off(StageMode[_mode], caller, fun);
  1010. }
  1011. static StageTrigger(_mode, args = []) {
  1012. EventManager.Instance.event(StageMode[_mode], args);
  1013. }
  1014. }
  1015. EventManager.Instance = new Laya.EventDispatcher();
  1016. EventManager.PropState = PropEffecf.NONE;
  1017. class GameManager {
  1018. constructor() {
  1019. this.ReviveNum = 0;
  1020. this.ScoreProgress = 0;
  1021. this.ScoreRecord2 = 0;
  1022. this.ScoreRecord = 0;
  1023. this.First = true;
  1024. this.Wave = 1;
  1025. this.CheckHeight = true;
  1026. this.played = false;
  1027. this.EliminateNum = 0;
  1028. GameManager.ins = this;
  1029. EventManager.StageOn(StageMode.Refresh, this, this.Fresh);
  1030. }
  1031. static get Instance() {
  1032. if (GameManager.ins) {
  1033. return GameManager.ins;
  1034. }
  1035. else {
  1036. return new GameManager();
  1037. }
  1038. }
  1039. Fresh() {
  1040. this.ScoreProgress = 0;
  1041. }
  1042. }
  1043. class MainView extends ui.MainSceneUI {
  1044. constructor() {
  1045. super();
  1046. this.STAGE = 0;
  1047. }
  1048. static get Instance() {
  1049. if (MainView.ins) {
  1050. return MainView.ins;
  1051. }
  1052. else {
  1053. return new MainView();
  1054. }
  1055. }
  1056. Show() {
  1057. let stage = AccountManager.Instance.curplayerData.GainAccount("stage");
  1058. this.STAGE = Number(stage);
  1059. this.StartBtn.clickHandler = Laya.Handler.create(this, this.ClickStart);
  1060. this.RankBtn.clickHandler = Laya.Handler.create(this, this.ClickRank);
  1061. this.SignBtn.clickHandler = Laya.Handler.create(this, this.ClickSign);
  1062. this.LotteryBtn.clickHandler = Laya.Handler.create(this, this.ClickLottery);
  1063. this.SetBtn.clickHandler = Laya.Handler.create(this, this.ClickSet);
  1064. this.height = Laya.stage.height;
  1065. this.BG.height = Laya.stage.height;
  1066. Laya.stage.on(Laya.Event.RESIZE, this, () => {
  1067. this.height = Laya.stage.height;
  1068. this.BG.height = Laya.stage.height;
  1069. });
  1070. }
  1071. ClickStart() {
  1072. var agrs = [{ "t": AccountManager.Instance.ServerTime.toString() }];
  1073. ServerManager.Instance.SendHttp(BlastToMerge.KaiShi, agrs, Laya.Handler.create(this, this.GameStart), null);
  1074. }
  1075. GameStart(_data) {
  1076. GameManager.Instance.play_id = _data.play_id;
  1077. EventManager.StageTrigger(StageMode.Start);
  1078. }
  1079. ClickRank() {
  1080. ViewManager.Instance.ShowView(ViewType.RankView);
  1081. }
  1082. ClickLottery() {
  1083. ViewManager.Instance.ShowView(ViewType.LotteryView);
  1084. }
  1085. ClickSign() {
  1086. ViewManager.Instance.ShowView(ViewType.SignView);
  1087. }
  1088. ClickSet() {
  1089. ViewManager.Instance.ShowView(ViewType.SetView);
  1090. }
  1091. Close() {
  1092. }
  1093. }
  1094. class faafssfafsa {
  1095. constructor(_message, _pos, _size, _fontSize, _color = null) {
  1096. this.fontSize = 30;
  1097. this.message = "";
  1098. this.size = new Laya.Vector2(_size.x, _size.y);
  1099. this.fontSize = _fontSize;
  1100. this.color = _color;
  1101. this.message = _message;
  1102. this.pos = _pos;
  1103. }
  1104. }
  1105. class GameTools {
  1106. constructor() {
  1107. GameTools.ins = this;
  1108. }
  1109. static get Instance() {
  1110. if (GameTools.ins) {
  1111. return GameTools.ins;
  1112. }
  1113. else {
  1114. return new GameTools();
  1115. }
  1116. }
  1117. lerp(form, to, t) {
  1118. if (t <= 0) {
  1119. return form;
  1120. }
  1121. else if (t >= 1) {
  1122. return to;
  1123. }
  1124. var a = t * to + (1 - t) * form;
  1125. return a;
  1126. }
  1127. SetCollider(setNode, CollisionGroup) {
  1128. var numchild = setNode.numChildren;
  1129. for (var i = 0; i < setNode.numChildren; i++) {
  1130. var numchild2 = setNode.getChildAt(i).numChildren;
  1131. if (numchild2 > 1) {
  1132. this.SetCollider(setNode.getChildAt(i), CollisionGroup);
  1133. }
  1134. var physicsCollider = setNode.getChildAt(i).getComponent(Laya.PhysicsCollider);
  1135. if (physicsCollider) {
  1136. physicsCollider.collisionGroup = CollisionGroup;
  1137. }
  1138. }
  1139. }
  1140. static RandomNumber(from, to) {
  1141. if (from >= to) {
  1142. return 0;
  1143. }
  1144. var size = to - from;
  1145. var curNumber = Math.random() * size + from;
  1146. return curNumber;
  1147. }
  1148. static RandomANumber(from, to) {
  1149. if (from >= to) {
  1150. return 0;
  1151. }
  1152. var size = to - from;
  1153. var curNumber = Math.random() * size + from;
  1154. return Math.floor(curNumber);
  1155. }
  1156. static GetMoney(_num, _pos = null, _completeHandle = null) {
  1157. if (_num == 0)
  1158. return;
  1159. var fafaafsfa = new Laya.Box;
  1160. fafaafsfa.width = 400;
  1161. fafaafsfa.height = 100;
  1162. fafaafsfa.pivotX = fafaafsfa.width / 2;
  1163. fafaafsfa.pivotY = fafaafsfa.height / 2;
  1164. if (_pos == null) {
  1165. _pos = new Laya.Vector2(Laya.stage.width / 2, Laya.stage.height / 2);
  1166. }
  1167. fafaafsfa.pos(_pos.x, _pos.y);
  1168. var aafafaffa = new Laya.Image;
  1169. aafafaffa.skin = "game/qiandao_1_7.png";
  1170. aafafaffa.width = 60;
  1171. aafafaffa.height = 60;
  1172. aafafaffa.left = 50;
  1173. aafafaffa.y = 10;
  1174. fafaafsfa.addChild(aafafaffa);
  1175. var faasfafsafs = new Laya.Text;
  1176. faasfafsafs.width = 300;
  1177. faasfafsafs.height = 50;
  1178. faasfafsafs.align = "center";
  1179. faasfafsafs.valign = "middle";
  1180. faasfafsafs.font = "Microsoft YaHei";
  1181. faasfafsafs.fontSize = 40;
  1182. faasfafsafs.color = "#FFFFFF";
  1183. faasfafsafs.bold = true;
  1184. faasfafsafs.font = "Microsoft YaHei";
  1185. faasfafsafs.text = "金币 +" + _num;
  1186. faasfafsafs.x = 60;
  1187. faasfafsafs.y = 10;
  1188. fafaafsfa.addChild(faasfafsafs);
  1189. Laya.stage.addChild(fafaafsfa);
  1190. var faasfsaf = Laya.Tween.to(fafaafsfa, { y: fafaafsfa.y - 200 }, 1500, Laya.Ease.expoInOut, Laya.Handler.create(this, () => {
  1191. faasfsaf.clear();
  1192. fafaafsfa.destroy();
  1193. if (_completeHandle) {
  1194. _completeHandle.run();
  1195. }
  1196. }), 100);
  1197. }
  1198. static TweenText(faafssfafsa, _hight, _completeHandle = null, hide = true, _duration = 500) {
  1199. var afasafsafsfa = new Laya.Text();
  1200. afasafsafsfa.width = faafssfafsa.size.x;
  1201. afasafsafsfa.height = faafssfafsa.size.y;
  1202. afasafsafsfa.align = "center";
  1203. afasafsafsfa.valign = "middle";
  1204. afasafsafsfa.font = "Microsoft YaHei";
  1205. afasafsafsfa.fontSize = faafssfafsa.fontSize;
  1206. afasafsafsfa.pivotX = afasafsafsfa.width / 2;
  1207. afasafsafsfa.pivotY = afasafsafsfa.height / 2;
  1208. afasafsafsfa.color = "#5ad122";
  1209. afasafsafsfa.bold = true;
  1210. afasafsafsfa.stroke = 5;
  1211. afasafsafsfa.strokeColor = "#ffffff";
  1212. if (faafssfafsa.color) {
  1213. faafssfafsa.color = faafssfafsa.color;
  1214. }
  1215. afasafsafsfa.text = faafssfafsa.message;
  1216. afasafsafsfa.zOrder = 1;
  1217. Laya.stage.addChildAt(afasafsafsfa, Laya.stage.numChildren - 1);
  1218. afasafsafsfa.pos(faafssfafsa.pos.x, faafssfafsa.pos.y);
  1219. var tween = Laya.Tween.to(afasafsafsfa, { y: afasafsafsfa.y - _hight, update: new Laya.Handler(this, function () {
  1220. }) }, _duration, Laya.Ease.expoInOut, Laya.Handler.create(this, function () {
  1221. tween.clear();
  1222. if (hide) {
  1223. afasafsafsfa.destroy();
  1224. }
  1225. if (_completeHandle) {
  1226. _completeHandle.run();
  1227. }
  1228. }));
  1229. if (hide) {
  1230. Laya.Tween.to(afasafsafsfa, { alpha: 0.4 }, 500);
  1231. }
  1232. return afasafsafsfa;
  1233. }
  1234. static StationTweenText(faafssfafsa, _hight, _completeHandle = null, hide = true, _duration = 500) {
  1235. var afasafsafsfa = new Laya.Text();
  1236. afasafsafsfa.width = faafssfafsa.size.x;
  1237. afasafsafsfa.height = faafssfafsa.size.y;
  1238. afasafsafsfa.align = "center";
  1239. afasafsafsfa.valign = "middle";
  1240. afasafsafsfa.font = "Microsoft YaHei";
  1241. afasafsafsfa.fontSize = 50;
  1242. afasafsafsfa.pivotX = afasafsafsfa.width / 2;
  1243. afasafsafsfa.pivotY = afasafsafsfa.height / 2;
  1244. afasafsafsfa.color = "#5ad122";
  1245. afasafsafsfa.bold = true;
  1246. afasafsafsfa.stroke = 5;
  1247. afasafsafsfa.strokeColor = "#ffffff";
  1248. if (faafssfafsa.color) {
  1249. faafssfafsa.color = faafssfafsa.color;
  1250. }
  1251. afasafsafsfa.text = faafssfafsa.message;
  1252. afasafsafsfa.zOrder = 1;
  1253. Laya.stage.addChildAt(afasafsafsfa, Laya.stage.numChildren - 1);
  1254. afasafsafsfa.pos(faafssfafsa.pos.x, faafssfafsa.pos.y);
  1255. var tween = Laya.Tween.to(afasafsafsfa, { y: afasafsafsfa.y - _hight, update: new Laya.Handler(this, function () {
  1256. }) }, _duration, Laya.Ease.expoInOut, Laya.Handler.create(this, function () {
  1257. tween.clear();
  1258. if (hide) {
  1259. afasafsafsfa.destroy();
  1260. }
  1261. if (_completeHandle) {
  1262. _completeHandle.run();
  1263. }
  1264. }));
  1265. if (hide) {
  1266. Laya.Tween.to(afasafsafsfa, { alpha: 0.4 }, 10000);
  1267. }
  1268. return afasafsafsfa;
  1269. }
  1270. static tweenMove(transform, targPos, delay, ease, complete) {
  1271. let curPos = transform.position.clone();
  1272. return Laya.Tween.to(curPos, {
  1273. x: targPos.x,
  1274. y: targPos.y,
  1275. z: targPos.z,
  1276. update: new Laya.Handler(this, () => {
  1277. transform.position = curPos.clone();
  1278. })
  1279. }, delay, ease, complete);
  1280. }
  1281. static tweenRotate(transform, targEuler, delay, ease, complete) {
  1282. let curEuler = transform.rotationEuler.clone();
  1283. return Laya.Tween.to(curEuler, {
  1284. x: targEuler.x,
  1285. y: targEuler.y,
  1286. z: targEuler.z,
  1287. update: new Laya.Handler(this, () => {
  1288. transform.rotationEuler = curEuler.clone();
  1289. })
  1290. }, delay, ease, complete);
  1291. }
  1292. }
  1293. var MusicType;
  1294. (function (MusicType) {
  1295. MusicType[MusicType["clear"] = 0] = "clear";
  1296. MusicType[MusicType["down"] = 1] = "down";
  1297. })(MusicType || (MusicType = {}));
  1298. class AudioManager {
  1299. constructor() { }
  1300. static musicres(_type) {
  1301. return "Game/res/Music/" + MusicType[_type] + ".wav";
  1302. }
  1303. static playMusic(_type) {
  1304. if (!this.open)
  1305. return;
  1306. Laya.SoundManager.playSound(this.musicres(_type));
  1307. }
  1308. static StopMusic() {
  1309. Laya.SoundManager.stopMusic();
  1310. }
  1311. }
  1312. AudioManager.open = true;
  1313. class DropRule {
  1314. constructor() {
  1315. this.EffectName = new Array("blue", "yellow", "purple", "green");
  1316. this.EffectArray = [];
  1317. this.PrefabName = new Array("2", "4", "8", "16", "32", "64", "128", "256", "512", "1024", "2048", "4096", "8192", "16384", "32768", "65536", "131072", "262144");
  1318. this.Cloned = false;
  1319. DropRule.ins = this;
  1320. this.Init();
  1321. this.InitEffect();
  1322. EventManager.StageOn(StageMode.Refresh, this, this.Init);
  1323. }
  1324. static get Instance() {
  1325. if (DropRule.ins) {
  1326. return DropRule.ins;
  1327. }
  1328. else {
  1329. return new DropRule();
  1330. }
  1331. }
  1332. Init(_data) {
  1333. this.STAGE = Number(AccountManager.Instance.curplayerData.GainAccount("stage"));
  1334. let level = AccountManager.Instance.curplayerData.GainCollocation("level");
  1335. if (_data) {
  1336. for (var key in level) {
  1337. if (level[key].id == this.STAGE) {
  1338. let Level = level[Number(key)];
  1339. this.DropHeight = Number(Level.hight);
  1340. this.GoalScore = Number(Level.goal);
  1341. this.BallNum = Level.edge.split(";");
  1342. this.StartNum = Number(Level.start_number);
  1343. this.DropNum = Level.drop_number.split(";");
  1344. let min = Number(this.BallNum[0]);
  1345. let minnext = Number(this.BallNum[1]);
  1346. this.MinBall = Number(this.PrefabName[min - 1]);
  1347. this.MinNextBall = Number(this.PrefabName[minnext - 1]);
  1348. }
  1349. }
  1350. }
  1351. else {
  1352. for (var key in level) {
  1353. if (level[key].id == this.STAGE) {
  1354. let Level = level[Number(key)];
  1355. this.DropHeight = Number(Level.hight);
  1356. this.GoalScore = Number(Level.goal);
  1357. this.SizeIndex = Level.index.split(";");
  1358. console.log(this.SizeIndex);
  1359. this.BallNum = Level.edge.split(";");
  1360. this.StartNum = Number(Level.start_number);
  1361. this.DropNum = Level.drop_number.split(";");
  1362. this.EdgeIndex = Level.edgeindex.split(";");
  1363. let min = Number(this.BallNum[0]);
  1364. let minnext = Number(this.BallNum[this.BallNum.length - 1]);
  1365. this.MinBall = Number(this.PrefabName[min - 1]);
  1366. this.MinNextBall = Number(this.PrefabName[minnext - 1]);
  1367. }
  1368. }
  1369. }
  1370. this.Read();
  1371. }
  1372. InitEffect() {
  1373. for (let i = 0; i < this.EffectName.length; i++) {
  1374. this.ReadJson(i);
  1375. }
  1376. }
  1377. ReadJson(i) {
  1378. Laya.loader.create("Effect/" + this.EffectName[i] + ".json", Laya.Handler.create(this, this.creat));
  1379. }
  1380. creat(Prefab) {
  1381. let obj = new Laya.Prefab();
  1382. obj.json = Prefab;
  1383. this.EffectArray.push(obj);
  1384. }
  1385. CreateEffect(_score, _pos) {
  1386. let effect;
  1387. let index;
  1388. if (_score == 2 || _score == 16 || _score == 256 || _score == 2048 || _score == 32768 || _score == 262144) {
  1389. effect = this.EffectArray[3];
  1390. index = 3;
  1391. }
  1392. else if (_score == 8 || _score == 32 || _score == 4096 || _score == 131072) {
  1393. effect = this.EffectArray[1];
  1394. index = 1;
  1395. }
  1396. else if (_score == 64 || _score == 512 || _score == 16384) {
  1397. effect = this.EffectArray[2];
  1398. index = 2;
  1399. }
  1400. else if (_score == 4 || _score == 128 || _score == 1024 || _score == 8192 || _score == 65536) {
  1401. effect = this.EffectArray[0];
  1402. index = 0;
  1403. }
  1404. let pre = Laya.Pool.getItemByCreateFun(this.EffectName[index], effect.create, effect);
  1405. pre.pos(_pos.x, _pos.y);
  1406. Laya.stage.addChild(pre);
  1407. pre.on(Laya.Event.COMPLETE, this, () => {
  1408. pre.removeSelf();
  1409. pre.destroy();
  1410. });
  1411. }
  1412. GetBallIndex(_score) {
  1413. let num;
  1414. for (let i = 0; i < this.PrefabName.length; i++) {
  1415. if (_score == Number(this.PrefabName[i])) {
  1416. num = i;
  1417. }
  1418. else if (_score > Number(this.PrefabName[i]) && _score < Number(this.PrefabName[i + 1])) {
  1419. num = i;
  1420. }
  1421. }
  1422. return num;
  1423. }
  1424. GetScore(_score) {
  1425. let num;
  1426. for (let i = 0; i < this.PrefabName.length; i++) {
  1427. if (_score == Number(this.PrefabName[i])) {
  1428. num = Number(this.PrefabName[i]);
  1429. }
  1430. else if (_score > Number(this.PrefabName[i]) && _score < Number(this.PrefabName[i + 1])) {
  1431. num = Number(this.PrefabName[i]);
  1432. }
  1433. }
  1434. return num;
  1435. }
  1436. GetBallSize(_score) {
  1437. let num;
  1438. let index;
  1439. let size = 0;
  1440. for (let i = 0; i < this.PrefabName.length; i++) {
  1441. if (_score == Number(this.PrefabName[i])) {
  1442. num = i;
  1443. }
  1444. else if (_score > Number(this.PrefabName[i]) && _score < Number(this.PrefabName[i + 1])) {
  1445. num = i;
  1446. }
  1447. }
  1448. for (let j = 0; j < this.EdgeIndex.length; j++) {
  1449. if (num + 1 == Number(this.EdgeIndex[j])) {
  1450. index = Number(this.SizeIndex[j]);
  1451. size = this.Size(num + 1, index);
  1452. }
  1453. }
  1454. if (size == 0) {
  1455. let cimi = Number(this.EdgeIndex[this.EdgeIndex.length - 1]);
  1456. index = Number(this.SizeIndex[this.EdgeIndex.length - 1]);
  1457. size = this.Size(cimi, index);
  1458. let n = (num + 1) - cimi;
  1459. size = size + (n * 5);
  1460. }
  1461. return size;
  1462. }
  1463. Size(_index, sizelevel) {
  1464. let ballsize;
  1465. let ball = AccountManager.Instance.curplayerData.GainCollocation("ball");
  1466. for (var key in ball) {
  1467. let item = ball[key];
  1468. if (_index == item.ball && sizelevel == item.size_level) {
  1469. ballsize = Number(item.size);
  1470. }
  1471. }
  1472. return ballsize;
  1473. }
  1474. CreatBall(_index, size, pos) {
  1475. let ball = new Laya.Image();
  1476. ball.skin = "Game/res/Ball/blast" + _index + ".png";
  1477. ball.anchorX = 0.5;
  1478. ball.anchorY = 0.5;
  1479. ball.height = size;
  1480. ball.width = size;
  1481. let _rig = ball.getComponent(Laya.RigidBody);
  1482. if (!_rig) {
  1483. let rig = ball.addComponent(Laya.RigidBody);
  1484. rig.allowRotation = true;
  1485. rig.gravityScale = 3;
  1486. }
  1487. else {
  1488. _rig.enabled = true;
  1489. }
  1490. let _collider = ball.getComponent(Laya.CircleCollider);
  1491. if (!_collider) {
  1492. let collider = ball.addComponent(Laya.CircleCollider);
  1493. collider.restitution = AccountManager.Instance.curplayerData.Restitution;
  1494. if (this.STAGE == 1 && GameManager.Instance.Wave < 3) {
  1495. collider.restitution = 0;
  1496. }
  1497. collider.radius = size / 2;
  1498. }
  1499. else {
  1500. _collider.enabled = true;
  1501. _collider.isSensor = false;
  1502. }
  1503. let _num = ball.getChildByName("num");
  1504. let zi;
  1505. if (!_num) {
  1506. let num = new Laya.FontClip();
  1507. num.name = "num";
  1508. num.skin = "Game/res/Ball/44.png";
  1509. num.anchorX = 0.5;
  1510. num.anchorY = 0.5;
  1511. num.sheet = "0123456789";
  1512. zi = this.PrefabName[_index];
  1513. num.value = zi;
  1514. ball.addChild(num);
  1515. num.centerX = 0;
  1516. num.centerY = 0;
  1517. }
  1518. let _light = ball.getChildByName("light");
  1519. if (!_light) {
  1520. let light = new Laya.Image();
  1521. light.skin = "Game/res/Ball/" + zi + ".png";
  1522. light.anchorX = 0.5;
  1523. light.anchorY = 0.5;
  1524. light.width = this.LightSize(size);
  1525. light.height = this.LightSize(size);
  1526. light.name = "light";
  1527. ball.addChild(light);
  1528. light.centerX = 0;
  1529. light.centerY = 0;
  1530. }
  1531. let _script = ball.getComponent(Ball);
  1532. if (!_script) {
  1533. let script = ball.addComponent(Ball);
  1534. }
  1535. ball.pos(pos.x, pos.y);
  1536. Laya.timer.once(1, this, () => {
  1537. EventManager.StageTrigger(StageMode.Clone, [ball]);
  1538. });
  1539. this.Cloned = true;
  1540. AudioManager.playMusic(MusicType.down);
  1541. }
  1542. CreatBall2(_index, size, pos) {
  1543. let ball = new Laya.Image();
  1544. ball.skin = "Game/res/Ball/blast" + _index + ".png";
  1545. ball.anchorX = 0.5;
  1546. ball.anchorY = 0.5;
  1547. ball.height = size;
  1548. ball.width = size;
  1549. let _rig = ball.getComponent(Laya.RigidBody);
  1550. if (!_rig) {
  1551. let rig = ball.addComponent(Laya.RigidBody);
  1552. rig.allowRotation = true;
  1553. rig.gravityScale = 3;
  1554. }
  1555. else {
  1556. _rig.enabled = true;
  1557. }
  1558. let _collider = ball.getComponent(Laya.CircleCollider);
  1559. if (!_collider) {
  1560. let collider = ball.addComponent(Laya.CircleCollider);
  1561. collider.restitution = AccountManager.Instance.curplayerData.Restitution;
  1562. if (this.STAGE == 1 && GameManager.Instance.Wave < 3) {
  1563. collider.restitution = 0;
  1564. }
  1565. collider.radius = size / 2;
  1566. }
  1567. else {
  1568. _collider.enabled = true;
  1569. _collider.isSensor = false;
  1570. }
  1571. let _num = ball.getChildByName("num");
  1572. let zi;
  1573. if (!_num) {
  1574. let num = new Laya.FontClip();
  1575. num.name = "num";
  1576. num.skin = "Game/res/Ball/44.png";
  1577. num.anchorX = 0.5;
  1578. num.anchorY = 0.5;
  1579. num.sheet = "0123456789";
  1580. zi = this.PrefabName[_index];
  1581. num.value = zi;
  1582. ball.addChild(num);
  1583. num.centerX = 0;
  1584. num.centerY = 0;
  1585. }
  1586. let _light = ball.getChildByName("light");
  1587. if (!_light) {
  1588. let light = new Laya.Image();
  1589. light.skin = "Game/res/Ball/" + zi + ".png";
  1590. light.anchorX = 0.5;
  1591. light.anchorY = 0.5;
  1592. light.width = this.LightSize(size);
  1593. light.height = this.LightSize(size);
  1594. light.name = "light";
  1595. ball.addChild(light);
  1596. light.centerX = 0;
  1597. light.centerY = 0;
  1598. }
  1599. let _script = ball.getComponent(Ball);
  1600. if (!_script) {
  1601. let script = ball.addComponent(Ball);
  1602. }
  1603. this.SetPosition(ball, pos);
  1604. Laya.timer.once(1, this, () => {
  1605. EventManager.StageTrigger(StageMode.Clone, [ball]);
  1606. });
  1607. AudioManager.playMusic(MusicType.down);
  1608. }
  1609. SetPosition(_node, _pos) {
  1610. _node.pos(_pos.x, _pos.y);
  1611. }
  1612. LightSize(_size) {
  1613. let num;
  1614. switch (_size) {
  1615. case 65:
  1616. num = 79;
  1617. break;
  1618. case 70:
  1619. num = 87;
  1620. break;
  1621. case 75:
  1622. num = 95;
  1623. break;
  1624. case 80:
  1625. num = 100;
  1626. break;
  1627. case 85:
  1628. num = 105;
  1629. break;
  1630. case 90:
  1631. num = 110;
  1632. break;
  1633. case 95:
  1634. num = 117;
  1635. break;
  1636. case 100:
  1637. num = 124;
  1638. break;
  1639. case 105:
  1640. num = 130;
  1641. break;
  1642. case 110:
  1643. num = 136;
  1644. break;
  1645. case 115:
  1646. num = 143;
  1647. break;
  1648. case 120:
  1649. num = 150;
  1650. break;
  1651. case 125:
  1652. num = 152;
  1653. break;
  1654. case 130:
  1655. num = 160;
  1656. break;
  1657. case 135:
  1658. num = 165;
  1659. break;
  1660. case 140:
  1661. num = 174;
  1662. break;
  1663. case 145:
  1664. num = 181;
  1665. break;
  1666. case 150:
  1667. num = 186;
  1668. break;
  1669. case 155:
  1670. num = 192;
  1671. break;
  1672. case 160:
  1673. num = 199;
  1674. break;
  1675. case 165:
  1676. num = 202;
  1677. break;
  1678. case 170:
  1679. num = 210;
  1680. break;
  1681. case 175:
  1682. num = 215;
  1683. break;
  1684. case 180:
  1685. num = 223;
  1686. break;
  1687. }
  1688. return num;
  1689. }
  1690. FallDown(_time) {
  1691. if (!_time) {
  1692. let mindrop = Number(this.DropNum[0]);
  1693. let maxdrop = Number(this.DropNum[1]);
  1694. _time = GameTools.RandomANumber(mindrop, maxdrop + 1);
  1695. }
  1696. let min = Number(this.BallNum[0]);
  1697. let max = Number(this.BallNum[this.BallNum.length - 1]);
  1698. let index;
  1699. let size;
  1700. for (let j = 0; j < _time; j++) {
  1701. let num = GameTools.RandomANumber(min, max + 1);
  1702. for (let i = 0; i < this.BallNum.length; i++) {
  1703. if (num == Number(this.BallNum[i])) {
  1704. index = Number(this.SizeIndex[i]);
  1705. size = this.Size(num, index);
  1706. }
  1707. }
  1708. let X = GameTools.RandomANumber(100, 500);
  1709. let pos = new Laya.Vector2(X, 30);
  1710. this.CreatBall2(num - 1, size, pos);
  1711. }
  1712. }
  1713. GuideFallDown() {
  1714. GameManager.Instance.CheckHeight = false;
  1715. let num;
  1716. let shuliang;
  1717. if (GameManager.Instance.Wave == 1) {
  1718. shuliang = 2;
  1719. num = 1;
  1720. }
  1721. else if (GameManager.Instance.Wave == 2) {
  1722. shuliang = 2;
  1723. num = 2;
  1724. }
  1725. else if (GameManager.Instance.Wave == 3) {
  1726. shuliang = 6;
  1727. num = 1;
  1728. }
  1729. else if (GameManager.Instance.Wave == 4) {
  1730. shuliang = 12;
  1731. num = 1;
  1732. }
  1733. else if (GameManager.Instance.Wave == 5) {
  1734. shuliang = 6;
  1735. num = 2;
  1736. }
  1737. else if (GameManager.Instance.Wave == 6) {
  1738. shuliang = 12;
  1739. num = 2;
  1740. }
  1741. else {
  1742. GameManager.Instance.CheckHeight = true;
  1743. this.DropHeight = AccountManager.Instance.curplayerData.GuideHeight;
  1744. let mindrop = Number(this.DropNum[0]);
  1745. let maxdrop = Number(this.DropNum[1]);
  1746. num = GameTools.RandomANumber(mindrop, maxdrop + 1);
  1747. }
  1748. let score = Number(this.PrefabName[num - 1]);
  1749. let index = this.GetBallIndex(score);
  1750. let size = this.GetBallSize(score);
  1751. for (let j = 0; j < shuliang; j++) {
  1752. let X = GameTools.RandomANumber(100, 500);
  1753. let pos = new Laya.Vector2(X, 30);
  1754. this.CreatBall2(num - 1, size, pos);
  1755. }
  1756. }
  1757. RecoverScene() {
  1758. for (let i = 0; i < this.progress.length - 3; i++) {
  1759. let item = this.progress[i];
  1760. this.CreatBall2(Number(item.index) - 1, Number(item.size), new Laya.Vector2(Number(item.pos.x), Number(item.pos.y)));
  1761. }
  1762. }
  1763. Read() {
  1764. if (this.STAGE > 1) {
  1765. var args = [{ "stage": "0" }];
  1766. ServerManager.Instance.SendHttp(BlastToMerge.GetProgress, args, Laya.Handler.create(this, (res) => {
  1767. let json = JSON.parse(res.user_game.detail);
  1768. this.progress = json;
  1769. if (this.progress.length > 1) {
  1770. let items = this.progress[this.progress.length - 2];
  1771. let _score = Number(items.jindu);
  1772. GameManager.Instance.ScoreProgress = _score;
  1773. this.SizeIndex = this.progress[this.progress.length - 1].sizeindex;
  1774. this.EdgeIndex = this.progress[this.progress.length - 3].edgeindex;
  1775. }
  1776. console.log("获取进度成功");
  1777. }), Laya.Handler.create(this, () => {
  1778. console.log("获取进度失败");
  1779. }));
  1780. }
  1781. }
  1782. }
  1783. class GamePool {
  1784. constructor() {
  1785. this.modelpool = {};
  1786. this.maxAcount = 30;
  1787. GamePool.ins = this;
  1788. }
  1789. static get Instance() {
  1790. if (GamePool.ins) {
  1791. return GamePool.ins;
  1792. }
  1793. else {
  1794. return new GamePool();
  1795. }
  1796. }
  1797. GetModel(title) {
  1798. var poolname = title;
  1799. if (this.modelpool[poolname] != null && this.modelpool[poolname] != undefined) {
  1800. if (this.modelpool[poolname].length > 0) {
  1801. var model1 = this.modelpool[poolname][0];
  1802. this.modelpool[poolname].splice(0, 1);
  1803. if (!model1.active) {
  1804. model1.active = true;
  1805. }
  1806. model1.active = true;
  1807. return model1;
  1808. }
  1809. else {
  1810. var model = new Laya.Image();
  1811. return model;
  1812. }
  1813. }
  1814. else {
  1815. var model = new Laya.Image();
  1816. model.active = true;
  1817. return model;
  1818. }
  1819. }
  1820. RecoverModel(_image, title = "", modelstate = false) {
  1821. if (_image.destroyed) {
  1822. return;
  1823. }
  1824. if (!modelstate && _image.active == false) {
  1825. return;
  1826. }
  1827. var poolname = title;
  1828. if (this.modelpool[poolname] != null && this.modelpool[poolname] != undefined) {
  1829. var modelnum = this.modelpool[poolname];
  1830. if (modelnum.length > this.maxAcount) {
  1831. _image.destroy();
  1832. return;
  1833. }
  1834. else {
  1835. modelnum.push(_image);
  1836. }
  1837. }
  1838. else {
  1839. modelnum = [];
  1840. modelnum.push(_image);
  1841. this.modelpool[poolname] = modelnum;
  1842. }
  1843. _image.pos(-1000, 0);
  1844. _image.removeSelf();
  1845. _image.active = false;
  1846. }
  1847. }
  1848. var Vector2 = Laya.Vector2;
  1849. class Ball extends Laya.Script {
  1850. constructor() {
  1851. super();
  1852. this.moved = false;
  1853. this.mark = false;
  1854. this.clear = false;
  1855. this.score = 0;
  1856. Ball.ins = this;
  1857. }
  1858. static get Instance() {
  1859. if (Ball.ins) {
  1860. return Ball.ins;
  1861. }
  1862. else {
  1863. return new Ball();
  1864. }
  1865. }
  1866. onAwake() {
  1867. this.Light = this.owner.getChildByName("light");
  1868. this.Light.visible = false;
  1869. this.owner.on(Laya.Event.CLICK, this, this.ClickBall);
  1870. EventManager.EventOn(PropEffecf.DOUBLE, this, this.ClickDouble);
  1871. EventManager.EventOn(PropEffecf.NONE, this, this.ClickNone);
  1872. EventManager.EventOn(PropEffecf.HAMMER, this, this.ClickHammer);
  1873. let score = this.owner.getChildByName("num");
  1874. this.score = Number(score.value);
  1875. }
  1876. onEnable() {
  1877. }
  1878. onUpdate() {
  1879. this.CheckLight();
  1880. if (this.mark) {
  1881. let _rig = this.owner.getComponent(Laya.RigidBody);
  1882. let _collider = this.owner.getComponent(Laya.CircleCollider);
  1883. _collider.isSensor = true;
  1884. _collider.enabled = false;
  1885. _rig.enabled = false;
  1886. this.Move(GameManager.Instance.TargetPosition);
  1887. this.moved = true;
  1888. }
  1889. }
  1890. CheckLight() {
  1891. let light = false;
  1892. let _node = this.owner;
  1893. for (let i = 0; i < InGameView.Instance.prefabbox.numChildren; i++) {
  1894. let other = InGameView.Instance.prefabbox.getChildAt(i);
  1895. let ball = other.getComponent(Ball);
  1896. if (other.x == _node.x && other.y == _node.y) {
  1897. continue;
  1898. }
  1899. let distan = Laya.Vector3.distance(new Laya.Vector3(other.x, other.y, 0), new Laya.Vector3(_node.x, _node.y, 0));
  1900. let dis = _node.width / 2 + other.width / 2;
  1901. if (Math.abs(distan - dis) <= 3 || Math.abs(distan - dis) <= 3) {
  1902. if (ball.score == this.score) {
  1903. light = true;
  1904. }
  1905. }
  1906. }
  1907. if (light) {
  1908. this.Light.visible = true;
  1909. }
  1910. else {
  1911. this.Light.visible = false;
  1912. }
  1913. }
  1914. ClickNone() {
  1915. this.owner.off(Laya.Event.CLICK, this, this.Hammer);
  1916. this.owner.off(Laya.Event.CLICK, this, this.Double);
  1917. this.owner.on(Laya.Event.CLICK, this, this.ClickBall);
  1918. }
  1919. ClickDouble() {
  1920. this.owner.off(Laya.Event.CLICK, this, this.ClickBall);
  1921. this.owner.off(Laya.Event.CLICK, this, this.Hammer);
  1922. this.owner.on(Laya.Event.CLICK, this, this.Double);
  1923. }
  1924. Double() {
  1925. var args = [{ "t": AccountManager.Instance.ServerTime.toString() }, { "play_id": GameManager.Instance.play_id }, { "fid": "1" }];
  1926. ServerManager.Instance.SendHttp(BlastToMerge.Use, args, Laya.Handler.create(this, () => {
  1927. let num = this.score * 2;
  1928. let owner = this.owner;
  1929. let _position = new Laya.Vector2(owner.x, owner.y);
  1930. let _rig = this.owner.getComponent(Laya.RigidBody);
  1931. let _collider = this.owner.getComponent(Laya.CircleCollider);
  1932. _collider.enabled = false;
  1933. _rig.enabled = false;
  1934. owner.removeSelf();
  1935. owner.destroy();
  1936. let _index = DropRule.Instance.GetBallIndex(this.score).toString();
  1937. GamePool.Instance.RecoverModel(owner, "img" + _index);
  1938. let id = DropRule.Instance.GetBallIndex(num);
  1939. let size = DropRule.Instance.GetBallSize(num);
  1940. GameManager.Instance.ScoreProgress += num;
  1941. DropRule.Instance.CreatBall(id, size, _position);
  1942. InGameView.Instance.SkillNumRefresh();
  1943. EventManager.EventTrigger(PropEffecf.NONE);
  1944. }), Laya.Handler.create(this, () => {
  1945. console.log("道具使用失败");
  1946. }));
  1947. }
  1948. ClickHammer() {
  1949. this.owner.off(Laya.Event.CLICK, this, this.ClickBall);
  1950. this.owner.off(Laya.Event.CLICK, this, this.Double);
  1951. this.owner.on(Laya.Event.CLICK, this, this.Hammer);
  1952. }
  1953. Hammer() {
  1954. var args = [{ "t": AccountManager.Instance.ServerTime.toString() }, { "play_id": GameManager.Instance.play_id }, { "fid": "4" }];
  1955. ServerManager.Instance.SendHttp(BlastToMerge.Use, args, Laya.Handler.create(this, () => {
  1956. let num = this.score;
  1957. let owner = this.owner;
  1958. GameManager.Instance.ScoreProgress += num;
  1959. let _rig = this.owner.getComponent(Laya.RigidBody);
  1960. let _collider = this.owner.getComponent(Laya.CircleCollider);
  1961. _collider.enabled = false;
  1962. _rig.enabled = false;
  1963. owner.removeSelf();
  1964. owner.destroy();
  1965. InGameView.Instance.SkillNumRefresh();
  1966. EventManager.EventTrigger(PropEffecf.NONE);
  1967. InGameView.Instance.EffectMode(false);
  1968. }), Laya.Handler.create(this, () => {
  1969. console.log("道具使用失败");
  1970. }));
  1971. }
  1972. onDestroy() {
  1973. this.owner.offAll();
  1974. EventManager.EventOff(PropEffecf.DOUBLE, this, this.ClickDouble);
  1975. EventManager.EventOff(PropEffecf.NONE, this, this.ClickNone);
  1976. EventManager.EventOff(PropEffecf.HAMMER, this, this.ClickHammer);
  1977. }
  1978. onTriggerEnter(other) {
  1979. let targetparent = other.owner;
  1980. if (DropRule.Instance.STAGE == 1 && GameManager.Instance.Wave < 3) {
  1981. if (targetparent.name == "BottomCollider" && this.Light.visible == true) {
  1982. if (!InGameView.Instance.guide.isPlaying && !GameManager.Instance.played) {
  1983. InGameView.Instance.guide.play(null, false);
  1984. GameManager.Instance.played = true;
  1985. }
  1986. InGameView.Instance.Guide.visible = true;
  1987. }
  1988. }
  1989. }
  1990. Move(_position) {
  1991. if (!this.moved) {
  1992. let owner = this.owner;
  1993. GameManager.Instance.EliminateNum += 1;
  1994. let ball = owner.getComponent(Ball);
  1995. let ownerscore = ball.score;
  1996. GameManager.Instance.ScoreRecord += ownerscore;
  1997. GameManager.Instance.ScoreRecord2 = GameManager.Instance.ScoreRecord;
  1998. let move = Laya.Tween.to(this.owner, {
  1999. x: _position.x, y: _position.y, update: new Laya.Handler(this, function () {
  2000. })
  2001. }, AccountManager.Instance.curplayerData.MergeSpeed * 1000, Laya.Ease.linearInOut, Laya.Handler.create(this, () => {
  2002. move.clear();
  2003. this.owner.removeSelf();
  2004. if (!DropRule.Instance.Cloned) {
  2005. let num = DropRule.Instance.GetBallIndex(GameManager.Instance.ScoreRecord2);
  2006. let size = DropRule.Instance.GetBallSize(GameManager.Instance.ScoreRecord2);
  2007. let score = DropRule.Instance.GetScore(GameManager.Instance.ScoreRecord2);
  2008. let ball = DropRule.Instance.CreatBall(num, size, GameManager.Instance.TargetPosition);
  2009. GameManager.Instance.ScoreProgress += score;
  2010. if (GameManager.Instance.EliminateNum >= AccountManager.Instance.curplayerData.ShakeNum) {
  2011. WXSDK.Shake();
  2012. }
  2013. if (DropRule.Instance.STAGE > 1) {
  2014. DropRule.Instance.FallDown();
  2015. }
  2016. GameManager.Instance.EliminateNum = 0;
  2017. GameManager.Instance.ScoreRecord = 0;
  2018. GameManager.Instance.played = false;
  2019. GameManager.Instance.Wave += 1;
  2020. AudioManager.playMusic(MusicType.clear);
  2021. if (DropRule.Instance.STAGE == 1) {
  2022. if (InGameView.Instance.Guide.visible == true) {
  2023. InGameView.Instance.Guide.visible = false;
  2024. }
  2025. DropRule.Instance.GuideFallDown();
  2026. }
  2027. EventManager.StageTrigger(StageMode.Check);
  2028. }
  2029. }));
  2030. }
  2031. }
  2032. ClickBall() {
  2033. let owner = this.owner;
  2034. DropRule.Instance.Cloned = false;
  2035. GameManager.Instance.TargetPosition = new Vector2(owner.x, owner.y);
  2036. this.MouseClick(owner);
  2037. }
  2038. MouseClick(_node) {
  2039. let _nodeball = _node.getComponent(Ball);
  2040. for (let i = 0; i < InGameView.Instance.prefabbox.numChildren; i++) {
  2041. let other = InGameView.Instance.prefabbox.getChildAt(i);
  2042. let ball = other.getComponent(Ball);
  2043. if (other.x == _node.x && other.y == _node.y) {
  2044. continue;
  2045. }
  2046. if (ball.mark) {
  2047. continue;
  2048. }
  2049. let distan = Laya.Vector3.distance(new Laya.Vector3(other.x, other.y, 0), new Laya.Vector3(_node.x, _node.y, 0));
  2050. let distanceX = Math.abs(_node.x - other.x);
  2051. let distanceY = Math.abs(_node.y - other.y);
  2052. let dis = _node.width / 2 + other.width / 2;
  2053. if (Math.abs(distan - dis) <= AccountManager.Instance.curplayerData.Distance || Math.abs(distan - dis) <= AccountManager.Instance.curplayerData.Distance) {
  2054. if (ball.score == _nodeball.score) {
  2055. ball.mark = true;
  2056. this.MouseClick(other);
  2057. }
  2058. }
  2059. }
  2060. }
  2061. }
  2062. class InGameView extends ui.InGameSceneUI {
  2063. constructor() {
  2064. super();
  2065. this.LoseView = false;
  2066. this.WinView = false;
  2067. InGameView.ins = this;
  2068. EventManager.StageOn(StageMode.Clone, this, this.AddPrefab);
  2069. EventManager.StageOn(StageMode.Win, this, this.Win);
  2070. EventManager.StageOn(StageMode.Lose, this, this.Lose);
  2071. EventManager.StageOn(StageMode.ReStart, this, this.ReStart);
  2072. EventManager.StageOn(StageMode.Over, this, this.Over);
  2073. EventManager.StageOn(StageMode.Revive, this, this.Revive);
  2074. EventManager.StageOn(StageMode.Check, this, this.Check);
  2075. }
  2076. static get Instance() {
  2077. if (InGameView.ins) {
  2078. return InGameView.ins;
  2079. }
  2080. else {
  2081. return new InGameView();
  2082. }
  2083. }
  2084. Show() {
  2085. let stage = AccountManager.Instance.curplayerData.GainAccount("stage");
  2086. this.STAGE = Number(stage);
  2087. Laya.timer.loop(AccountManager.Instance.curplayerData.Save * 1000, this, this.Save);
  2088. Laya.timer.once(200, this, this.SkillRefresh);
  2089. Laya.timer.frameLoop(2, this, this.CheckHeight);
  2090. Laya.timer.frameLoop(1, this, this.Progress);
  2091. Laya.timer.once(AccountManager.Instance.curplayerData.CheckLose * 1000, this, this.CheckLose);
  2092. Laya.timer.frameLoop(500, this, this.SkillAnimation);
  2093. this.ScoreRefresh();
  2094. this.SkillNumRefresh();
  2095. this.arrowbtn.clickHandler = new Laya.Handler(this, this.ClickArrow);
  2096. this.zhunxin1btn.clickHandler = new Laya.Handler(this, this.ClickZhunXin1);
  2097. this.zhunxin2btn.clickHandler = new Laya.Handler(this, this.ClickZhunXin2);
  2098. this.doublebtn.clickHandler = new Laya.Handler(this, this.ClickDouble);
  2099. this.hammerbtn.clickHandler = new Laya.Handler(this, this.ClickHammer);
  2100. this.height = Laya.stage.height;
  2101. this.BG.height = Laya.stage.height;
  2102. Laya.stage.on(Laya.Event.RESIZE, this, () => {
  2103. this.height = Laya.stage.height;
  2104. this.BG.height = Laya.stage.height;
  2105. });
  2106. }
  2107. Check() {
  2108. Laya.timer.clear(this, this.CheckLose);
  2109. Laya.timer.once(AccountManager.Instance.curplayerData.CheckLose * 1000, this, this.CheckLose);
  2110. }
  2111. AddPrefab(ball) {
  2112. this.prefabbox.addChild(ball);
  2113. }
  2114. CheckHeight() {
  2115. if (GameManager.Instance.CheckHeight) {
  2116. let down = false;
  2117. for (let i = 0; i < this.prefabbox.numChildren; i++) {
  2118. let child = this.prefabbox.getChildAt(i);
  2119. if (child.y < DropRule.Instance.DropHeight) {
  2120. down = true;
  2121. }
  2122. }
  2123. if (!down) {
  2124. DropRule.Instance.FallDown();
  2125. }
  2126. }
  2127. }
  2128. CheckLose() {
  2129. if (!this.LoseView) {
  2130. let lose = true;
  2131. for (let i = 0; i < this.prefabbox.numChildren; i++) {
  2132. let ball = this.prefabbox.getChildAt(i);
  2133. let light = ball.getChildByName("light");
  2134. if (light.visible) {
  2135. lose = false;
  2136. }
  2137. }
  2138. if (lose) {
  2139. this.LoseView = true;
  2140. Laya.timer.clear(this, this.Save);
  2141. this.Save(true);
  2142. EventManager.StageTrigger(StageMode.Lose);
  2143. }
  2144. }
  2145. }
  2146. ScoreRefresh() {
  2147. let score = DropRule.Instance.GoalScore;
  2148. this.NowLv.value = DropRule.Instance.STAGE.toString();
  2149. this.NextLv.value = (DropRule.Instance.STAGE + 1).toString();
  2150. this.NowScore.text = GameManager.Instance.ScoreProgress.toString();
  2151. this.RequireScore.text = score.toString();
  2152. }
  2153. SkillNumRefresh() {
  2154. this.Func1num.text = AccountManager.Instance.curplayerData.GetPropNum(1).toString();
  2155. this.Func2num.text = AccountManager.Instance.curplayerData.GetPropNum(2).toString();
  2156. this.Func3num.text = AccountManager.Instance.curplayerData.GetPropNum(3).toString();
  2157. this.Func4num.text = AccountManager.Instance.curplayerData.GetPropNum(4).toString();
  2158. this.Func5num.text = AccountManager.Instance.curplayerData.GetPropNum(5).toString();
  2159. }
  2160. SkillRefresh() {
  2161. this.ani1.play(null, false);
  2162. this.ani2.play(null, false);
  2163. this.ani3.play(null, false);
  2164. this.ani4.play(null, false);
  2165. this.ani5.play(null, false);
  2166. }
  2167. SkillAnimation() {
  2168. let random = GameTools.RandomANumber(1, 6);
  2169. switch (random) {
  2170. case 1:
  2171. this.ani1.play(null, false);
  2172. break;
  2173. case 2:
  2174. this.ani2.play(null, false);
  2175. break;
  2176. case 3:
  2177. this.ani3.play(null, false);
  2178. break;
  2179. case 4:
  2180. this.ani4.play(null, false);
  2181. break;
  2182. case 5:
  2183. this.ani5.play(null, false);
  2184. break;
  2185. }
  2186. }
  2187. get Ratio() {
  2188. let score = DropRule.Instance.GoalScore;
  2189. let value = GameManager.Instance.ScoreProgress / score;
  2190. return value;
  2191. }
  2192. Progress() {
  2193. if (!this.WinView) {
  2194. this.LevelProgress.value = this.Ratio;
  2195. if (GameManager.Instance.ScoreProgress >= Number(this.RequireScore.text)) {
  2196. GameManager.Instance.ScoreProgress = Number(this.RequireScore.text);
  2197. this.NowScore.text = GameManager.Instance.ScoreProgress.toString();
  2198. Laya.timer.clear(this, this.Save);
  2199. Laya.timer.clear(this, this.CheckLose);
  2200. this.Save(true);
  2201. EventManager.StageTrigger(StageMode.Win);
  2202. this.WinView = true;
  2203. }
  2204. this.NowScore.text = GameManager.Instance.ScoreProgress.toString();
  2205. }
  2206. }
  2207. ClickArrow() {
  2208. console.log("点到了推球道具--");
  2209. if (Number(this.Func5num.text) > 0) {
  2210. var args = [{ "t": AccountManager.Instance.ServerTime.toString() }, { "play_id": GameManager.Instance.play_id }, { "fid": "5" }];
  2211. ServerManager.Instance.SendHttp(BlastToMerge.Use, args, Laya.Handler.create(this, () => {
  2212. for (let i = 0; i < this.prefabbox.numChildren; i++) {
  2213. let ball = this.prefabbox.getChildAt(i);
  2214. if (ball.destroyed) {
  2215. continue;
  2216. }
  2217. else {
  2218. let _rig = ball.getComponent(Laya.RigidBody);
  2219. _rig.applyLinearImpulseToCenter({ x: 0, y: -1000 });
  2220. }
  2221. }
  2222. this.SkillNumRefresh();
  2223. }), Laya.Handler.create(this, () => {
  2224. }));
  2225. }
  2226. }
  2227. ClickDouble() {
  2228. if (EventManager.PropState == PropEffecf.DOUBLE) {
  2229. EventManager.EventTrigger(PropEffecf.NONE);
  2230. console.log("切换为普通模式");
  2231. return;
  2232. }
  2233. if (EventManager.PropState != PropEffecf.NONE) {
  2234. this.EffectMode(false);
  2235. return;
  2236. }
  2237. if (Number(this.Func1num.text) > 0) {
  2238. EventManager.EventTrigger(PropEffecf.DOUBLE);
  2239. console.log("切换为双倍模式");
  2240. }
  2241. }
  2242. ClickZhunXin1() {
  2243. console.log("点到了准心1道具--");
  2244. if (Number(this.Func2num.text) > 0) {
  2245. if (EventManager.PropState == PropEffecf.NONE) {
  2246. this.EffectMode(true, PropEffecf.CLEARLAST);
  2247. }
  2248. else {
  2249. this.EffectMode(false);
  2250. }
  2251. }
  2252. }
  2253. ClickZhunXin2() {
  2254. console.log("点到了准心2道具--");
  2255. if (Number(this.Func3num.text) > 0) {
  2256. if (EventManager.PropState == PropEffecf.NONE) {
  2257. this.EffectMode(true, PropEffecf.CLEARTWO);
  2258. }
  2259. else {
  2260. this.EffectMode(false);
  2261. }
  2262. }
  2263. }
  2264. ClickHammer() {
  2265. console.log("点到了锤子道具--");
  2266. if (Number(this.Func4num.text) > 0) {
  2267. if (EventManager.PropState == PropEffecf.NONE) {
  2268. this.EffectMode(true, PropEffecf.HAMMER);
  2269. }
  2270. else {
  2271. this.EffectMode(false);
  2272. }
  2273. }
  2274. }
  2275. EffectMode(_open, _type = null) {
  2276. this.Effect.visible = _open;
  2277. if (_open) {
  2278. EventManager.PropState = _type;
  2279. let describe2 = this.Effect.getChildByName("describe2");
  2280. let describe = this.Effect.getChildByName("describe");
  2281. let icon = this.Effect.getChildByName("ICON");
  2282. switch (_type) {
  2283. case PropEffecf.CLEARLAST:
  2284. this.EffectBtn.visible = true;
  2285. describe.visible = true;
  2286. describe2.visible = false;
  2287. icon.visible = true;
  2288. icon.skin = this.GetIcon(DropRule.Instance.MinBall);
  2289. this.ClearNum.text = DropRule.Instance.MinBall.toString();
  2290. this.EffectBtn.clickHandler = Laya.Handler.create(this, this.ClearLast);
  2291. break;
  2292. case PropEffecf.CLEARTWO:
  2293. this.EffectBtn.visible = true;
  2294. describe.visible = true;
  2295. describe2.visible = false;
  2296. icon.visible = true;
  2297. icon.skin = this.GetIcon(DropRule.Instance.MinNextBall);
  2298. this.ClearNum.text = DropRule.Instance.MinNextBall.toString();
  2299. this.EffectBtn.clickHandler = Laya.Handler.create(this, this.ClearTwo);
  2300. break;
  2301. case PropEffecf.HAMMER:
  2302. this.EffectBtn.visible = false;
  2303. describe.visible = false;
  2304. describe2.visible = true;
  2305. icon.visible = false;
  2306. EventManager.EventTrigger(PropEffecf.HAMMER);
  2307. break;
  2308. }
  2309. }
  2310. else {
  2311. EventManager.PropState = PropEffecf.NONE;
  2312. this.EffectBtn.clickHandler = null;
  2313. }
  2314. }
  2315. ClearLast() {
  2316. var args = [{ "t": AccountManager.Instance.ServerTime.toString() }, { "play_id": GameManager.Instance.play_id }, { "fid": "2" }];
  2317. ServerManager.Instance.SendHttp(BlastToMerge.Use, args, Laya.Handler.create(this, () => {
  2318. for (let i = this.prefabbox.numChildren - 1; i > -1; i--) {
  2319. let prefab = this.prefabbox.getChildAt(i);
  2320. let ball = prefab.getComponent(Ball);
  2321. if (ball.score == DropRule.Instance.MinBall) {
  2322. GameManager.Instance.ScoreProgress += ball.score;
  2323. DropRule.Instance.CreateEffect(ball.score, new Laya.Vector2(prefab.x, prefab.y));
  2324. let _rig = prefab.getComponent(Laya.RigidBody);
  2325. let _collider = prefab.getComponent(Laya.CircleCollider);
  2326. _collider.enabled = false;
  2327. _rig.enabled = false;
  2328. Laya.timer.clearAll(prefab);
  2329. prefab.removeSelf();
  2330. }
  2331. }
  2332. this.SkillNumRefresh();
  2333. this.Effect.visible = false;
  2334. this.EffectBtn.clickHandler = null;
  2335. EventManager.PropState = PropEffecf.NONE;
  2336. }), Laya.Handler.create(this, () => {
  2337. console.log("道具使用失败");
  2338. }));
  2339. }
  2340. ClearTwo() {
  2341. var args = [{ "t": AccountManager.Instance.ServerTime.toString() }, { "play_id": GameManager.Instance.play_id }, { "fid": "3" }];
  2342. ServerManager.Instance.SendHttp(BlastToMerge.Use, args, Laya.Handler.create(this, () => {
  2343. for (let i = this.prefabbox.numChildren - 1; i > -1; i--) {
  2344. let prefab = this.prefabbox.getChildAt(i);
  2345. let ball = prefab.getComponent(Ball);
  2346. if (ball.score == DropRule.Instance.MinNextBall) {
  2347. GameManager.Instance.ScoreProgress += ball.score;
  2348. DropRule.Instance.CreateEffect(ball.score, new Laya.Vector2(prefab.x, prefab.y));
  2349. let _rig = prefab.getComponent(Laya.RigidBody);
  2350. let _collider = prefab.getComponent(Laya.CircleCollider);
  2351. _collider.enabled = false;
  2352. _rig.enabled = false;
  2353. Laya.timer.clearAll(prefab);
  2354. prefab.removeSelf();
  2355. }
  2356. }
  2357. this.SkillNumRefresh();
  2358. this.Effect.visible = false;
  2359. this.EffectBtn.clickHandler = null;
  2360. EventManager.PropState = PropEffecf.NONE;
  2361. }), Laya.Handler.create(this, () => {
  2362. console.log("道具使用失败");
  2363. }));
  2364. }
  2365. GetIcon(_score) {
  2366. let index;
  2367. for (let i = 0; i < DropRule.Instance.PrefabName.length; i++) {
  2368. if (_score == Number(DropRule.Instance.PrefabName[i])) {
  2369. index = i.toString();
  2370. }
  2371. }
  2372. return "Ball/blast" + index + ".png";
  2373. }
  2374. ClearStage() {
  2375. if (!this.prefabbox.destroyed) {
  2376. for (let i = this.prefabbox.numChildren - 1; i > -1; i--) {
  2377. let prefab = this.prefabbox.getChildAt(i);
  2378. let ball = prefab.getComponent(Ball);
  2379. let _rig = prefab.getComponent(Laya.RigidBody);
  2380. let _collider = prefab.getComponent(Laya.CircleCollider);
  2381. _collider.enabled = false;
  2382. _rig.enabled = false;
  2383. Laya.timer.clearAll(prefab);
  2384. prefab.removeSelf();
  2385. }
  2386. }
  2387. }
  2388. Over() {
  2389. this.ClearStage();
  2390. EventManager.StageOff(StageMode.Clone, this, this.AddPrefab);
  2391. EventManager.StageOff(StageMode.Win, this, this.Win);
  2392. EventManager.StageOff(StageMode.Lose, this, this.Lose);
  2393. EventManager.StageOff(StageMode.ReStart, this, this.ReStart);
  2394. EventManager.StageOff(StageMode.Over, this, this.Over);
  2395. EventManager.StageOff(StageMode.Revive, this, this.Revive);
  2396. EventManager.StageOff(StageMode.Check, this, this.Check);
  2397. this.ClearCollider(this.BottomCollider);
  2398. this.ClearCollider(this.RightCollider);
  2399. this.ClearCollider(this.LeftCollider);
  2400. }
  2401. Revive() {
  2402. for (let i = this.prefabbox.numChildren - 1; i > -1; i--) {
  2403. let prefab = this.prefabbox.getChildAt(i);
  2404. let ball = prefab.getComponent(Ball);
  2405. for (let j = 0; j < DropRule.Instance.BallNum.length; j++) {
  2406. let Score = DropRule.Instance.GetBallIndex(ball.score);
  2407. if (Score + 1 == Number(DropRule.Instance.BallNum[j])) {
  2408. DropRule.Instance.CreateEffect(ball.score, new Laya.Vector2(prefab.x, prefab.y));
  2409. let _rig = prefab.getComponent(Laya.RigidBody);
  2410. let _collider = prefab.getComponent(Laya.CircleCollider);
  2411. _collider.enabled = false;
  2412. _rig.enabled = false;
  2413. Laya.timer.clearAll(prefab);
  2414. prefab.removeSelf();
  2415. prefab.destroy();
  2416. }
  2417. }
  2418. }
  2419. Laya.timer.frameLoop(2, this, this.CheckHeight);
  2420. Laya.timer.once(500, this, () => {
  2421. this.LoseView = false;
  2422. });
  2423. }
  2424. Win() {
  2425. Laya.timer.clear(this, this.CheckHeight);
  2426. }
  2427. Lose() {
  2428. Laya.timer.clear(this, this.CheckHeight);
  2429. }
  2430. ReStart(_data) {
  2431. if (_data) {
  2432. for (let i = this.prefabbox.numChildren - 1; i > -1; i--) {
  2433. let prefab = this.prefabbox.getChildAt(i);
  2434. let ball = prefab.getComponent(Ball);
  2435. for (let j = 0; j < DropRule.Instance.BallNum.length; j++) {
  2436. let Score = DropRule.Instance.GetBallIndex(ball.score);
  2437. if (Score + 1 == Number(DropRule.Instance.BallNum[j])) {
  2438. DropRule.Instance.CreateEffect(ball.score, new Laya.Vector2(prefab.x, prefab.y));
  2439. let _rig = prefab.getComponent(Laya.RigidBody);
  2440. let _collider = prefab.getComponent(Laya.CircleCollider);
  2441. _collider.enabled = false;
  2442. _rig.enabled = false;
  2443. Laya.timer.clearAll(prefab);
  2444. prefab.removeSelf();
  2445. }
  2446. }
  2447. }
  2448. let ballarray = this.PassDeal;
  2449. if (ballarray.length > 4) {
  2450. let ballarray2 = [];
  2451. for (let m = 0; m < 4; m++) {
  2452. ballarray2.push(ballarray[m]);
  2453. }
  2454. for (let k = this.prefabbox.numChildren - 1; k > -1; k--) {
  2455. let prefab = this.prefabbox.getChildAt(k);
  2456. let ball = prefab.getComponent(Ball);
  2457. let dispear = true;
  2458. for (let l = 0; l < ballarray2.length; l++) {
  2459. if (ball.score == ballarray2[l]) {
  2460. dispear = false;
  2461. }
  2462. }
  2463. if (dispear) {
  2464. DropRule.Instance.CreateEffect(ball.score, new Laya.Vector2(prefab.x, prefab.y));
  2465. let _rig = prefab.getComponent(Laya.RigidBody);
  2466. let _collider = prefab.getComponent(Laya.CircleCollider);
  2467. _collider.enabled = false;
  2468. _rig.enabled = false;
  2469. Laya.timer.clearAll(prefab);
  2470. prefab.removeSelf();
  2471. }
  2472. }
  2473. }
  2474. Laya.timer.loop(5000, this, this.Save);
  2475. this.WinView = false;
  2476. this.ScoreRefresh();
  2477. this.Progress();
  2478. DropRule.Instance.FallDown(DropRule.Instance.StartNum);
  2479. Laya.timer.frameLoop(2, this, this.CheckHeight);
  2480. }
  2481. else {
  2482. this.ClearStage();
  2483. this.LoseView = false;
  2484. this.WinView = false;
  2485. this.ScoreRefresh();
  2486. this.Progress();
  2487. if (DropRule.Instance.STAGE == 1) {
  2488. this.Guide.visible = false;
  2489. GameManager.Instance.Wave = 1;
  2490. DropRule.Instance.GuideFallDown();
  2491. GameManager.Instance.CheckHeight = false;
  2492. }
  2493. else {
  2494. DropRule.Instance.FallDown(DropRule.Instance.StartNum);
  2495. }
  2496. Laya.timer.frameLoop(2, this, this.CheckHeight);
  2497. }
  2498. }
  2499. ClearCollider(_node) {
  2500. let collier = _node.getComponent(Laya.ChainCollider);
  2501. let rig = _node.getComponent(Laya.RigidBody);
  2502. if (collier) {
  2503. collier.enabled = false;
  2504. }
  2505. if (rig) {
  2506. rig.enabled = false;
  2507. }
  2508. if (_node) {
  2509. _node.removeSelf();
  2510. _node.destroy();
  2511. }
  2512. }
  2513. Close() {
  2514. Laya.timer.clearAll(this);
  2515. }
  2516. get PassDeal() {
  2517. let array = [];
  2518. for (let i = 0; i < this.prefabbox.numChildren; i++) {
  2519. let prefab = this.prefabbox.getChildAt(i);
  2520. let ball = prefab.getComponent(Ball);
  2521. if (array.length == 0) {
  2522. array.push(ball.score);
  2523. }
  2524. if (i > 0) {
  2525. let add = true;
  2526. for (let j = 0; j < array.length; j++) {
  2527. if (ball.score == array[j]) {
  2528. add = false;
  2529. }
  2530. }
  2531. if (add) {
  2532. array.push(ball.score);
  2533. }
  2534. }
  2535. }
  2536. if (array.length > 4) {
  2537. for (let k = 0; k < array.length; k++) {
  2538. for (let l = 0; l < array.length - k - 1; l++) {
  2539. if (array[l] < array[l + 1]) {
  2540. let temp = array[l];
  2541. array[l] = array[l + 1];
  2542. array[l + 1] = temp;
  2543. }
  2544. }
  2545. }
  2546. }
  2547. return array;
  2548. }
  2549. Save(_data) {
  2550. let ball;
  2551. let score;
  2552. let size;
  2553. let index;
  2554. let point;
  2555. let obj = {};
  2556. let objarray = [];
  2557. if (!_data) {
  2558. for (let i = 0; i < this.prefabbox.numChildren; i++) {
  2559. let prefab = this.prefabbox.getChildAt(i);
  2560. ball = prefab.getComponent(Ball);
  2561. score = ball.score;
  2562. index = (DropRule.Instance.GetBallIndex(score) + 1).toString();
  2563. size = prefab.width.toString();
  2564. point = new Laya.Vector2(prefab.x, prefab.y);
  2565. obj = { "index": index, "size": size, "pos": point };
  2566. objarray.push(obj);
  2567. }
  2568. let jindutiao = { "jindu": GameManager.Instance.ScoreProgress.toString() };
  2569. let sizeindex = { "sizeindex": DropRule.Instance.SizeIndex };
  2570. let edgeindex = { "edgeindex": DropRule.Instance.EdgeIndex };
  2571. objarray.push(edgeindex);
  2572. objarray.push(jindutiao);
  2573. objarray.push(sizeindex);
  2574. var progress = JSON.stringify(objarray);
  2575. var args = [{ "stage": DropRule.Instance.STAGE.toString() }, { "progress": progress }];
  2576. }
  2577. else {
  2578. obj = { "0": "0" };
  2579. objarray.push(obj);
  2580. var progress = JSON.stringify(objarray);
  2581. var args = [{ "stage": DropRule.Instance.STAGE.toString() }, { "progress": progress }];
  2582. }
  2583. ServerManager.Instance.SendHttp(BlastToMerge.Save, args, Laya.Handler.create(this, (res) => {
  2584. }), Laya.Handler.create(this, () => {
  2585. console.log("保存进度失败++");
  2586. }));
  2587. }
  2588. }
  2589. var on_off;
  2590. (function (on_off) {
  2591. on_off[on_off["on"] = 0] = "on";
  2592. on_off[on_off["off"] = 1] = "off";
  2593. })(on_off || (on_off = {}));
  2594. class Switch extends Laya.Script {
  2595. constructor() {
  2596. super();
  2597. this.kaiguan = on_off.off;
  2598. }
  2599. onAwake() {
  2600. this.CloseSprite = this.owner.getChildByName("close");
  2601. this.OpenSprite = this.owner.getChildByName("open");
  2602. this.Button = this.owner.getChildByName("btn");
  2603. this.Button.clickHandler = Laya.Handler.create(this, () => {
  2604. this.ChangeMode(this.kaiguan);
  2605. this.kaiguan++;
  2606. if (this.kaiguan > 1) {
  2607. this.kaiguan = 0;
  2608. }
  2609. }, null, false);
  2610. }
  2611. ListenOn_Off(on = true, OpenFunction = null, CloseFunction = null) {
  2612. this.kaiguan = on ? on_off.on : on_off.off;
  2613. this.OpenFunction = OpenFunction;
  2614. this.CloseFunction = CloseFunction;
  2615. this.ChangeMode(this.kaiguan);
  2616. this.kaiguan++;
  2617. if (this.kaiguan > 1) {
  2618. this.kaiguan = 0;
  2619. }
  2620. }
  2621. ChangeMode(_mode) {
  2622. switch (_mode) {
  2623. case on_off.off:
  2624. this.OpenSprite.visible = false;
  2625. this.CloseSprite.visible = true;
  2626. this.CloseFunction.run();
  2627. break;
  2628. case on_off.on:
  2629. this.OpenSprite.visible = true;
  2630. this.CloseSprite.visible = false;
  2631. this.OpenFunction.run();
  2632. break;
  2633. }
  2634. }
  2635. }
  2636. class SetView extends ui.SetViewUI {
  2637. constructor() {
  2638. super();
  2639. }
  2640. static get Instance() {
  2641. if (SetView.ins) {
  2642. return SetView.ins;
  2643. }
  2644. else {
  2645. return new SetView();
  2646. }
  2647. }
  2648. Show() {
  2649. this.userid.text = AccountManager.Instance.curplayerData.userId;
  2650. this.CloseBtn.clickHandler = Laya.Handler.create(this, this.ClickClose);
  2651. this.SoundSwitch = this.Sound.addComponent(Switch);
  2652. this.ShakeSwitch = this.Shake.addComponent(Switch);
  2653. this.SoundSwitch.ListenOn_Off(AudioManager.open, Laya.Handler.create(this, this.OpenSound, [true], false), Laya.Handler.create(this, this.OpenSound, [false], false));
  2654. this.ShakeSwitch.ListenOn_Off(WXSDK.shake, Laya.Handler.create(this, this.OpenShake, [true], false), Laya.Handler.create(this, this.OpenShake, [false], false));
  2655. this.height = Laya.stage.height;
  2656. Laya.stage.on(Laya.Event.RESIZE, this, () => {
  2657. this.height = Laya.stage.height;
  2658. });
  2659. }
  2660. Close() {
  2661. }
  2662. ClickClose() {
  2663. ViewManager.Instance.ShowView(ViewType.MainView);
  2664. }
  2665. OpenSound(_open) {
  2666. AudioManager.open = _open;
  2667. }
  2668. OpenShake(_open) {
  2669. WXSDK.shake = _open;
  2670. }
  2671. }
  2672. class RankView extends ui.RankViewUI {
  2673. constructor() {
  2674. super();
  2675. }
  2676. static get Instance() {
  2677. if (RankView.ins) {
  2678. return RankView.ins;
  2679. }
  2680. else {
  2681. return new RankView();
  2682. }
  2683. }
  2684. Show() {
  2685. this.CloseBtn.clickHandler = Laya.Handler.create(this, this.ClickClose);
  2686. this.height = Laya.stage.height;
  2687. Laya.stage.on(Laya.Event.RESIZE, this, () => {
  2688. this.height = Laya.stage.height;
  2689. });
  2690. }
  2691. Close() {
  2692. }
  2693. ClickClose() {
  2694. ViewManager.Instance.ShowView(ViewType.MainView);
  2695. }
  2696. }
  2697. class GuangGao {
  2698. static InitId() {
  2699. }
  2700. static JiaZaiShiPin() {
  2701. if (this.afsfsaafsfsa)
  2702. return;
  2703. if (!Laya.Browser.onWeiXin)
  2704. return;
  2705. this.fsaasfafssfa = Laya.Browser.window.wx.createRewardedVideoAd({ adUnitId: this.videlAdUnitId });
  2706. this.fsaasfafssfa.onLoad(() => {
  2707. console.log('激励视频 广告加载成功');
  2708. this.asfasfsaffsa = true;
  2709. });
  2710. this.fsaasfafssfa.onError(err => {
  2711. console.log("激励视屏加载失败:" + err);
  2712. this.asfasfsaffsa = false;
  2713. });
  2714. this.afsfasfasasf = 0;
  2715. this.afsfsaafsfsa = true;
  2716. }
  2717. static KaiShiPin(callback) {
  2718. if (Laya.Browser.onWeiXin) {
  2719. console.log("showVideoAd , asfasfsaffsa:" + this.asfasfsaffsa);
  2720. if (AccountManager.Instance.curplayerData.videoshare && AccountManager.Instance.curplayerData.fenxiang) ;
  2721. if (AccountManager.Instance.curplayerData.video == false) {
  2722. WXSDK.ShowTxt("暂未开放");
  2723. return;
  2724. }
  2725. this.fassfafasafs(callback);
  2726. this.fsaasfafssfa.show().catch(err => {
  2727. this.fsaasfafssfa.load().then(() => {
  2728. this.fassfafasafs(callback);
  2729. this.fsaasfafssfa.show();
  2730. });
  2731. });
  2732. }
  2733. else {
  2734. callback(false);
  2735. }
  2736. }
  2737. static fassfafasafs(callback) {
  2738. this.fsaasfafssfa.offClose();
  2739. this.fsaasfafssfa.onClose(res => {
  2740. console.log("激励视频关闭:" + res.isEnded);
  2741. if (res && res.isEnded || res === undefined) {
  2742. callback && callback(true);
  2743. }
  2744. else {
  2745. callback && callback(false);
  2746. }
  2747. this.fsaasfafssfa.offClose();
  2748. });
  2749. }
  2750. static OpenBanner(gap = 0, callVack = null, iswait = false) {
  2751. if (!Laya.Browser.onWeiXin)
  2752. return;
  2753. if (this.afsfasfasasf >= 10000) {
  2754. var hh = this.gasagsgasgsa(gap);
  2755. if (iswait) {
  2756. this.asgagassga.hide();
  2757. Laya.timer.once(AccountManager.Instance.curplayerData.wudaoshijian * 1000, this, () => {
  2758. if (callVack != null) {
  2759. callVack(hh);
  2760. }
  2761. this.asgagassga.show();
  2762. });
  2763. }
  2764. else {
  2765. if (callVack != null) {
  2766. callVack(hh);
  2767. }
  2768. this.asgagassga.show();
  2769. }
  2770. }
  2771. else {
  2772. var idd = this.bannerAdUnitId;
  2773. console.log("adUnitId:" + idd);
  2774. let newBanner = Laya.Browser.window.wx.createBannerAd({
  2775. adUnitId: idd,
  2776. style: {
  2777. left: 0,
  2778. top: 0,
  2779. width: 460
  2780. }
  2781. });
  2782. newBanner.onError(err => {
  2783. console.log(err);
  2784. this.gasagsgasgsa(gap);
  2785. });
  2786. newBanner.onLoad(() => {
  2787. this.afsfasfasasf++;
  2788. if (this.asgagassga)
  2789. this.asgagassga.destroy();
  2790. this.asgagassga = newBanner;
  2791. var hight = this.gasagsgasgsa(gap);
  2792. if (iswait) {
  2793. this.asgagassga.hide();
  2794. Laya.timer.once(AccountManager.Instance.curplayerData.wudaoshijian * 1000, this, () => {
  2795. if (callVack != null) {
  2796. callVack(hight);
  2797. }
  2798. this.asgagassga.show();
  2799. });
  2800. }
  2801. else {
  2802. if (callVack != null) {
  2803. callVack(hight);
  2804. }
  2805. this.asgagassga.show();
  2806. }
  2807. });
  2808. }
  2809. }
  2810. static gasagsgasgsa(gap) {
  2811. if (this.asgagassga) {
  2812. let info = Laya.Browser.window.wx.getSystemInfoSync();
  2813. this.asgagassga.style.width = info.windowWidth;
  2814. this.asgagassga.style.top = info.windowHeight - this.asgagassga.style.realHeight - gap - 30;
  2815. return Laya.stage.height / info.windowHeight * this.asgagassga.style.realHeight;
  2816. }
  2817. }
  2818. static Clear() {
  2819. Laya.timer.clearAll(this);
  2820. if (!Laya.Browser.onWeiXin)
  2821. return;
  2822. if (this.asgagassga)
  2823. this.asgagassga.hide();
  2824. }
  2825. static agagsagags() {
  2826. if (!Laya.Browser.onWeiXin)
  2827. return;
  2828. if (this.asgagassga)
  2829. this.asgagassga.hide();
  2830. }
  2831. static gasagsasg() {
  2832. if (!Laya.Browser.onWeiXin)
  2833. return;
  2834. if (this.asgagassga)
  2835. this.asgagassga.show();
  2836. }
  2837. static get keyiwudao() {
  2838. var wudao = AccountManager.Instance.curplayerData.wudao;
  2839. if (wudao == false) {
  2840. console.log("cheat:" + wudao);
  2841. return false;
  2842. }
  2843. if (Main.SceneNum == "1037" || Main.SceneNum == "1007"
  2844. || Main.SceneNum == "1044" || Main.SceneNum == "1104"
  2845. || Main.SceneNum == "1089" || Main.SceneNum == "1001"
  2846. || Main.SceneNum == "00000") {
  2847. console.log("cheat:true-> " + Main.SceneNum);
  2848. return true;
  2849. }
  2850. else {
  2851. var checkscence = AccountManager.Instance.curplayerData.jiancechangjin;
  2852. if (checkscence == false) {
  2853. console.log("cheat:true->checkscence: " + checkscence);
  2854. return true;
  2855. }
  2856. }
  2857. console.log("cheat:false-> " + Main.SceneNum);
  2858. return false;
  2859. }
  2860. static WudaoAnNiu(btn, ShowBanner = true, complete = null, gap = 0) {
  2861. if (AccountManager.Instance.curplayerData.banner) {
  2862. GuangGao.agagsagags();
  2863. if (GuangGao.keyiwudao == false) {
  2864. btn.bottom = 300;
  2865. GuangGao.OpenBanner();
  2866. }
  2867. else {
  2868. if (ShowBanner) {
  2869. btn.bottom = 100;
  2870. btn.mouseEnabled = false;
  2871. console.log("bottom:100");
  2872. GuangGao.OpenBanner(gap, (height) => {
  2873. if (height == null) {
  2874. console.log("展示互推位");
  2875. }
  2876. else {
  2877. var end = Laya.stage.height - height - btn.height;
  2878. btn.y = end;
  2879. btn.bottom = NaN;
  2880. console.log("y:" + end);
  2881. }
  2882. }, true);
  2883. Laya.timer.once(AccountManager.Instance.curplayerData.wudaoshijian * 1000, this, () => {
  2884. btn.mouseEnabled = true;
  2885. if (complete != null) {
  2886. complete();
  2887. }
  2888. });
  2889. }
  2890. else {
  2891. if (complete != null) {
  2892. complete();
  2893. }
  2894. }
  2895. }
  2896. }
  2897. }
  2898. on3DComplete() {
  2899. var scene;
  2900. Laya.stage.addChild(scene);
  2901. var camera1 = new Laya.Camera();
  2902. scene.addChild(camera1);
  2903. camera1.transform.translate(new Laya.Vector3(0, 2, 8), true);
  2904. camera1.transform.rotate(new Laya.Vector3(-23, 0, 0), true, false);
  2905. camera1.viewport = new Laya.Viewport(0, 0, 640, 720);
  2906. var camera2 = new Laya.Camera();
  2907. scene.addChild(camera2);
  2908. camera2.transform.rotate(new Laya.Vector3(-45, 0, 0), false, false);
  2909. camera2.transform.translate(new Laya.Vector3(0, 0, 25), true);
  2910. camera2.viewport = new Laya.Viewport(640, 0, 640, 720);
  2911. }
  2912. onModelOK() {
  2913. var scene = new Laya.Scene();
  2914. Laya.stage.addChild(scene);
  2915. var camera = new Laya.Camera(0, 0.1, 1000);
  2916. scene.addChild(camera);
  2917. camera.transform.rotate(new Laya.Vector3(-25, 0, 0), false, false);
  2918. camera.transform.position = new Laya.Vector3(0, 5, 10);
  2919. var role3D = Laya.loader.getRes("monkey/monkey.lh");
  2920. scene.addChild(role3D);
  2921. }
  2922. }
  2923. GuangGao.videlAdUnitId = "adunit-47ace2391e74f21e";
  2924. GuangGao.bannerAdUnitId = "adunit-876b793421608933";
  2925. GuangGao.afsfsaafsfsa = false;
  2926. GuangGao.asfasfsaffsa = false;
  2927. GuangGao.afsfasfasasf = 0;
  2928. var QianDaoMode;
  2929. (function (QianDaoMode) {
  2930. QianDaoMode[QianDaoMode["start"] = 0] = "start";
  2931. QianDaoMode[QianDaoMode["none"] = 1] = "none";
  2932. QianDaoMode[QianDaoMode["end"] = 2] = "end";
  2933. })(QianDaoMode || (QianDaoMode = {}));
  2934. class reward {
  2935. constructor(_rewradid, _rewradnum) {
  2936. this.rewardid = _rewradid;
  2937. this.rewardnum = _rewradnum;
  2938. }
  2939. }
  2940. class SignItem {
  2941. get GetRewardData() {
  2942. var data = this.rewardids.split(";");
  2943. if (data.length > 1) {
  2944. return new reward(Number(6000), Number(1));
  2945. }
  2946. else {
  2947. return new reward(Number(this.rewardids), Number(this.rewardnum));
  2948. }
  2949. }
  2950. }
  2951. class SignView extends ui.SignViewUI {
  2952. constructor() {
  2953. super();
  2954. this.SignDatas = [];
  2955. this.rewardsdic = {};
  2956. SignView.ins = this;
  2957. }
  2958. static get Instance() {
  2959. if (SignView.ins) {
  2960. return SignView.ins;
  2961. }
  2962. else {
  2963. return new SignView();
  2964. }
  2965. }
  2966. Show() {
  2967. this.SignDatas = this.GainSignDatas();
  2968. this.RefreshDatas();
  2969. this.SignBtn.visible = SignView.CanSign;
  2970. this.SignBtn.clickHandler = Laya.Handler.create(this, this.OnNormalSign);
  2971. this.CloseBtn.clickHandler = Laya.Handler.create(this, this.ClickClose);
  2972. this.height = Laya.stage.height;
  2973. Laya.stage.on(Laya.Event.RESIZE, this, () => {
  2974. this.height = Laya.stage.height;
  2975. });
  2976. }
  2977. Close() {
  2978. }
  2979. ClickClose() {
  2980. ViewManager.Instance.ShowView(ViewType.MainView);
  2981. }
  2982. RefreshDatas() {
  2983. for (var i = 0; i < this.ItemList.numChildren; i++) {
  2984. var sign = this.ItemList.getChildAt(i);
  2985. var data = this.SignDatas[i];
  2986. var rewardid = data.GetRewardData.rewardid;
  2987. var icon = sign.getChildByName("icon");
  2988. var num = sign.getChildByName("icon").getChildByName("num");
  2989. num.text = "X" + data.GetRewardData.rewardnum.toString();
  2990. var roleicon = AccountManager.Instance.curplayerData.GainShiTi(rewardid.toString(), "icon");
  2991. icon.skin = "Game/res/Skin/" + roleicon + ".png";
  2992. var cansign = data.mold;
  2993. if (cansign == QianDaoMode.end) {
  2994. var complete = sign.getChildByName("complete");
  2995. complete.visible = true;
  2996. }
  2997. else if (cansign == QianDaoMode.start) {
  2998. var btn = sign.getChildByName("btn");
  2999. btn.clickHandler = Laya.Handler.create(this, this.OnDoubleSign, null, false);
  3000. }
  3001. }
  3002. }
  3003. OnSign() {
  3004. var curgold = Number(AccountManager.Instance.curplayerData.GainAccount("money"));
  3005. let param = [{ "video": "0" }];
  3006. ServerManager.Instance.SendHttp(BlastToMerge.QianDao, param, Laya.Handler.create(this, function (e) {
  3007. var reward = e["rewards"];
  3008. SignView.Instance.SignDatas = SignView.Instance.GainSignDatas();
  3009. SignView.Instance.SignBtn.visible = false;
  3010. SignView.Instance.RefreshDatas();
  3011. if (reward["1000"]) {
  3012. var gg = Number(AccountManager.Instance.curplayerData.GainAccount("money")) - curgold;
  3013. GameTools.GetMoney(gg, null, Laya.Handler.create(this, () => {
  3014. ViewManager.Instance.ShowView(ViewType.MainView);
  3015. }));
  3016. }
  3017. else {
  3018. GameTools.TweenText(new faafssfafsa("道具 + 1", new Laya.Vector2(Laya.stage.width / 2, Laya.stage.height * 0.35), new Laya.Vector2(250, 80), 30), 150, Laya.Handler.create(this, () => {
  3019. ViewManager.Instance.ShowView(ViewType.MainView);
  3020. }));
  3021. }
  3022. }), Laya.Handler.create(this, this.OnSignError), true);
  3023. }
  3024. OnNormalSign() {
  3025. this.OnSign();
  3026. }
  3027. OnDoubleSign() {
  3028. GuangGao.KaiShiPin((flag) => {
  3029. if (flag) {
  3030. let param = [{ "video": "1" }];
  3031. ServerManager.Instance.SendHttp(BlastToMerge.QianDao, param, Laya.Handler.create(this, function (e) {
  3032. var reward = e["rewards"];
  3033. SignView.Instance.SignDatas = SignView.Instance.GainSignDatas();
  3034. SignView.Instance.SignBtn.visible = false;
  3035. SignView.Instance.RefreshDatas();
  3036. GameTools.TweenText(new faafssfafsa("道具 + 1", new Laya.Vector2(Laya.stage.width / 2, Laya.stage.height * 0.35), new Laya.Vector2(250, 80), 30), 150, Laya.Handler.create(this, () => {
  3037. ViewManager.Instance.ShowView(ViewType.MainView);
  3038. }));
  3039. }), Laya.Handler.create(this, this.OnSignError), true);
  3040. }
  3041. });
  3042. }
  3043. OnSignError(e) {
  3044. console.log(e);
  3045. }
  3046. GainSignDatas() {
  3047. var signdatas = [];
  3048. var config = AccountManager.Instance.curplayerData.GainCollocation("sign");
  3049. var signday = Number(AccountManager.Instance.curplayerData.GainQinDao("sign_days"));
  3050. var once = signday < 7;
  3051. var indes = once ? 0 : 7;
  3052. for (var i = indes; i < indes + 7; i++) {
  3053. this.rewardsdic[config[i].id] = config[i].rewards;
  3054. }
  3055. for (var key in this.rewardsdic) {
  3056. var rewardid = this.rewardsdic[key];
  3057. var reward = AccountManager.Instance.curplayerData.GainJiangLi(rewardid);
  3058. var item = new SignItem();
  3059. item.desc = reward.group_name;
  3060. item.icon = reward.icon;
  3061. item.signday = Number(reward.id);
  3062. item.rewardids = reward.reward_item;
  3063. item.rewardnum = reward.reward_num;
  3064. item.weight = reward.reward_weight;
  3065. var num = Number(key);
  3066. if (signday > num - 1)
  3067. item.mold = QianDaoMode.end;
  3068. if (signday < num - 1)
  3069. item.mold = QianDaoMode.none;
  3070. if (signday == num - 1 && SignView.CanSign) {
  3071. item.mold = QianDaoMode.start;
  3072. }
  3073. signdatas.push(item);
  3074. }
  3075. return signdatas;
  3076. }
  3077. static get CanSign() {
  3078. let SSS = new Date(AccountManager.Instance.ServerTime * 1000);
  3079. SSS.setHours(0, 0, 0, 0);
  3080. var AAA = SSS.valueOf();
  3081. var SignTime = Number(AccountManager.Instance.curplayerData.GainQinDao("sign_time"));
  3082. var DDD = SignTime * 1000;
  3083. var TTT = DDD < AAA ? true : false;
  3084. return TTT;
  3085. }
  3086. }
  3087. class LotteryView extends ui.LotteryViewUI {
  3088. constructor() {
  3089. super();
  3090. this.circleNum = 5;
  3091. }
  3092. static get Instance() {
  3093. if (LotteryView.ins) {
  3094. return LotteryView.ins;
  3095. }
  3096. else {
  3097. return new LotteryView();
  3098. }
  3099. }
  3100. Show() {
  3101. this.CloseBtn.clickHandler = Laya.Handler.create(this, this.ClickClose);
  3102. this.LotteryBtn.clickHandler = Laya.Handler.create(this, this.OnVedio);
  3103. this.height = Laya.stage.height;
  3104. Laya.stage.on(Laya.Event.RESIZE, this, () => {
  3105. this.height = Laya.stage.height;
  3106. });
  3107. }
  3108. Close() {
  3109. }
  3110. ClickClose() {
  3111. ViewManager.Instance.ShowView(ViewType.MainView);
  3112. }
  3113. OnVedio() {
  3114. GuangGao.KaiShiPin((flag) => {
  3115. if (flag) {
  3116. this.LotteryBtn.visible = false;
  3117. let param = [{ "channel": "video" }, { "t": AccountManager.Instance.ServerTime.toString() }];
  3118. ServerManager.Instance.SendHttp(BlastToMerge.Lottery, param, Laya.Handler.create(this, function (e) {
  3119. this.RotationDial(e);
  3120. }), Laya.Handler.create(this, () => {
  3121. WXSDK.ShowTxt("抽奖次数已经用完!");
  3122. }), true);
  3123. }
  3124. });
  3125. }
  3126. RotationDial(e) {
  3127. var result = e.lottery_id - 1;
  3128. this.dial.rotation = 0;
  3129. let tween = Laya.Tween.to(this.dial, {
  3130. rotation: 360 * (this.circleNum) - result * 60
  3131. }, 5000, Laya.Ease.quadInOut, new Laya.Handler(null, () => {
  3132. tween.clear();
  3133. this.LotteryBtn.visible = true;
  3134. if (!LotteryView.IsCanLottery()) {
  3135. this.LotteryBtn.gray = true;
  3136. console.log("观看视频抽奖按钮已变灰");
  3137. }
  3138. var reward = e["rewards"];
  3139. GameTools.TweenText(new faafssfafsa("道具 + 1", new Laya.Vector2(Laya.stage.width / 2, Laya.stage.height * 0.35), new Laya.Vector2(250, 80), 30), 150, Laya.Handler.create(this, () => {
  3140. ViewManager.Instance.ShowView(ViewType.MainView);
  3141. }));
  3142. }));
  3143. }
  3144. static IsCanLottery() {
  3145. var _timer = Number(AccountManager.Instance.curplayerData.lottery.day_video_times);
  3146. return _timer > 0;
  3147. }
  3148. }
  3149. class FailureView extends ui.FailureViewUI {
  3150. constructor() {
  3151. super();
  3152. }
  3153. static get Instance() {
  3154. if (FailureView.ins) {
  3155. return FailureView.ins;
  3156. }
  3157. else {
  3158. return new FailureView();
  3159. }
  3160. }
  3161. Show() {
  3162. this.BackBtn.clickHandler = Laya.Handler.create(this, this.ClickBack);
  3163. this.TryBtn.clickHandler = Laya.Handler.create(this, this.ClickTry);
  3164. this.height = Laya.stage.height;
  3165. this.BG.height = Laya.stage.height;
  3166. Laya.stage.on(Laya.Event.RESIZE, this, () => {
  3167. this.height = Laya.stage.height;
  3168. this.BG.height = Laya.stage.height;
  3169. });
  3170. }
  3171. Close() {
  3172. Laya.timer.clearAll(this);
  3173. }
  3174. ClickBack() {
  3175. var args = [{ "t": AccountManager.Instance.ServerTime.toString() }, { "play_id": GameManager.Instance.play_id }, { "win": "0" }];
  3176. ServerManager.Instance.SendHttp(BlastToMerge.JieShu, args, Laya.Handler.create(this, this.BackMain), null);
  3177. }
  3178. ClickTry() {
  3179. var args = [{ "t": AccountManager.Instance.ServerTime.toString() }, { "play_id": GameManager.Instance.play_id }, { "win": "0" }];
  3180. ServerManager.Instance.SendHttp(BlastToMerge.JieShu, args, Laya.Handler.create(this, this.Try), null);
  3181. }
  3182. BackMain() {
  3183. EventManager.StageTrigger(StageMode.Over);
  3184. EventManager.StageTrigger(StageMode.Refresh);
  3185. ViewManager.Instance.ShowView(ViewType.MainView);
  3186. }
  3187. Try() {
  3188. ViewManager.Instance.ClosePopView(ViewType.FailureView);
  3189. EventManager.StageTrigger(StageMode.Refresh);
  3190. EventManager.StageTrigger(StageMode.ReStart);
  3191. }
  3192. }
  3193. class WinView extends ui.WinViewUI {
  3194. constructor() {
  3195. super();
  3196. }
  3197. static get Instance() {
  3198. if (WinView.ins) {
  3199. return WinView.ins;
  3200. }
  3201. else {
  3202. return new WinView();
  3203. }
  3204. }
  3205. Show() {
  3206. this.BackBtn.clickHandler = Laya.Handler.create(this, this.ClickBack);
  3207. this.NextBtn.clickHandler = Laya.Handler.create(this, this.ClickNextLevel);
  3208. this.height = Laya.stage.height;
  3209. this.BG.height = Laya.stage.height;
  3210. Laya.stage.on(Laya.Event.RESIZE, this, () => {
  3211. this.height = Laya.stage.height;
  3212. this.BG.height = Laya.stage.height;
  3213. });
  3214. }
  3215. Close() {
  3216. Laya.timer.clearAll(this);
  3217. }
  3218. ClickBack() {
  3219. var args = [{ "t": AccountManager.Instance.ServerTime.toString() }, { "play_id": GameManager.Instance.play_id }, { "win": "1" }];
  3220. ServerManager.Instance.SendHttp(BlastToMerge.JieShu, args, Laya.Handler.create(this, this.BackMain), null);
  3221. }
  3222. ClickNextLevel() {
  3223. var args = [{ "t": AccountManager.Instance.ServerTime.toString() }, { "play_id": GameManager.Instance.play_id }, { "win": "1" }];
  3224. ServerManager.Instance.SendHttp(BlastToMerge.JieShu, args, Laya.Handler.create(this, this.NextLevel), null);
  3225. }
  3226. BackMain() {
  3227. EventManager.StageTrigger(StageMode.Over);
  3228. EventManager.StageTrigger(StageMode.Refresh);
  3229. ViewManager.Instance.ShowView(ViewType.MainView);
  3230. let level = DropRule.Instance.STAGE;
  3231. WXSDK.UpdateScore(level);
  3232. }
  3233. NextLevel() {
  3234. var agrs = [{ "t": AccountManager.Instance.ServerTime.toString() }];
  3235. ServerManager.Instance.SendHttp(BlastToMerge.KaiShi, agrs, Laya.Handler.create(this, this.StartNextLevel), null);
  3236. }
  3237. StartNextLevel(_data) {
  3238. ViewManager.Instance.ClosePopView(ViewType.WinView);
  3239. let stage = AccountManager.Instance.curplayerData.GainAccount("stage");
  3240. GameManager.Instance.play_id = _data.play_id;
  3241. DropRule.Instance.STAGE = Number(AccountManager.Instance.curplayerData.GainAccount("stage"));
  3242. EventManager.StageTrigger(StageMode.Refresh, [true]);
  3243. EventManager.StageTrigger(StageMode.ReStart, [true]);
  3244. let level = DropRule.Instance.STAGE;
  3245. WXSDK.UpdateScore(level);
  3246. }
  3247. }
  3248. class ReviveView extends ui.ReviveViewUI {
  3249. constructor() {
  3250. super();
  3251. this.time = 9;
  3252. this.count = false;
  3253. this.fuhuo = false;
  3254. }
  3255. static get Instance() {
  3256. if (ReviveView.ins) {
  3257. return ReviveView.ins;
  3258. }
  3259. else {
  3260. return new ReviveView();
  3261. }
  3262. }
  3263. Show() {
  3264. this.VideoBtn.clickHandler = Laya.Handler.create(this, this.VideoRevive);
  3265. this.NoBtn.visible = false;
  3266. Laya.timer.once(1000, this, () => {
  3267. this.NoBtn.visible = true;
  3268. this.NoBtn.clickHandler = Laya.Handler.create(this, this.DontRevive, null, false);
  3269. });
  3270. this.count = true;
  3271. Laya.timer.loop(1000, this, this.CountTime);
  3272. this.height = Laya.stage.height;
  3273. this.BG.height = Laya.stage.height;
  3274. Laya.stage.on(Laya.Event.RESIZE, this, () => {
  3275. this.height = Laya.stage.height;
  3276. this.BG.height = Laya.stage.height;
  3277. });
  3278. }
  3279. CountTime() {
  3280. if (this.count && this.time > 0) {
  3281. this.time -= 1;
  3282. this.Time.text = this.time.toString();
  3283. if (this.time < 1) {
  3284. Laya.timer.clear(this, this.CountTime);
  3285. this.DontRevive();
  3286. }
  3287. }
  3288. }
  3289. DontRevive() {
  3290. Laya.timer.clear(this, this.CountTime);
  3291. this.count = false;
  3292. ViewManager.Instance.ClosePopView(ViewType.ReviveView);
  3293. ViewManager.Instance.OpenPopView(ViewType.FailureView);
  3294. }
  3295. VideoRevive() {
  3296. Laya.timer.clear(this, this.CountTime);
  3297. this.count = false;
  3298. EventManager.StageTrigger(StageMode.Revive);
  3299. ViewManager.Instance.ClearPopViews();
  3300. }
  3301. Close() {
  3302. Laya.timer.clearAll(this);
  3303. }
  3304. }
  3305. var ViewType;
  3306. (function (ViewType) {
  3307. ViewType[ViewType["MainView"] = 0] = "MainView";
  3308. ViewType[ViewType["SignView"] = 1] = "SignView";
  3309. ViewType[ViewType["SetView"] = 2] = "SetView";
  3310. ViewType[ViewType["LotteryView"] = 3] = "LotteryView";
  3311. ViewType[ViewType["InGameView"] = 4] = "InGameView";
  3312. ViewType[ViewType["RankView"] = 5] = "RankView";
  3313. ViewType[ViewType["WinView"] = 6] = "WinView";
  3314. ViewType[ViewType["FailureView"] = 7] = "FailureView";
  3315. ViewType[ViewType["ReviveView"] = 8] = "ReviveView";
  3316. })(ViewType || (ViewType = {}));
  3317. class ViewManager {
  3318. constructor() {
  3319. this.ViewDic = [];
  3320. this.OtherViewDic = [];
  3321. this.ViewSprite = new Laya.Sprite;
  3322. this.OtherViewSprite = new Laya.Sprite;
  3323. ViewManager.ins = this;
  3324. this.Init();
  3325. }
  3326. static get Instance() {
  3327. if (ViewManager.ins) {
  3328. return ViewManager.ins;
  3329. }
  3330. else {
  3331. return new ViewManager();
  3332. }
  3333. }
  3334. Init() {
  3335. this.ViewDic[ViewType.MainView] = MainView;
  3336. this.ViewDic[ViewType.SignView] = SignView;
  3337. this.ViewDic[ViewType.SetView] = SetView;
  3338. this.ViewDic[ViewType.LotteryView] = LotteryView;
  3339. this.ViewDic[ViewType.InGameView] = InGameView;
  3340. this.ViewDic[ViewType.RankView] = RankView;
  3341. this.ViewDic[ViewType.WinView] = WinView;
  3342. this.ViewDic[ViewType.FailureView] = FailureView;
  3343. this.ViewDic[ViewType.ReviveView] = ReviveView;
  3344. Laya.stage.addChild(this.ViewSprite);
  3345. Laya.stage.addChild(this.OtherViewSprite);
  3346. }
  3347. ShowView(_viewtype, data = null) {
  3348. if (this.curView != null) {
  3349. this.curView.Close();
  3350. this.curView.destroy();
  3351. this.curView.removeSelf();
  3352. }
  3353. this.ClearPopViews();
  3354. this.curView = this.CreateView(_viewtype);
  3355. this.curView.name = ViewType[_viewtype];
  3356. this.ViewSprite.addChild(this.curView);
  3357. this.curView.Show(data);
  3358. }
  3359. CloseView() {
  3360. if (this.curView != null) {
  3361. this.curView.Close();
  3362. this.curView.destroy();
  3363. this.curView.removeSelf();
  3364. }
  3365. }
  3366. OpenPopView(viewType, data = null) {
  3367. GuangGao.Clear();
  3368. var popView;
  3369. if (this.OtherViewDic[viewType]) {
  3370. popView = this.OtherViewDic[viewType];
  3371. this.OtherViewSprite.setChildIndex(popView, this.OtherViewSprite.numChildren - 1);
  3372. popView.visible = true;
  3373. }
  3374. else {
  3375. popView = this.CreateView(viewType);
  3376. this.OtherViewSprite.addChild(popView);
  3377. this.OtherViewDic[viewType] = popView;
  3378. }
  3379. popView.Show(data);
  3380. }
  3381. ClosePopView(viewType) {
  3382. var popView = this.OtherViewDic[viewType];
  3383. if (popView == null) {
  3384. return;
  3385. }
  3386. GuangGao.Clear();
  3387. popView.Close();
  3388. popView.visible = false;
  3389. }
  3390. ClearPopViews() {
  3391. GuangGao.Clear();
  3392. this.ClosePopView(ViewType.WinView);
  3393. this.ClosePopView(ViewType.FailureView);
  3394. this.ClosePopView(ViewType.ReviveView);
  3395. }
  3396. CreateView(_viewtype) {
  3397. switch (_viewtype) {
  3398. case ViewType.MainView:
  3399. return new MainView();
  3400. case ViewType.InGameView:
  3401. return new InGameView();
  3402. case ViewType.SetView:
  3403. return new SetView();
  3404. case ViewType.RankView:
  3405. return new RankView();
  3406. case ViewType.SignView:
  3407. return new SignView();
  3408. case ViewType.LotteryView:
  3409. return new LotteryView();
  3410. case ViewType.FailureView:
  3411. return new FailureView();
  3412. case ViewType.WinView:
  3413. return new WinView();
  3414. case ViewType.ReviveView:
  3415. return new ReviveView();
  3416. }
  3417. return null;
  3418. }
  3419. }
  3420. class GameControl {
  3421. constructor() {
  3422. GameControl.ins = this;
  3423. this.Init();
  3424. }
  3425. static get Instance() {
  3426. if (GameControl.ins) {
  3427. return GameControl.ins;
  3428. }
  3429. else {
  3430. return new GameControl();
  3431. }
  3432. }
  3433. Init() {
  3434. EventManager.StageOn(StageMode.Start, this, this.GameStart);
  3435. EventManager.StageOn(StageMode.Lose, this, this.GameLose);
  3436. EventManager.StageOn(StageMode.Win, this, this.GameWin);
  3437. }
  3438. GameStart() {
  3439. ViewManager.Instance.ShowView(ViewType.InGameView);
  3440. if (DropRule.Instance.STAGE == 1) {
  3441. DropRule.Instance.GuideFallDown();
  3442. return;
  3443. }
  3444. if (DropRule.Instance.progress.length > 1 && GameManager.Instance.First) {
  3445. DropRule.Instance.RecoverScene();
  3446. GameManager.Instance.First = false;
  3447. }
  3448. else {
  3449. DropRule.Instance.FallDown(DropRule.Instance.StartNum);
  3450. }
  3451. }
  3452. GameLose() {
  3453. if (GameManager.Instance.ReviveNum > 0) {
  3454. ViewManager.Instance.OpenPopView(ViewType.ReviveView);
  3455. GameManager.Instance.ReviveNum--;
  3456. }
  3457. else {
  3458. ViewManager.Instance.OpenPopView(ViewType.FailureView);
  3459. }
  3460. }
  3461. GameWin() {
  3462. ViewManager.Instance.OpenPopView(ViewType.WinView);
  3463. }
  3464. }
  3465. class LoadView {
  3466. constructor() {
  3467. this.Login();
  3468. new GameControl();
  3469. new GameManager();
  3470. }
  3471. static get Instance() {
  3472. if (LoadView.ins) {
  3473. return LoadView.ins;
  3474. }
  3475. else {
  3476. return new LoadView();
  3477. }
  3478. }
  3479. Login() {
  3480. if (Laya.Browser.onWeiXin) {
  3481. this.WXLogin();
  3482. }
  3483. else {
  3484. this.LocalLogin();
  3485. }
  3486. }
  3487. WXLogin() {
  3488. if (Laya.Browser.onWeiXin) {
  3489. WXSDK.DengLu((res) => {
  3490. if (res != "error") {
  3491. console.log("1微信登录成功:" + res);
  3492. this.LocalLogin();
  3493. }
  3494. else {
  3495. this.WXLogin();
  3496. }
  3497. });
  3498. }
  3499. else {
  3500. this.LocalLogin();
  3501. ServerManager.Instance.Login(null, Laya.Handler.create(this, this.LoginComplete), Laya.Handler.create(this, this.LoginFail));
  3502. }
  3503. }
  3504. LocalLogin() {
  3505. ServerManager.Instance.Login(null, Laya.Handler.create(this, this.LoginComplete), Laya.Handler.create(this, this.LoginFail));
  3506. }
  3507. LoginComplete() {
  3508. console.log("本地服务器登陆成功");
  3509. this.LoadSubPackage();
  3510. }
  3511. LoginFail(e) {
  3512. console.log("本地服务器登陆失败");
  3513. console.log(e);
  3514. }
  3515. LoadSubPackage() {
  3516. WXSDK.LoadSubPackage("Game", callback => {
  3517. if (callback) {
  3518. new DropRule();
  3519. ViewManager.Instance.ShowView(ViewType.MainView);
  3520. }
  3521. });
  3522. }
  3523. }
  3524. class Main$1 {
  3525. constructor() {
  3526. if (CheckMain.Creat)
  3527. return;
  3528. CheckMain.Creat = true;
  3529. if (window["Laya3D"])
  3530. Laya3D.init(GameConfig.width, GameConfig.height);
  3531. else
  3532. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  3533. Laya["Physics"] && Laya["Physics"].enable();
  3534. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  3535. Laya.stage.scaleMode = GameConfig.scaleMode;
  3536. Laya.stage.screenMode = GameConfig.screenMode;
  3537. Laya.stage.alignV = GameConfig.alignV;
  3538. Laya.stage.alignH = GameConfig.alignH;
  3539. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  3540. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  3541. Laya.enableDebugPanel();
  3542. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  3543. Laya["PhysicsDebugDraw"].enable();
  3544. if (GameConfig.stat)
  3545. Laya.Stat.show();
  3546. Laya.alertGlobalError = true;
  3547. if (Laya.Browser.onWeiXin) {
  3548. Laya.Browser.window.wx.showShareMenu({
  3549. withShareTicket: true
  3550. });
  3551. Laya.Browser.window.wx.onShareAppMessage(function () {
  3552. return {
  3553. title: "试一下你的脑力能到第几关",
  3554. imageUrl: "Game/res/Share/fx.png",
  3555. };
  3556. });
  3557. Laya.Browser.window.wx.onShow((option) => {
  3558. var shareTicket = option.shareTicket;
  3559. var userId = option.query.userId;
  3560. var shareTitle = option.query.shareTitle;
  3561. Main$1.SceneNum = option.scene;
  3562. WXSDK.querychannel = option.query.channel;
  3563. WXSDK.shareOpenId = option.query.userId;
  3564. console.log("option---", option);
  3565. console.log("scene:", option.scene);
  3566. if (WXSDK.querychannel != null) {
  3567. console.log("onShow channel is:", WXSDK.querychannel);
  3568. }
  3569. if (option.referrerInfo) {
  3570. WXSDK.referrerInfoappId = option.referrerInfo.appId;
  3571. console.log("onShow appId is:", option.referrerInfo.appId);
  3572. }
  3573. });
  3574. const updateManager = Laya.Browser.window.wx.getUpdateManager();
  3575. updateManager.onCheckForUpdate(function (res) {
  3576. console.log("最新版本:" + res.hasUpdate);
  3577. });
  3578. updateManager.onUpdateReady(function () {
  3579. Laya.Browser.window.wx.showModal({
  3580. showCancel: false,
  3581. title: '更新提示',
  3582. content: '新版本已经准备好,是否重启应用?',
  3583. success(res) {
  3584. updateManager.applyUpdate();
  3585. },
  3586. fail(res) {
  3587. updateManager.applyUpdate();
  3588. }
  3589. });
  3590. });
  3591. }
  3592. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  3593. }
  3594. onVersionLoaded() {
  3595. Laya.AtlasInfoManager.enable("fileconfig.json", Laya.Handler.create(this, this.onConfigLoaded));
  3596. }
  3597. onConfigLoaded() {
  3598. new LoadView();
  3599. }
  3600. }
  3601. Main$1.Ver = "1.0.3";
  3602. Main$1.CFG = "123";
  3603. Main$1.SceneNum = "000";
  3604. new Main$1();
  3605. exports.Main = Main$1;
  3606. return exports;
  3607. }({}));
  3608. //# sourceMappingURL=bundle.js.map