bundle.js 185 KB

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