bundle.js 201 KB

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