bundle.js 162 KB

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