bundle.js 151 KB

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