bundle.js 159 KB

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