bundle.js 200 KB

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