1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721 |
- var laya = (function (exports) {
- 'use strict';
- class GameConfig {
- constructor() { }
- static init() {
- var reg = Laya.ClassUtils.regClass;
- }
- }
- GameConfig.width = 720;
- GameConfig.height = 1280;
- GameConfig.scaleMode = "fixedwidth";
- GameConfig.screenMode = "none";
- GameConfig.alignV = "top";
- GameConfig.alignH = "left";
- GameConfig.startScene = "MainScene.scene";
- GameConfig.sceneRoot = "";
- GameConfig.debug = false;
- GameConfig.stat = false;
- GameConfig.physicsDebug = false;
- GameConfig.exportSceneToJson = true;
- GameConfig.init();
- class CheckMain {
- }
- CheckMain.Creat = false;
- class Main {
- constructor() {
- if (CheckMain.Creat)
- return;
- CheckMain.Creat = true;
- if (window["Laya3D"])
- Laya3D.init(GameConfig.width, GameConfig.height);
- else
- Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
- Laya["Physics"] && Laya["Physics"].enable();
- Laya["DebugPanel"] && Laya["DebugPanel"].enable();
- Laya.stage.scaleMode = GameConfig.scaleMode;
- Laya.stage.screenMode = GameConfig.screenMode;
- Laya.stage.alignV = GameConfig.alignV;
- Laya.stage.alignH = GameConfig.alignH;
- Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
- if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
- Laya.enableDebugPanel();
- if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
- Laya["PhysicsDebugDraw"].enable();
- if (GameConfig.stat)
- Laya.Stat.show();
- Laya.alertGlobalError = true;
- if (Laya.Browser.onWeiXin) {
- Laya.Browser.window.wx.showShareMenu({
- withShareTicket: true
- });
- Laya.Browser.window.wx.onShareAppMessage(function () {
- return {
- title: "试一下你的脑力能到第几关",
- imageUrl: "Game/res/Share/fx.png",
- };
- });
- Laya.Browser.window.wx.onShow((option) => {
- var shareTicket = option.shareTicket;
- var userId = option.query.userId;
- var shareTitle = option.query.shareTitle;
- Main.SceneNum = option.scene;
- WXSDK.querychannel = option.query.channel;
- WXSDK.shareOpenId = option.query.userId;
- console.log("option---", option);
- console.log("scene:", option.scene);
- if (WXSDK.querychannel != null) {
- console.log("onShow channel is:", WXSDK.querychannel);
- }
- if (option.referrerInfo) {
- WXSDK.referrerInfoappId = option.referrerInfo.appId;
- console.log("onShow appId is:", option.referrerInfo.appId);
- }
- });
- const updateManager = Laya.Browser.window.wx.getUpdateManager();
- updateManager.onCheckForUpdate(function (res) {
- console.log("最新版本:" + res.hasUpdate);
- });
- updateManager.onUpdateReady(function () {
- Laya.Browser.window.wx.showModal({
- showCancel: false,
- title: '更新提示',
- content: '新版本已经准备好,是否重启应用?',
- success(res) {
- updateManager.applyUpdate();
- },
- fail(res) {
- updateManager.applyUpdate();
- }
- });
- });
- }
- Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
- }
- onVersionLoaded() {
- Laya.AtlasInfoManager.enable("fileconfig.json", Laya.Handler.create(this, this.onConfigLoaded));
- }
- onConfigLoaded() {
- new LoadView();
- }
- }
- Main.Ver = "1.0.3";
- Main.CFG = "123";
- Main.SceneNum = "000";
- new Main();
- var AccountUser;
- (function (AccountUser) {
- AccountUser[AccountUser["buyed_kun"] = 0] = "buyed_kun";
- AccountUser[AccountUser["diamond"] = 1] = "diamond";
- AccountUser[AccountUser["equip_themes"] = 2] = "equip_themes";
- AccountUser[AccountUser["favorite_times"] = 3] = "favorite_times";
- AccountUser[AccountUser["game_times"] = 4] = "game_times";
- AccountUser[AccountUser["get_themes"] = 5] = "get_themes";
- AccountUser[AccountUser["list_kun"] = 6] = "list_kun";
- AccountUser[AccountUser["moeny"] = 7] = "moeny";
- AccountUser[AccountUser["progress_themes"] = 8] = "progress_themes";
- AccountUser[AccountUser["revival"] = 9] = "revival";
- AccountUser[AccountUser["stage"] = 10] = "stage";
- })(AccountUser || (AccountUser = {}));
- class PlayerData {
- constructor(_token, _config, _appSetting, _user, _userbase, _useInvite, _user_stage = null, _user_sign, _user_achievement, lottery) {
- this.openid = "";
- this.userId = "";
- this.jianglidic = {};
- this.shitidic = {};
- this.chengjiuliebiao = {};
- this.zhengshu = _token;
- this.netzheshe = _appSetting;
- this.account = _user;
- this.accountssss = _userbase;
- this.qiandao = _user_sign;
- this.renwu = _user_achievement;
- this.userId = this.account["user_id"];
- this.openid = this.accountssss["openid"];
- this.m_invite = _useInvite;
- this.lottery = lottery;
- console.log("user_id:" + this.userId);
- }
- GainCollocation(_type) {
- return this.peizhis[_type];
- }
- GainAccount(_type) {
- return this.account[_type];
- }
- get fenxiang() {
- return this.netzheshe["share"] == "1";
- }
- get fenxiangneirong() {
- return this.netzheshe["sharecontent"];
- }
- get fuhuocishu() {
- return Number(this.netzheshe["revivenum"]);
- }
- get wudishijian() {
- return Number(this.netzheshe["Invincibletime"]);
- }
- get wudaoshijian() {
- return Number(this.netzheshe["cheattime"]);
- }
- get banner() {
- return this.netzheshe["banner"] == "1";
- }
- get video() {
- return this.netzheshe["video"] == "1";
- }
- get wudao() {
- return this.netzheshe["cheat"] == "1";
- }
- get jiancechangjin() {
- return this.netzheshe["checkscence"] == 1;
- }
- get reviverate() {
- return Number(this.netzheshe["revive"]);
- }
- get uintid() {
- return this.netzheshe["uintid"];
- }
- get music() {
- return this.netzheshe["music"] == "1";
- }
- get skin() {
- return this.netzheshe["skinget"] == "1";
- }
- get aicheatspeed() {
- return Number(this.netzheshe["aicheatspeed"]);
- }
- get aispeedtime() {
- return Number(this.netzheshe["aispeedtime"]);
- }
- get videoshare() {
- return this.netzheshe["videoshare"] == "1";
- }
- get trial() {
- return this.netzheshe["trial"] == "1";
- }
- get invite() {
- return this.netzheshe["invite"] == 1;
- }
- get re() {
- return this.netzheshe["re"] == 1;
- }
- get autosign() {
- return this.netzheshe["autosign"] == 1;
- }
- get showgift() {
- return this.netzheshe["showgift"] == 1;
- }
- get showshop() {
- return this.netzheshe["showshop"] == 1;
- }
- get lotteryTimer() {
- if (this.netzheshe["lotteryTimer"])
- return Number(this.netzheshe["lotteryTimer"]);
- return 0;
- }
- get falldownline() {
- return this.netzheshe["FallDownLine"];
- }
- get Restitution() {
- return this.netzheshe["restitution"];
- }
- get MergeSpeed() {
- return this.netzheshe["MergeSpeed"];
- }
- get CheckLose() {
- return this.netzheshe["CheckLose"];
- }
- get Save() {
- return this.netzheshe["Save"];
- }
- get GuideHeight() {
- return this.netzheshe["GuideHeight"];
- }
- get ShakeNum() {
- return this.netzheshe["ShakeNum"];
- }
- get Distance() {
- return this.netzheshe["Distance"];
- }
- get OverRun() {
- return this.netzheshe["OverRun"];
- }
- get touchsize() {
- return Number(this.netzheshe["touchsize"]);
- }
- get touchsmoothness() {
- return Number(this.netzheshe["touchsmoothness"]);
- }
- GainQinDao(_key) {
- return this.qiandao[_key];
- }
- GainShiTi(_key, shuxing) {
- return this.shitidic[_key][shuxing];
- }
- GainJiangLi(_rewardid) {
- var reward = this.jianglidic[_rewardid];
- return reward;
- }
- GetPropNum(_index) {
- var type = this.account["functions"];
- var num = type[_index.toString()];
- if (num) {
- return num;
- }
- else {
- return 0;
- }
- }
- HasRole(_id) {
- var data = this.GainAccount("get_themes");
- for (var i = 0; i < data.length; i++) {
- var hd = data[i];
- if (_id == hd) {
- return true;
- }
- }
- return false;
- }
- HasGun(_id) {
- var data = this.GainAccount("functions");
- for (var i = 0; i < data.length; i++) {
- var hd = data[i];
- if (_id == hd) {
- return true;
- }
- }
- return false;
- }
- GetProgress(_id) {
- var config = this.account["progress_themes"];
- var progress = config[_id] ? config[_id] : 0;
- return progress;
- }
- GetJiangLiLieBiao() {
- var peiz = this.GainCollocation("rewards");
- for (var key in peiz) {
- this.jianglidic[peiz[key].id] = peiz[key];
- }
- }
- GetShiTiLieBiao() {
- var peiz = this.GainCollocation("entity");
- for (var key in peiz) {
- this.shitidic[peiz[key].entity_id] = peiz[key];
- }
- }
- GetChengJiuLieBiao() {
- var shujiu = this.GainCollocation("achievement");
- var aadsadsdas = {};
- for (var key1 in shujiu) {
- var type1 = shujiu[key1].type;
- if (aadsadsdas[type1]) {
- continue;
- }
- var fasas = [];
- for (var key2 in shujiu) {
- var type2 = shujiu[key2].type;
- if (type1 == type2) {
- fasas.push(shujiu[key2]);
- }
- }
- aadsadsdas[type1] = fasas;
- }
- this.chengjiuliebiao = aadsadsdas;
- }
- }
- var HttpRequest = Laya.HttpRequest;
- var Event = Laya.Event;
- const BlastToMergeApi = "https://btmapi.xwxgame.com/";
- class BlastToMerge {
- }
- BlastToMerge.DengLu = "user/login";
- BlastToMerge.KaiShi = "game/start";
- BlastToMerge.JieShu = "game/play";
- BlastToMerge.Use = "game/use";
- BlastToMerge.GetProgress = "game/progress";
- BlastToMerge.Save = "game/save";
- BlastToMerge.WithDraw = "qtt/withdraw";
- BlastToMerge.CheckCoin = "qtt/balance";
- BlastToMerge.GetCoin = "qtt/rewards";
- BlastToMerge.QianDao = "sign/sign";
- BlastToMerge.Chengjiu = "achievement/getRewards";
- BlastToMerge.Config = "config/table";
- BlastToMerge.FenXiang = "fission/share";
- BlastToMerge.LiXian = "fission/offline";
- BlastToMerge.vd = "fission/vd";
- BlastToMerge.FuHuo = "game/revival";
- BlastToMerge.gadagdag = "treasure/click";
- BlastToMerge.Invite = "invite/getRewards";
- BlastToMerge.Lottery = "lottery/lottery";
- BlastToMerge.ShareGetSkin = "theme/fission";
- BlastToMerge.WearEquip = "theme/equip";
- BlastToMerge.BuyEquip = "theme/buy";
- BlastToMerge.ShouQuan = "user/auth";
- BlastToMerge.JinBi = "user/sync";
- class ServerManager {
- constructor() { }
- static get Instance() {
- if (ServerManager.ins) {
- return ServerManager.ins;
- }
- else {
- return new ServerManager();
- }
- }
- Login(progresscb, completecb, errorcb) {
- var Account = AccountManager.Instance;
- var ver = Main.Ver;
- 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}`;
- let httpRequest = new HttpRequest();
- httpRequest.once(Event.PROGRESS, this, this.Progress, [progresscb, httpRequest]);
- httpRequest.once(Event.COMPLETE, this, this.Complete, [completecb, httpRequest]);
- httpRequest.once(Event.ERROR, this, this.Errorcb, [errorcb, httpRequest]);
- httpRequest.send(BlastToMergeApi + BlastToMerge.DengLu, Data, "post", "text");
- }
- Progress(_progresscb, _httpreq) {
- if (_progresscb) {
- _progresscb.run();
- }
- }
- Complete(_completecb, _httpreq) {
- let data = JSON.parse(_httpreq.data);
- console.log(data);
- if (data["code"] != "0") {
- console.log("登录异常错误!错误信息sssssssss:", _httpreq.data["code"]);
- return;
- }
- console.log("-----------sss", data["t"]);
- AccountManager.Instance.SFSFSF = data["t"];
- this.RessetConfig(data, _completecb);
- }
- RessetConfig(data, completecb) {
- AccountManager.Instance.ReSetting(data, (flag) => {
- if (flag) {
- completecb.runWith(data);
- }
- else {
- this.RessetConfig(data, completecb);
- }
- });
- }
- Errorcb(_errorcb, _httpreq) {
- if (_errorcb != null) {
- _errorcb.runWith(_httpreq);
- }
- }
- SendHttp(protocol, param, completecb, errorcb, hasToken = true) {
- let sfaasfsfa = "";
- let daadsads = BlastToMergeApi + protocol;
- if (hasToken == true) {
- sfaasfsfa = `token=${AccountManager.Instance.curplayerData.zhengshu}&`;
- }
- if (protocol == BlastToMerge.KaiShi || protocol == BlastToMerge.JieShu || protocol == BlastToMerge.vd || protocol == BlastToMerge.Lottery) {
- let asddsa = "abcdefghijkimnopqrstuvwxyz0123456789";
- let adsassda = "{";
- let saafsafs = "";
- for (let i = 0; i < 4; i++) {
- saafsafs += asddsa[Math.floor(Math.random() * 100) % asddsa.length];
- }
- for (let i = 0; i < param.length; i++) {
- for (let key in param[i]) {
- adsassda += `\"${key}\":\"${param[i][key]}\"`;
- }
- if (i < param.length - 1) {
- adsassda += ",";
- }
- else {
- adsassda += "}";
- }
- }
- sfaasfsfa += "_r=" + saafsafs + this.SFGSGSG(adsassda);
- }
- else {
- if (param != null) {
- for (let i = 0; i < param.length; i++) {
- for (let key in param[i]) {
- let val = param[i][key];
- sfaasfsfa += `${key}=${val}`;
- if (i < param.length - 1) {
- sfaasfsfa += "&";
- }
- }
- }
- }
- }
- let httpRequest = new HttpRequest();
- httpRequest.once(Event.COMPLETE, this, this.onHttpRequestComplete, [completecb, errorcb, httpRequest]);
- httpRequest.once(Event.ERROR, this, this.Errorcb, [errorcb, httpRequest]);
- httpRequest.send(daadsads, sfaasfsfa, "post", "text");
- }
- onHttpRequestComplete(succeedcb, failurecb, httpRequest) {
- let data = JSON.parse(httpRequest.data);
- if (data["code"] == 0) {
- AccountManager.Instance.ReSetting(data);
- if (succeedcb != null) {
- succeedcb.runWith(data);
- }
- }
- else {
- if (failurecb != null) {
- failurecb.runWith(data);
- }
- console.log("Error! Http request complete error, code: " + data["code"] + " message: " + data["message"]);
- }
- }
- SFGSGSG(str) {
- var c1, c2, c3;
- var SFSFFSFSFSFS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
- var i = 0, len = str.length, SFFSSFFS = '';
- while (i < len) {
- c1 = str.charCodeAt(i++) & 0xff;
- if (i == len) {
- SFFSSFFS += SFSFFSFSFSFS.charAt(c1 >> 2);
- SFFSSFFS += SFSFFSFSFSFS.charAt((c1 & 0x3) << 4);
- SFFSSFFS += "==";
- break;
- }
- c2 = str.charCodeAt(i++);
- if (i == len) {
- SFFSSFFS += SFSFFSFSFSFS.charAt(c1 >> 2);
- SFFSSFFS += SFSFFSFSFSFS.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
- SFFSSFFS += SFSFFSFSFSFS.charAt((c2 & 0xF) << 2);
- SFFSSFFS += "=";
- break;
- }
- c3 = str.charCodeAt(i++);
- SFFSSFFS += SFSFFSFSFSFS.charAt(c1 >> 2);
- SFFSSFFS += SFSFFSFSFSFS.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
- SFFSSFFS += SFSFFSFSFSFS.charAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >> 6));
- SFFSSFFS += SFSFFSFSFSFS.charAt(c3 & 0x3F);
- }
- return SFFSSFFS;
- }
- }
- class AccountManager {
- constructor(_code, _userinfo, _nickname, _avatarurl, _gender, _province, _city, _country, _device, _shareid, _scene, _v) {
- this.createTime = Laya.timer.currTimer;
- AccountManager.ins = this;
- this.code = _code;
- this.userInfo = _userinfo;
- this.nickName = _nickname;
- this.avatarUrl = _avatarurl;
- this.gender = _gender;
- this.province = _province;
- this.city = _city;
- this.country = _country;
- this.device = _device;
- this.share_id = _shareid;
- this.scene = _scene;
- this.v = _v;
- }
- static get Instance() {
- if (AccountManager.ins == null) {
- new AccountManager("222222", "你找谁?", "1233", "123", 1, "中国", "上海", "上海", "iphone6s", "123", "123", "123");
- }
- return AccountManager.ins;
- }
- ReSetting(data, cb = null) {
- var zhengshu = data["token"];
- var netset = data["app_setting"];
- var user = data["user"];
- var jichu = data["user_base"];
- var qiandao = data["user_sign"];
- var chengjiu = data["user_achievement"];
- var invite = data["user_invite"];
- var lottery = data["user_lottery"];
- if (this.curplayerData == null) {
- this.curplayerData = new PlayerData(zhengshu, null, netset, user, jichu, invite, null, qiandao, chengjiu, lottery);
- this.JundgCfg(data.table_version, cb);
- }
- else {
- if (netset) {
- this.curplayerData.netzheshe = netset;
- }
- if (user) {
- this.curplayerData.account = user;
- }
- if (jichu) {
- this.curplayerData.accountssss = jichu;
- }
- if (qiandao) {
- this.curplayerData.qiandao = qiandao;
- }
- if (chengjiu) {
- this.curplayerData.renwu = chengjiu;
- }
- }
- }
- JundgCfg(ver, callball) {
- var cfg = Laya.LocalStorage.getJSON(Main.CFG);
- if (cfg) {
- if (cfg.VER == ver) {
- console.log("已经拥有,不用更新");
- this.SetCfg(cfg);
- if (callball)
- callball(true);
- }
- else {
- console.log("cfg存在但是过期了");
- Laya.LocalStorage.removeItem(Main.CFG);
- ServerManager.Instance.SendHttp(BlastToMerge.Config, null, Laya.Handler.create(this, (data) => {
- data.configs.VER = ver;
- Laya.LocalStorage.setJSON(Main.CFG, data.configs);
- this.SetCfg(data.configs);
- if (callball)
- callball(true);
- }), Laya.Handler.create(this, (data) => {
- console.log("配置获取失败" + data);
- if (callball)
- callball(false);
- return;
- }));
- }
- }
- else {
- console.log("本地没有cfg");
- ServerManager.Instance.SendHttp(BlastToMerge.Config, null, Laya.Handler.create(this, (data) => {
- data.configs.VER = ver;
- Laya.LocalStorage.setJSON(Main.CFG, data.configs);
- this.SetCfg(data.configs);
- if (callball)
- callball(true);
- }), Laya.Handler.create(this, (data) => {
- console.log("配置获取失败" + data);
- }));
- }
- }
- SetCfg(data) {
- this.curplayerData.peizhis = data;
- this.curplayerData.GetJiangLiLieBiao();
- this.curplayerData.GetShiTiLieBiao();
- this.curplayerData.GetChengJiuLieBiao();
- }
- RessetConfig() {
- ServerManager.Instance.SendHttp(BlastToMerge.Config, null, Laya.Handler.create(this, (data) => {
- this.curplayerData.peizhis = data["configs"];
- this.curplayerData.GetJiangLiLieBiao();
- this.curplayerData.GetShiTiLieBiao();
- this.curplayerData.GetChengJiuLieBiao();
- }), null);
- }
- get ServerTime() {
- let time = Laya.timer.currTimer;
- let stime = this.SFSFSF + Math.ceil((time - this.createTime) / 1000);
- return stime;
- }
- }
- class RankPan {
- constructor() {
- this.Width = 0;
- this.Height = 0;
- this.shareCanvas = Laya.Browser.window.sharedCanvas;
- this.ShareSprite = new Laya.Sprite();
- this.ShareSprite.zOrder = 1008;
- this.ShareSprite.pos(0, 0);
- this.ShareSprite.cacheAs = "normal";
- Laya.stage.addChild(this.ShareSprite);
- this.SSSS = new Laya.Texture2D();
- this.TTTT = new Laya.Texture(this.SSSS);
- }
- ShuShi(_width = 720, _heigth = 1280) {
- this.Width = Laya.stage.width;
- this.Height = Laya.stage.height;
- this.shareCanvas.width = _width;
- this.shareCanvas.height = _heigth;
- }
- open() {
- Laya.timer.frameLoop(10, this, this.gengxin);
- this.ShareSprite.visible = true;
- }
- close() {
- Laya.timer.clear(this, this.gengxin);
- this.ShareSprite.visible = false;
- }
- gengxin() {
- this.HuaTu();
- }
- HuaTu() {
- this.SSSS.loadImageSource(this.shareCanvas);
- this.TTTT.setTo(this.SSSS);
- this.ShareSprite.graphics.clear();
- this.ShareSprite.graphics.drawTexture(this.TTTT, 0, 0, this.TTTT.width, this.TTTT.height);
- }
- draw2d() {
- this.AAAA.drawImage(this.shareCanvas, 0, 0, this.shareCanvas.width, this.shareCanvas.height);
- }
- }
- class RankSDK {
- constructor() { }
- static ShuShi() {
- if (!Laya.Browser.onWeiXin)
- return;
- this.SetScreen();
- this.RankPan = new RankPan();
- this.RankPan.ShuShi();
- }
- static OpenRank(keyName = "Level") {
- if (Laya.Browser.onWeiXin) {
- this.Send(keyName, "show_friend_rank");
- console.log("打开排行榜---openrank");
- }
- }
- static Leftpe() {
- if (Laya.Browser.onWeiXin)
- this.Send("", "show_up_page");
- }
- static Rightpe() {
- if (Laya.Browser.onWeiXin)
- this.Send("", "show_next_page");
- }
- static OpenPan() {
- console.log("Laya.Browser.onWeiXin", Laya.Browser.onWeiXin);
- if (Laya.Browser.window.wx)
- this.RankPan.open();
- }
- static ClosePan() {
- if (Laya.Browser.onWeiXin)
- this.RankPan.close();
- }
- static SetScreen() {
- if (!Laya.Browser.onWeiXin)
- return;
- let width = Laya.stage.width;
- let height = Laya.stage.height;
- let data = { width: width, height: height };
- this.Send("", "canvase_width_height", data);
- }
- static Send(keyName, action, data) {
- console.log("消息发送成功0---send");
- Laya.Browser.window.wx.postMessage({
- keyName: keyName,
- action: action,
- data: data
- });
- console.log("消息发送成功---send");
- }
- static SetStage(keyName, value, callBack = null) {
- let obj = [{
- key: keyName,
- value: value
- }];
- Laya.Browser.window.wx.setUserCloudStorage({
- KVDataList: obj,
- success: function (res) {
- console.log("数据上传成功" + res);
- if (callBack) {
- callBack();
- }
- },
- fail: function (res) {
- console.log("数据上传失败" + res);
- if (callBack) {
- callBack();
- }
- }
- });
- }
- }
- class WXSDK {
- constructor() {
- WXSDK.ins = this;
- }
- static get Instance() {
- if (WXSDK.ins) {
- return WXSDK.ins;
- }
- else {
- return new WXSDK();
- }
- }
- static Init() {
- Laya.Browser.window.wx.showShareMenu({
- withShareTicket: true
- });
- Laya.Browser.window.wx.onShareAppMessage(function () {
- return {
- title: "",
- imageUrl: "gameResources/res/share/sharepictrue.png",
- };
- });
- Laya.Browser.window.wx.onShow((option) => {
- var shareTicket = option.shareTicket;
- var userId = option.query.userId;
- var shareTitle = option.query.shareTitle;
- Main.SceneNum = option.scene;
- WXSDK.querychannel = option.query.channel;
- WXSDK.shareOpenId = option.query.userId;
- console.log("option---", option);
- console.log("scene:", option.scene);
- if (WXSDK.querychannel != null) {
- console.log("onShow channel is:", WXSDK.querychannel);
- }
- if (option.referrerInfo) {
- WXSDK.referrerInfoappId = option.referrerInfo.appId;
- console.log("onShow appId is:", option.referrerInfo.appId);
- }
- });
- }
- static DengLu(_complete) {
- var that = this;
- Laya.Browser.window.wx.login({
- success: function (res) {
- if (res.code) {
- console.log("微信登陆成功----");
- that.codeValue = res.code;
- RankSDK.ShuShi();
- console.log("shareid:" + WXSDK.shareOpenId);
- new AccountManager(res.code, "", "", "", 0, "", "", "", "", WXSDK.shareOpenId, WXSDK.shareOpenId, Main.Ver);
- _complete(res);
- }
- else {
- WXSDK.DengLu(WXSDK.DengLu);
- console.log('wx no code' + res.errMsg);
- }
- },
- fail: function (res) { console.log("wx.login: failed, res=" + res); }
- });
- }
- static ShowTxt(text) {
- if (Laya.Browser.window.wx) {
- Laya.Browser.window.wx.showToast({ title: text });
- }
- else {
- console.log(text);
- }
- }
- static ShortShake() {
- Laya.Browser.window.wx.vibrateShort({});
- }
- static LongShake() {
- Laya.Browser.window.wx.vibrateLong({});
- }
- static Shake(_short = true) {
- if (Laya.Browser.onWeiXin && WXSDK.shake) {
- if (_short) {
- this.ShortShake();
- }
- else {
- this.LongShake();
- }
- }
- }
- static LoadSubPackage(name, _complete) {
- if (Laya.Browser.onWeiXin) {
- const loadTask = Laya.Browser.window.wx.loadSubpackage({
- name: 'Game',
- success: function (res) {
- _complete && _complete(true);
- console.log("分包加载成功");
- },
- fail: function (res) {
- _complete && _complete(false);
- console.log("分包加载失败");
- }
- });
- }
- else {
- console.log("未进行分包加载");
- _complete && _complete(true);
- }
- }
- static UpdateScore(_level) {
- var kvDataList = new Array();
- let date = new Date().getTime();
- var myValue = JSON.stringify({
- "wxgame": {
- "Level": _level,
- "update_time": date.toString(),
- }
- });
- kvDataList.push({ key: "Level", value: myValue });
- if (Laya.Browser.onWeiXin) {
- Laya.Browser.window.wx.setUserCloudStorage({
- KVDataList: kvDataList,
- success: r => {
- console.log("KVDATALIST---", kvDataList);
- console.log("上传分数成功:" + _level);
- }
- });
- }
- }
- IsNeedUpdate() {
- if (!Laya.Browser.onWeiXin)
- return;
- const updateManager = Laya.Browser.window.wx.getUpdateManager();
- updateManager.onCheckForUpdate(function (res) {
- console.log("最新版本:" + res.hasUpdate);
- });
- updateManager.onUpdateReady(function () {
- Laya.Browser.window.wx.showModal({
- showCancel: false,
- title: '更新提示',
- content: '新版本已经准备好,是否重启应用?',
- success(res) {
- updateManager.applyUpdate();
- },
- fail(res) {
- updateManager.applyUpdate();
- }
- });
- });
- }
- }
- WXSDK.codeValue = "";
- WXSDK.shareOpenId = "";
- WXSDK.openId = 0;
- WXSDK.shareScene = "";
- WXSDK.uid = "123";
- WXSDK.querychannel = "";
- WXSDK.referrerInfoappId = "";
- WXSDK.shake = true;
- var REG = Laya.ClassUtils.regClass;
- var ui;
- (function (ui) {
- class FailureViewUI extends Laya.Scene {
- constructor() { super(); }
- createChildren() {
- super.createChildren();
- this.createView(FailureViewUI.uiView);
- }
- }
- FailureViewUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "var": "BG", "top": 0, "skin": "WinView/black.png", "sizeGrid": "12,14,14,13", "right": 0, "left": 0, "bottom": 0 }, "compId": 8 }, { "type": "Image", "props": { "y": 525, "x": 360, "width": 720, "skin": "ReviveView/fuhuo-1-1.png", "height": 994, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 5, "child": [{ "type": "Image", "props": { "y": 252, "x": 285, "skin": "FailureView/shibai-1-1.png" }, "compId": 4 }, { "type": "Button", "props": { "y": 506, "x": 360, "var": "BackBtn", "stateNum": 1, "skin": "FailureView/shibai-1-2.png", "anchorY": 0.5, "anchorX": 0.5 }, "compId": 6 }, { "type": "Button", "props": { "y": 627, "x": 360, "var": "TryBtn", "stateNum": 1, "skin": "FailureView/shibai-1-3.png", "anchorY": 0.5, "anchorX": 0.5 }, "compId": 7 }] }], "loadList": ["WinView/black.png", "ReviveView/fuhuo-1-1.png", "FailureView/shibai-1-1.png", "FailureView/shibai-1-2.png", "FailureView/shibai-1-3.png"], "loadList3D": [] };
- ui.FailureViewUI = FailureViewUI;
- REG("ui.FailureViewUI", FailureViewUI);
- class GetRewardViewUI extends Laya.Scene {
- constructor() { super(); }
- createChildren() {
- super.createChildren();
- this.createView(GetRewardViewUI.uiView);
- }
- }
- GetRewardViewUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 488, "x": 360, "width": 696, "skin": "WinView/guoguan-1-7.png", "pivotY": 376, "pivotX": 348, "height": 720 }, "compId": 3, "child": [{ "type": "Image", "props": { "y": 182, "x": 328, "width": 126, "var": "skillicon", "pivotY": 62, "pivotX": 63, "height": 124 }, "compId": 4 }, { "type": "Text", "props": { "y": 440, "x": 347, "width": 433, "var": "des1", "valign": "middle", "text": "获得二倍道具", "pivotY": 44, "pivotX": 217, "height": 88, "fontSize": 40, "align": "center", "runtime": "laya.display.Text" }, "compId": 6 }, { "type": "Text", "props": { "y": 536, "x": 347, "width": 435, "var": "des2", "valign": "middle", "text": "将一个球变为2倍", "pivotY": 44, "pivotX": 218, "height": 88, "fontSize": 40, "align": "center", "runtime": "laya.display.Text" }, "compId": 7 }] }, { "type": "Button", "props": { "y": 759, "x": 360, "width": 264, "var": "GetBtn", "stateNum": 1, "skin": "WinView/guoguan-1-6.png", "pivotY": 53, "pivotX": 132, "height": 106 }, "compId": 5 }], "loadList": ["WinView/guoguan-1-7.png", "WinView/guoguan-1-6.png"], "loadList3D": [] };
- ui.GetRewardViewUI = GetRewardViewUI;
- REG("ui.GetRewardViewUI", GetRewardViewUI);
- class InGameSceneUI extends Laya.Scene {
- constructor() { super(); }
- createChildren() {
- super.createChildren();
- this.createView(InGameSceneUI.uiView);
- }
- }
- InGameSceneUI.uiView = { "type": "Scene", "props": { "width": 720, "pref": "@Prefab:Pr", "height": 1280, "autoDestroyAtClosed": true }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 892, "x": 0, "width": 729, "visible": true, "var": "BottomCollider", "skin": "InGameView/colliderbottom.png", "scaleY": 1, "scaleX": 1, "name": "BottomCollider", "height": 211, "bottom": 177, "alpha": 1 }, "compId": 58, "child": [{ "type": "Script", "props": { "points": "-2,-1,78,-1,78,65,83,81,110,108,147,129,190,145,248,157,291,164,353,166,423,164,486,156,551,139,596,119,626,96,642,72,643,0,732,0", "runtime": "laya.physics.ChainCollider" }, "compId": 200 }, { "type": "Script", "props": { "type": "static", "runtime": "laya.physics.RigidBody" }, "compId": 201 }] }, { "type": "Image", "props": { "y": 937, "x": 720, "width": 82, "var": "RightCollider", "skin": "InGameView/0.png", "pivotY": 939, "pivotX": 79, "name": "RightCollider", "height": 957, "alpha": 1 }, "compId": 55, "child": [{ "type": "Script", "props": { "y": 0, "x": 0, "points": "230,-454,82,-1,81,1404,2,1405,0,716,1,631,0,571,7,478,23,332,31,235,32,191,31,169,34,143,39,121,49,81,58,36,61,-1,84,0", "runtime": "laya.physics.ChainCollider" }, "compId": 195 }, { "type": "Script", "props": { "type": "static", "runtime": "laya.physics.RigidBody" }, "compId": 196 }] }, { "type": "Image", "props": { "y": 943, "x": 78, "width": 80, "var": "LeftCollider", "skin": "InGameView/1.png", "scaleY": 1, "scaleX": 1, "pivotY": 939, "pivotX": 80, "name": "LeftCollider", "height": 885, "alpha": 1 }, "compId": 52, "child": [{ "type": "Script", "props": { "y": 0, "x": 0, "points": "-153,-466,-1,-5,9,1434,0,-1,15,-1,18,32,25,67,39,115,44,144,46,165,46,198,49,254,57,312,63,366,80,533,80,678,83,1432", "runtime": "laya.physics.ChainCollider" }, "compId": 197 }, { "type": "Script", "props": { "type": "static", "runtime": "laya.physics.RigidBody" }, "compId": 198 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "var": "BG", "top": 0, "skin": "InGameView/groundplane.png", "sizeGrid": "179,113,184,121", "right": 0, "left": 0, "bottom": 0 }, "compId": 4 }, { "type": "Image", "props": { "x": 78, "width": 514, "skin": "InGameView/borderbottom.png", "scaleX": 1.1, "name": "bottom", "height": 160, "bottom": 222 }, "compId": 37 }, { "type": "Image", "props": { "y": 0, "x": 14, "width": 346, "top": 0, "skin": "InGameView/border2.png", "scaleY": 2, "scaleX": 2, "name": "area", "bottom": 380 }, "compId": 36 }, { "type": "Image", "props": { "skin": "InGameView/blast-35.png", "right": 0, "name": "prop", "left": 0, "bottom": 0 }, "compId": 3, "child": [{ "type": "Button", "props": { "y": 132, "x": 629, "width": 82, "var": "arrowbtn", "stateNum": 1, "skin": "Skillicon/BoosterArrow1_00239.png", "pivotY": 37, "pivotX": 41, "name": "", "height": 73 }, "compId": 383, "child": [{ "type": "Image", "props": { "y": 62, "x": 84, "width": 29, "skin": "InGameView/blast-45.png", "pivotY": 14, "pivotX": 15, "name": "cycle", "height": 28 }, "compId": 20 }, { "type": "Text", "props": { "y": 64, "x": 84, "width": 32, "var": "Func5num", "valign": "middle", "text": "10", "pivotY": 9, "pivotX": 16, "height": 18, "fontSize": 20, "font": "Microsoft YaHei", "color": "#ffffff", "bold": false, "align": "center", "runtime": "laya.display.Text" }, "compId": 21 }] }, { "type": "Button", "props": { "y": 130, "x": 88, "width": 79, "var": "doublebtn", "stateNum": 1, "skin": "Skillicon/BoosterExplode1_00239.png", "pivotY": 29, "pivotX": 40, "height": 55 }, "compId": 384, "child": [{ "type": "Image", "props": { "y": 57, "x": 80, "width": 29, "skin": "InGameView/blast-45.png", "pivotY": 14, "pivotX": 15, "name": "cycle", "height": 28 }, "compId": 12 }, { "type": "Text", "props": { "y": 60, "x": 79, "width": 28, "var": "Func1num", "valign": "middle", "text": "10", "pivotY": 10, "pivotX": 14, "height": 20, "fontSize": 20, "font": "Microsoft YaHei", "color": "#ffffff", "bold": false, "align": "center", "runtime": "laya.display.Text" }, "compId": 13 }] }, { "type": "Button", "props": { "y": 166, "x": 222, "width": 85, "var": "zhunxin1btn", "stateNum": 1, "skin": "Skillicon/BoosterFire1_00239.png", "pivotY": 40, "pivotX": 43, "height": 80 }, "compId": 385, "child": [{ "type": "Image", "props": { "y": 57, "x": 79, "width": 29, "skin": "InGameView/blast-45.png", "pivotY": 14, "pivotX": 15, "name": "cycle", "height": 28 }, "compId": 14 }, { "type": "Text", "props": { "y": 59.5, "x": 79, "width": 27, "var": "Func2num", "valign": "middle", "text": "10", "pivotY": 12, "pivotX": 14, "height": 23, "fontSize": 20, "font": "Microsoft YaHei", "color": "#ffffff", "bold": false, "align": "center", "runtime": "laya.display.Text" }, "compId": 15 }] }, { "type": "Button", "props": { "y": 175, "x": 361, "width": 77, "var": "zhunxin2btn", "stateNum": 1, "skin": "Skillicon/BoosterShoot1_00240.png", "pivotY": 37, "pivotX": 39, "height": 73 }, "compId": 386, "child": [{ "type": "Image", "props": { "y": 58, "x": 76, "width": 29, "skin": "InGameView/blast-45.png", "pivotY": 14, "pivotX": 15, "name": "cycle", "height": 28 }, "compId": 16 }, { "type": "Text", "props": { "y": 61, "x": 76, "width": 31, "var": "Func3num", "valign": "middle", "text": "10", "pivotY": 11, "pivotX": 16, "height": 22, "fontSize": 20, "font": "Microsoft YaHei", "color": "#ffffff", "bold": false, "align": "center", "runtime": "laya.display.Text" }, "compId": 17 }] }, { "type": "Button", "props": { "y": 165, "x": 499, "width": 68, "var": "hammerbtn", "stateNum": 1, "skin": "Skillicon/BoosterHammer1_00238.png", "pivotY": 39, "pivotX": 34, "height": 78 }, "compId": 388, "child": [{ "type": "Image", "props": { "y": 56, "x": 84, "width": 29, "skin": "InGameView/blast-45.png", "pivotY": 14, "pivotX": 15, "name": "cycle", "height": 28 }, "compId": 18 }, { "type": "Text", "props": { "y": 58, "x": 84, "width": 31, "var": "Func4num", "valign": "middle", "text": "10", "pivotY": 12, "pivotX": 16, "height": 24, "fontSize": 20, "font": "Microsoft YaHei", "color": "#ffffff", "bold": false, "align": "center", "runtime": "laya.display.Text" }, "compId": 19 }] }] }, { "type": "Sprite", "props": { "y": 8, "x": 8, "width": 16, "var": "prefabbox", "pivotY": 8, "pivotX": 8, "height": 16 }, "compId": 677 }, { "type": "ProgressBar", "props": { "x": 360, "width": 281, "var": "LevelProgress", "value": 0, "top": 120, "skin": "InGameView/jindutiao-1-2.png", "pivotY": 22, "pivotX": 141, "height": 44 }, "compId": 574, "child": [{ "type": "Image", "props": { "y": 22, "x": -14, "width": 73, "skin": "InGameView/jindutiao-1-3.png", "pivotY": 37, "pivotX": 37, "height": 73 }, "compId": 570, "child": [{ "type": "FontClip", "props": { "y": 36, "x": 36, "width": 25, "var": "NowLv", "value": "1", "skin": "Ball/43.png", "sheet": "0123456789", "pivotY": 15, "pivotX": 13, "height": 29, "align": "center" }, "compId": 578 }] }, { "type": "Image", "props": { "y": 22, "x": 298, "width": 73, "skin": "InGameView/jindutiao-1-3.png", "pivotY": 37, "pivotX": 37, "height": 73 }, "compId": 571, "child": [{ "type": "FontClip", "props": { "y": 36.5, "x": 36.5, "width": 25, "var": "NextLv", "value": "2", "skin": "Ball/43.png", "sheet": "0123456789", "pivotY": 15, "pivotX": 13, "height": 29, "align": "center" }, "compId": 576 }] }, { "type": "Text", "props": { "y": -22, "x": 38, "width": 117, "var": "NowScore", "valign": "middle", "text": "0", "pivotY": 13, "pivotX": 19, "height": 26, "fontSize": 30, "color": "#ffffff", "align": "right", "runtime": "laya.display.Text" }, "compId": 674 }, { "type": "Text", "props": { "y": -21, "x": 208, "width": 124, "var": "RequireScore", "valign": "middle", "text": "0", "pivotY": 14, "pivotX": 62, "height": 27, "fontSize": 30, "color": "#ffffff", "align": "left", "runtime": "laya.display.Text" }, "compId": 675 }, { "type": "Text", "props": { "y": -34, "x": 136, "width": 10, "text": "/", "height": 25, "fontSize": 30, "color": "#ffffff", "runtime": "laya.display.Text" }, "compId": 676 }] }, { "type": "Image", "props": { "y": 49, "x": 0, "visible": false, "var": "Effect", "skin": "InGameView/youxinei-1-2.png", "right": 0, "left": 0 }, "compId": 558, "child": [{ "type": "Button", "props": { "y": 883, "x": 360, "width": 298, "var": "EffectBtn", "stateNum": 1, "skin": "InGameView/youxinei-1-5.png", "pivotY": 53, "pivotX": 149, "height": 106 }, "compId": 564 }, { "type": "Image", "props": { "y": 95, "x": 626, "width": 69, "pivotY": 36, "pivotX": 35, "name": "ICON", "height": 72 }, "compId": 565 }, { "type": "Image", "props": { "x": 0, "width": 72, "top": -48, "skin": "InGameView/youxinei-1-1.png", "name": "Left", "height": 1280 }, "compId": 566 }, { "type": "Image", "props": { "x": 684, "width": 72, "top": -48, "skin": "InGameView/youxinei-1-1.png", "rotation": 180, "pivotY": 640, "pivotX": 36, "name": "Right", "height": 1280 }, "compId": 567 }, { "type": "Text", "props": { "y": 52, "x": 318, "width": 153, "valign": "middle", "text": "消除所有的", "pivotY": 28, "pivotX": 77, "name": "describe", "height": 55, "fontSize": 30, "font": "Microsoft YaHei", "color": "#ffffff", "align": "left", "runtime": "laya.display.Text" }, "compId": 579, "child": [{ "type": "Text", "props": { "y": 26, "x": 176, "width": 40, "var": "ClearNum", "valign": "middle", "text": "2", "pivotY": 23, "pivotX": 20, "height": 45, "fontSize": 35, "color": "#ffffff", "align": "center", "runtime": "laya.display.Text" }, "compId": 580 }] }, { "type": "Text", "props": { "y": 52, "x": 362, "width": 241, "valign": "middle", "text": "消除你所砸到的球", "pivotY": 28, "pivotX": 121, "name": "describe2", "height": 55, "fontSize": 30, "font": "Microsoft YaHei", "color": "#ffffff", "align": "left", "runtime": "laya.display.Text" }, "compId": 678 }] }, { "type": "Image", "props": { "x": 311, "width": 124, "visible": false, "var": "Guide", "skin": "InGameView/yindao.png", "pivotY": 32, "pivotX": 31, "height": 148, "bottom": 160 }, "compId": 734, "child": [{ "type": "Image", "props": { "y": -40, "x": -55, "skin": "InGameView/zhujiemian-1-9.png" }, "compId": 736 }] }], "animations": [{ "nodes": [{ "target": 383, "keyframes": { "var": [{ "value": "arrowbtn", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "var", "index": 0 }], "skin": [{ "value": "Skillicon/BoosterArrow1_00239.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 0 }, { "value": "Skillicon/BoosterArrow1_00240.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 1 }, { "value": "Skillicon/BoosterArrow1_00241.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 2 }, { "value": "Skillicon/BoosterArrow1_00242.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 3 }, { "value": "Skillicon/BoosterArrow1_00243.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 4 }, { "value": "Skillicon/BoosterArrow1_00244.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 5 }, { "value": "Skillicon/BoosterArrow1_00245.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 6 }, { "value": "Skillicon/BoosterArrow1_00246.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 7 }, { "value": "Skillicon/BoosterArrow1_00247.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 8 }, { "value": "Skillicon/BoosterArrow1_00248.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 9 }, { "value": "Skillicon/BoosterArrow1_00249.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 10 }, { "value": "Skillicon/BoosterArrow1_00250.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 11 }, { "value": "Skillicon/BoosterArrow1_00251.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 12 }, { "value": "Skillicon/BoosterArrow1_00252.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 13 }, { "value": "Skillicon/BoosterArrow1_00253.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 14 }, { "value": "Skillicon/BoosterArrow1_00254.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 15 }, { "value": "Skillicon/BoosterArrow1_00255.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 16 }], "name": [{ "value": "", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "name", "index": 0 }] } }], "name": "ani1", "id": 1, "frameRate": 24, "action": 0 }, { "nodes": [{ "target": 384, "keyframes": { "skin": [{ "value": "Skillicon/BoosterExplode1_00239.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 0 }, { "value": "Skillicon/BoosterExplode1_00240.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 1 }, { "value": "Skillicon/BoosterExplode1_00241.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 2 }, { "value": "Skillicon/BoosterExplode1_00242.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 3 }, { "value": "Skillicon/BoosterExplode1_00243.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 4 }, { "value": "Skillicon/BoosterExplode1_00244.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 5 }, { "value": "Skillicon/BoosterExplode1_00245.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 6 }, { "value": "Skillicon/BoosterExplode1_00246.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 7 }, { "value": "Skillicon/BoosterExplode1_00247.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 8 }, { "value": "Skillicon/BoosterExplode1_00248.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 9 }, { "value": "Skillicon/BoosterExplode1_00249.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 10 }, { "value": "Skillicon/BoosterExplode1_00250.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 11 }, { "value": "Skillicon/BoosterExplode1_00251.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 12 }, { "value": "Skillicon/BoosterExplode1_00252.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 13 }, { "value": "Skillicon/BoosterExplode1_00253.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 14 }, { "value": "Skillicon/BoosterExplode1_00254.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 15 }, { "value": "Skillicon/BoosterExplode1_00255.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 16 }] } }], "name": "ani2", "id": 2, "frameRate": 24, "action": 0 }, { "nodes": [{ "target": 385, "keyframes": { "skin": [{ "value": "Skillicon/BoosterFire1_00239.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 0 }, { "value": "Skillicon/BoosterFire1_00240.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 1 }, { "value": "Skillicon/BoosterFire1_00241.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 2 }, { "value": "Skillicon/BoosterFire1_00242.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 3 }, { "value": "Skillicon/BoosterFire1_00243.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 4 }, { "value": "Skillicon/BoosterFire1_00244.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 5 }, { "value": "Skillicon/BoosterFire1_00245.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 6 }, { "value": "Skillicon/BoosterFire1_00246.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 7 }, { "value": "Skillicon/BoosterFire1_00247.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 8 }, { "value": "Skillicon/BoosterFire1_00248.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 9 }, { "value": "Skillicon/BoosterFire1_00249.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 10 }, { "value": "Skillicon/BoosterFire1_00250.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 11 }, { "value": "Skillicon/BoosterFire1_00251.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 12 }, { "value": "Skillicon/BoosterFire1_00252.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 13 }, { "value": "Skillicon/BoosterFire1_00253.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 14 }, { "value": "Skillicon/BoosterFire1_00254.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 15 }, { "value": "Skillicon/BoosterFire1_00255.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 16 }] } }], "name": "ani3", "id": 3, "frameRate": 24, "action": 0 }, { "nodes": [{ "target": 386, "keyframes": { "skin": [{ "value": "Skillicon/BoosterShoot1_00240.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 0 }, { "value": "Skillicon/BoosterShoot1_00241.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 1 }, { "value": "Skillicon/BoosterShoot1_00242.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 2 }, { "value": "Skillicon/BoosterShoot1_00243.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 3 }, { "value": "Skillicon/BoosterShoot1_00244.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 4 }, { "value": "Skillicon/BoosterShoot1_00245.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 5 }, { "value": "Skillicon/BoosterShoot1_00246.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 6 }, { "value": "Skillicon/BoosterShoot1_00247.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 7 }, { "value": "Skillicon/BoosterShoot1_00248.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 8 }, { "value": "Skillicon/BoosterShoot1_00249.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 9 }, { "value": "Skillicon/BoosterShoot1_00250.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 10 }, { "value": "Skillicon/BoosterShoot1_00251.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 11 }, { "value": "Skillicon/BoosterShoot1_00252.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 12 }, { "value": "Skillicon/BoosterShoot1_00253.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 13 }, { "value": "Skillicon/BoosterShoot1_00254.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 14 }, { "value": "Skillicon/BoosterShoot1_00255.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 15 }, { "value": "Skillicon/BoosterShoot1_00256.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 16 }] } }], "name": "ani4", "id": 4, "frameRate": 24, "action": 0 }, { "nodes": [{ "target": 388, "keyframes": { "skin": [{ "value": "Skillicon/BoosterHammer1_00238.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 0 }, { "value": "Skillicon/BoosterHammer1_00239.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 1 }, { "value": "Skillicon/BoosterHammer1_00240.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 2 }, { "value": "Skillicon/BoosterHammer1_00241.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 3 }, { "value": "Skillicon/BoosterHammer1_00242.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 4 }, { "value": "Skillicon/BoosterHammer1_00243.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 5 }, { "value": "Skillicon/BoosterHammer1_00244.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 6 }, { "value": "Skillicon/BoosterHammer1_00245.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 7 }, { "value": "Skillicon/BoosterHammer1_00246.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 8 }, { "value": "Skillicon/BoosterHammer1_00247.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 9 }, { "value": "Skillicon/BoosterHammer1_00248.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 10 }, { "value": "Skillicon/BoosterHammer1_00249.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 11 }, { "value": "Skillicon/BoosterHammer1_00250.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 12 }, { "value": "Skillicon/BoosterHammer1_00251.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 13 }, { "value": "Skillicon/BoosterHammer1_00252.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 14 }, { "value": "Skillicon/BoosterHammer1_00253.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 15 }, { "value": "Skillicon/BoosterHammer1_00254.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 16 }] } }], "name": "ani5", "id": 5, "frameRate": 24, "action": 0 }, { "nodes": [{ "target": 734, "keyframes": { "scaleY": [{ "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleY", "index": 0 }, { "value": 0.95, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleY", "index": 5 }, { "value": 0.9, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleY", "index": 10 }, { "value": 0.95, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleY", "index": 15 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleY", "index": 20 }, { "value": 0.95, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleY", "index": 25 }, { "value": 0.9, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleY", "index": 30 }, { "value": 0.95, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleY", "index": 35 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleY", "index": 40 }], "scaleX": [{ "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleX", "index": 0 }, { "value": 0.95, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleX", "index": 5 }, { "value": 0.9, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleX", "index": 10 }, { "value": 0.95, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleX", "index": 15 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleX", "index": 20 }, { "value": 0.95, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleX", "index": 25 }, { "value": 0.9, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleX", "index": 30 }, { "value": 0.95, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleX", "index": 35 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleX", "index": 40 }] } }], "name": "guide", "id": 6, "frameRate": 24, "action": 0 }], "loadList": ["InGameView/colliderbottom.png", "InGameView/0.png", "InGameView/1.png", "InGameView/groundplane.png", "InGameView/borderbottom.png", "InGameView/border2.png", "InGameView/blast-35.png", "Skillicon/BoosterArrow1_00239.png", "InGameView/blast-45.png", "Skillicon/BoosterExplode1_00239.png", "Skillicon/BoosterFire1_00239.png", "Skillicon/BoosterShoot1_00240.png", "Skillicon/BoosterHammer1_00238.png", "InGameView/jindutiao-1-2.png", "InGameView/jindutiao-1-3.png", "Ball/43.png", "InGameView/youxinei-1-2.png", "InGameView/youxinei-1-5.png", "InGameView/youxinei-1-1.png", "InGameView/yindao.png", "InGameView/zhujiemian-1-9.png", "Skillicon/BoosterArrow1_00240.png", "Skillicon/BoosterArrow1_00241.png", "Skillicon/BoosterArrow1_00242.png", "Skillicon/BoosterArrow1_00243.png", "Skillicon/BoosterArrow1_00244.png", "Skillicon/BoosterArrow1_00245.png", "Skillicon/BoosterArrow1_00246.png", "Skillicon/BoosterArrow1_00247.png", "Skillicon/BoosterArrow1_00248.png", "Skillicon/BoosterArrow1_00249.png", "Skillicon/BoosterArrow1_00250.png", "Skillicon/BoosterArrow1_00251.png", "Skillicon/BoosterArrow1_00252.png", "Skillicon/BoosterArrow1_00253.png", "Skillicon/BoosterArrow1_00254.png", "Skillicon/BoosterArrow1_00255.png", "Skillicon/BoosterExplode1_00240.png", "Skillicon/BoosterExplode1_00241.png", "Skillicon/BoosterExplode1_00242.png", "Skillicon/BoosterExplode1_00243.png", "Skillicon/BoosterExplode1_00244.png", "Skillicon/BoosterExplode1_00245.png", "Skillicon/BoosterExplode1_00246.png", "Skillicon/BoosterExplode1_00247.png", "Skillicon/BoosterExplode1_00248.png", "Skillicon/BoosterExplode1_00249.png", "Skillicon/BoosterExplode1_00250.png", "Skillicon/BoosterExplode1_00251.png", "Skillicon/BoosterExplode1_00252.png", "Skillicon/BoosterExplode1_00253.png", "Skillicon/BoosterExplode1_00254.png", "Skillicon/BoosterExplode1_00255.png", "Skillicon/BoosterFire1_00240.png", "Skillicon/BoosterFire1_00241.png", "Skillicon/BoosterFire1_00242.png", "Skillicon/BoosterFire1_00243.png", "Skillicon/BoosterFire1_00244.png", "Skillicon/BoosterFire1_00245.png", "Skillicon/BoosterFire1_00246.png", "Skillicon/BoosterFire1_00247.png", "Skillicon/BoosterFire1_00248.png", "Skillicon/BoosterFire1_00249.png", "Skillicon/BoosterFire1_00250.png", "Skillicon/BoosterFire1_00251.png", "Skillicon/BoosterFire1_00252.png", "Skillicon/BoosterFire1_00253.png", "Skillicon/BoosterFire1_00254.png", "Skillicon/BoosterFire1_00255.png", "Skillicon/BoosterShoot1_00241.png", "Skillicon/BoosterShoot1_00242.png", "Skillicon/BoosterShoot1_00243.png", "Skillicon/BoosterShoot1_00244.png", "Skillicon/BoosterShoot1_00245.png", "Skillicon/BoosterShoot1_00246.png", "Skillicon/BoosterShoot1_00247.png", "Skillicon/BoosterShoot1_00248.png", "Skillicon/BoosterShoot1_00249.png", "Skillicon/BoosterShoot1_00250.png", "Skillicon/BoosterShoot1_00251.png", "Skillicon/BoosterShoot1_00252.png", "Skillicon/BoosterShoot1_00253.png", "Skillicon/BoosterShoot1_00254.png", "Skillicon/BoosterShoot1_00255.png", "Skillicon/BoosterShoot1_00256.png", "Skillicon/BoosterHammer1_00239.png", "Skillicon/BoosterHammer1_00240.png", "Skillicon/BoosterHammer1_00241.png", "Skillicon/BoosterHammer1_00242.png", "Skillicon/BoosterHammer1_00243.png", "Skillicon/BoosterHammer1_00244.png", "Skillicon/BoosterHammer1_00245.png", "Skillicon/BoosterHammer1_00246.png", "Skillicon/BoosterHammer1_00247.png", "Skillicon/BoosterHammer1_00248.png", "Skillicon/BoosterHammer1_00249.png", "Skillicon/BoosterHammer1_00250.png", "Skillicon/BoosterHammer1_00251.png", "Skillicon/BoosterHammer1_00252.png", "Skillicon/BoosterHammer1_00253.png", "Skillicon/BoosterHammer1_00254.png"], "loadList3D": [] };
- ui.InGameSceneUI = InGameSceneUI;
- REG("ui.InGameSceneUI", InGameSceneUI);
- class LotteryViewUI extends Laya.View {
- constructor() { super(); }
- createChildren() {
- super.createChildren();
- this.createView(LotteryViewUI.uiView);
- }
- }
- LotteryViewUI.uiView = { "type": "View", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 460, "x": 337, "var": "dial", "skin": "LotteryView/choujiang-1-1.png", "anchorY": 0.5, "anchorX": 0.5 }, "compId": 4, "child": [{ "type": "Box", "props": { "y": 171, "x": 344, "width": 93, "rotation": 0, "pivotY": 46, "pivotX": 47, "height": 91 }, "compId": 8, "child": [{ "type": "Image", "props": { "y": 46, "x": 47, "width": 87, "skin": "LotteryView/func1.png", "rotation": 221, "pivotY": 43, "pivotX": 44, "height": 86 }, "compId": 9 }, { "type": "Text", "props": { "y": 2, "x": 91, "width": 68, "valign": "middle", "text": "X1", "rotation": 225, "pivotY": 13, "pivotX": 34, "height": 25, "fontSize": 20, "color": "#ffffff", "align": "center", "runtime": "laya.display.Text" }, "compId": 10 }] }, { "type": "Box", "props": { "y": 277, "x": 403, "width": 93, "rotation": 12, "pivotY": 46, "pivotX": 47, "height": 91 }, "compId": 14, "child": [{ "type": "Image", "props": { "y": 46, "x": 47, "width": 87, "skin": "LotteryView/func4.png", "rotation": 253, "pivotY": 43, "pivotX": 44, "height": 86 }, "compId": 15 }, { "type": "Text", "props": { "y": 33, "x": 110, "width": 68, "valign": "middle", "text": "X2", "rotation": 254, "pivotY": 13, "pivotX": 34, "height": 25, "fontSize": 20, "color": "#ffffff", "align": "center", "runtime": "laya.display.Text" }, "compId": 16 }] }, { "type": "Box", "props": { "y": 395, "x": 345, "width": 93, "rotation": 60, "pivotY": 46, "pivotX": 47, "height": 91 }, "compId": 17, "child": [{ "type": "Image", "props": { "y": 46, "x": 47, "width": 87, "skin": "LotteryView/func5.png", "rotation": -86, "pivotY": 43, "pivotX": 44, "height": 86 }, "compId": 18 }, { "type": "Text", "props": { "y": 45.5, "x": 109, "width": 68, "valign": "middle", "text": "X1", "rotation": -91, "pivotY": 13, "pivotX": 34, "height": 25, "fontSize": 20, "color": "#ffffff", "align": "center", "runtime": "laya.display.Text" }, "compId": 19 }] }, { "type": "Box", "props": { "y": 395, "x": 207, "width": 93, "rotation": 120, "pivotY": 46, "pivotX": 47, "height": 91 }, "compId": 20, "child": [{ "type": "Image", "props": { "y": 46, "x": 47, "width": 87, "skin": "LotteryView/func5.png", "rotation": -87, "pivotY": 43, "pivotX": 44, "height": 86 }, "compId": 21 }, { "type": "Text", "props": { "y": 45.5, "x": 109, "width": 68, "valign": "middle", "text": "X2", "rotation": -91, "pivotY": 13, "pivotX": 34, "height": 25, "fontSize": 20, "color": "#ffffff", "align": "center", "runtime": "laya.display.Text" }, "compId": 22 }] }, { "type": "Box", "props": { "y": 277, "x": 139, "width": 93, "rotation": 180, "pivotY": 46, "pivotX": 47, "height": 91 }, "compId": 23, "child": [{ "type": "Image", "props": { "y": 46, "x": 47, "width": 87, "skin": "LotteryView/func1.png", "rotation": -83, "pivotY": 43, "pivotX": 44, "height": 86 }, "compId": 24 }, { "type": "Text", "props": { "y": 45.5, "x": 109, "width": 68, "valign": "middle", "text": "X2", "rotation": -91, "pivotY": 13, "pivotX": 34, "height": 25, "fontSize": 20, "color": "#ffffff", "align": "center", "runtime": "laya.display.Text" }, "compId": 25 }] }, { "type": "Box", "props": { "y": 162, "x": 207, "width": 93, "rotation": 236, "pivotY": 46, "pivotX": 47, "height": 91 }, "compId": 26, "child": [{ "type": "Image", "props": { "y": 46, "x": 47, "width": 87, "skin": "LotteryView/func2.png", "rotation": 90, "pivotY": 43, "pivotX": 44, "height": 86 }, "compId": 27 }, { "type": "Text", "props": { "y": 45.5, "x": 109, "width": 68, "valign": "middle", "text": "X1", "rotation": -91, "pivotY": 13, "pivotX": 34, "height": 25, "fontSize": 20, "color": "#ffffff", "align": "center", "runtime": "laya.display.Text" }, "compId": 28 }] }] }, { "type": "Button", "props": { "y": 227, "x": 614, "var": "CloseBtn", "stateNum": 1, "skin": "LotteryView/choujiang-1-4.png" }, "compId": 5 }, { "type": "Image", "props": { "y": 437, "x": 337, "width": 87, "skin": "LotteryView/choujiang-1-2.png", "pivotY": 77, "pivotX": 44, "name": "Pointer", "height": 153 }, "compId": 6 }, { "type": "Button", "props": { "y": 931, "x": 360, "width": 298, "var": "LotteryBtn", "stateNum": 1, "skin": "LotteryView/choujiang-1-3.png", "pivotY": 53, "pivotX": 149, "height": 106 }, "compId": 7 }], "loadList": ["LotteryView/choujiang-1-1.png", "LotteryView/func1.png", "LotteryView/func4.png", "LotteryView/func5.png", "LotteryView/func2.png", "LotteryView/choujiang-1-4.png", "LotteryView/choujiang-1-2.png", "LotteryView/choujiang-1-3.png"], "loadList3D": [] };
- ui.LotteryViewUI = LotteryViewUI;
- REG("ui.LotteryViewUI", LotteryViewUI);
- class MainSceneUI extends Laya.View {
- constructor() { super(); }
- createChildren() {
- super.createChildren();
- this.createView(MainSceneUI.uiView);
- }
- }
- MainSceneUI.uiView = { "type": "View", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "var": "BG", "top": 0, "skin": "MainView/zhujiemian-1-8.png", "sizeGrid": "15,17,13,9", "right": 0, "left": 0, "bottom": 0, "alpha": 1 }, "compId": 13 }, { "type": "Button", "props": { "y": 258, "x": 42, "width": 42, "var": "SetBtn", "stateNum": 1, "skin": "MainView/zhujiemian-1-6.png", "pivotY": 21, "pivotX": 21, "height": 42 }, "compId": 30 }, { "type": "Box", "props": { "x": 97, "width": 555, "height": 173, "bottom": 180 }, "compId": 56, "child": [{ "type": "Button", "props": { "y": 25, "x": 220, "var": "RankBtn", "stateNum": 1, "skin": "MainView/zhujiemian-1-3(1).png" }, "compId": 31 }, { "type": "Button", "props": { "y": 16, "x": 436, "var": "LotteryBtn", "stateNum": 1, "skin": "MainView/zhujiemian-1-4(1).png" }, "compId": 32 }, { "type": "Button", "props": { "y": 16, "x": 19, "var": "SignBtn", "stateNum": 1, "skin": "MainView/zhujiemian-1-2(1).png" }, "compId": 33 }] }, { "type": "Image", "props": { "x": 360, "width": 629, "top": 2, "skin": "MainView/zhujiemian-1-7.png", "pivotY": 468, "pivotX": 315, "height": 936 }, "compId": 60, "child": [{ "type": "Button", "props": { "y": 832.5, "x": 298, "width": 207, "var": "StartBtn", "stateNum": 1, "skin": "MainView/zhujiemian-1-5.png", "pivotY": 104, "pivotX": 104, "height": 207 }, "compId": 9 }] }, { "type": "Image", "props": { "y": 205, "x": 375, "width": 526, "skin": "MainView/logo.png", "pivotY": 153, "pivotX": 263, "height": 305 }, "compId": 57 }], "loadList": ["MainView/zhujiemian-1-8.png", "MainView/zhujiemian-1-6.png", "MainView/zhujiemian-1-3(1).png", "MainView/zhujiemian-1-4(1).png", "MainView/zhujiemian-1-2(1).png", "MainView/zhujiemian-1-7.png", "MainView/zhujiemian-1-5.png", "MainView/logo.png"], "loadList3D": [] };
- ui.MainSceneUI = MainSceneUI;
- REG("ui.MainSceneUI", MainSceneUI);
- class RankViewUI extends Laya.View {
- constructor() { super(); }
- createChildren() {
- super.createChildren();
- this.createView(RankViewUI.uiView);
- }
- }
- RankViewUI.uiView = { "type": "View", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 513, "x": 360, "width": 555, "skin": "SetView/shezhi-1-1.png", "sizeGrid": "98,159,125,118", "height": 767, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 5, "child": [{ "type": "Image", "props": { "y": 14, "x": 198, "skin": "RankView/paihang-1-1.png" }, "compId": 6 }] }, { "type": "Button", "props": { "y": 139, "x": 573, "var": "CloseBtn", "stateNum": 1, "skin": "SetView/shezhi-1-3.png" }, "compId": 7 }, { "type": "Box", "props": { "y": 231, "x": 118, "width": 495, "height": 623 }, "compId": 9, "child": [{ "type": "Image", "props": { "y": 6, "x": 12, "width": 459, "skin": "RankView/paihang-1-2.png", "sizeGrid": "22,39,25,23", "height": 65 }, "compId": 8 }, { "type": "Image", "props": { "y": 84, "x": 12, "width": 459, "skin": "RankView/paihang-1-2.png", "sizeGrid": "22,39,25,23", "height": 65 }, "compId": 11 }, { "type": "Image", "props": { "y": 163, "x": 12, "width": 459, "skin": "RankView/paihang-1-2.png", "sizeGrid": "22,39,25,23", "height": 65 }, "compId": 12 }, { "type": "Image", "props": { "y": 246.5, "x": 12, "width": 459, "skin": "RankView/paihang-1-2.png", "sizeGrid": "22,39,25,23", "height": 65 }, "compId": 13 }, { "type": "Image", "props": { "y": 328, "x": 12, "width": 459, "skin": "RankView/paihang-1-2.png", "sizeGrid": "22,39,25,23", "height": 65 }, "compId": 14 }, { "type": "Image", "props": { "y": 407, "x": 12, "width": 459, "skin": "RankView/paihang-1-2.png", "sizeGrid": "22,39,25,23", "height": 65 }, "compId": 15 }, { "type": "Image", "props": { "y": 551, "x": 2, "width": 487, "skin": "RankView/paihang-1-7.png", "sizeGrid": "25,31,28,24", "height": 70 }, "compId": 16 }] }, { "type": "Button", "props": { "y": 733, "x": 194, "var": "UpPageBtn", "stateNum": 1, "skin": "RankView/paihang-1-6.png" }, "compId": 17 }, { "type": "Button", "props": { "y": 744, "x": 476, "width": 69, "var": "DownPageBtn", "stateNum": 1, "skin": "RankView/paihang-1-6.png", "rotation": 180, "pivotY": 16, "pivotX": 35, "height": 31 }, "compId": 18 }], "loadList": ["SetView/shezhi-1-1.png", "RankView/paihang-1-1.png", "SetView/shezhi-1-3.png", "RankView/paihang-1-2.png", "RankView/paihang-1-7.png", "RankView/paihang-1-6.png"], "loadList3D": [] };
- ui.RankViewUI = RankViewUI;
- REG("ui.RankViewUI", RankViewUI);
- class ReviveViewUI extends Laya.Scene {
- constructor() { super(); }
- createChildren() {
- super.createChildren();
- this.createView(ReviveViewUI.uiView);
- }
- }
- ReviveViewUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "var": "BG", "top": 0, "skin": "WinView/black.png", "sizeGrid": "10,12,13,13", "right": 0, "left": 0, "bottom": 0 }, "compId": 10 }, { "type": "Image", "props": { "y": 17, "x": 0, "skin": "ReviveView/fuhuo-1-1.png" }, "compId": 4, "child": [{ "type": "Image", "props": { "y": 250, "x": 285, "skin": "ReviveView/fuhuo-1-2.png" }, "compId": 5 }] }, { "type": "Image", "props": { "y": 449, "x": 370, "width": 147, "skin": "ReviveView/fuhuo-1-4.png", "pivotY": 74, "pivotX": 74, "height": 147 }, "compId": 6, "child": [{ "type": "Text", "props": { "y": 70, "x": 74, "width": 103, "var": "Time", "valign": "middle", "text": "9", "pivotY": 58, "pivotX": 52, "height": 117, "fontSize": 125, "color": "#f05929", "align": "center", "runtime": "laya.display.Text" }, "compId": 7 }] }, { "type": "Button", "props": { "y": 760, "x": 304.5, "var": "NoBtn", "stateNum": 1, "skin": "ReviveView/fuhuo-1-5.png" }, "compId": 8 }, { "type": "Button", "props": { "y": 583, "x": 304.5, "var": "VideoBtn", "stateNum": 1, "skin": "ReviveView/fuhuo-1-3.png" }, "compId": 9 }], "loadList": ["WinView/black.png", "ReviveView/fuhuo-1-1.png", "ReviveView/fuhuo-1-2.png", "ReviveView/fuhuo-1-4.png", "ReviveView/fuhuo-1-5.png", "ReviveView/fuhuo-1-3.png"], "loadList3D": [] };
- ui.ReviveViewUI = ReviveViewUI;
- REG("ui.ReviveViewUI", ReviveViewUI);
- class SetViewUI extends Laya.View {
- constructor() { super(); }
- createChildren() {
- super.createChildren();
- this.createView(SetViewUI.uiView);
- }
- }
- SetViewUI.uiView = { "type": "View", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 380, "x": 360, "width": 550, "skin": "SetView/shezhi-1-1.png", "pivotY": 178, "pivotX": 275, "height": 355, "alpha": 1, "sizeGrid": "98,159,125,118" }, "compId": 4, "child": [{ "type": "Image", "props": { "y": 17, "x": 225, "skin": "SetView/shezhi-1-2.png" }, "compId": 5 }] }, { "type": "Button", "props": { "y": 226, "x": 574, "var": "CloseBtn", "stateNum": 1, "skin": "SetView/shezhi-1-3.png" }, "compId": 6 }, { "type": "Sprite", "props": { "y": 335, "x": 191, "texture": "SetView/shezhi-1-4.png", "name": "SoundSprite" }, "compId": 7 }, { "type": "Sprite", "props": { "y": 431, "x": 193, "texture": "SetView/shezhi-1-5.png", "name": "ShakeSprite" }, "compId": 8 }, { "type": "Box", "props": { "y": 325, "x": 427, "width": 100, "var": "Sound", "height": 51 }, "compId": 9, "child": [{ "type": "Image", "props": { "y": 21, "x": 0, "skin": "SetView/shezhi-1-6.png" }, "compId": 10 }, { "type": "Image", "props": { "y": 26, "x": 70, "width": 51, "skin": "SetView/shezhi-1-8.png", "pivotY": 26, "pivotX": 26, "name": "open", "height": 51 }, "compId": 11 }, { "type": "Image", "props": { "y": 26, "x": 32, "width": 51, "skin": "SetView/shezhi-1-9.png", "pivotY": 26, "pivotX": 26, "name": "close", "height": 51 }, "compId": 12 }, { "type": "Button", "props": { "y": 26, "x": 50, "width": 100, "pivotY": 26, "pivotX": 50, "name": "btn", "height": 51 }, "compId": 17 }] }, { "type": "Box", "props": { "y": 423, "x": 427, "width": 100, "var": "Shake", "height": 54 }, "compId": 13, "child": [{ "type": "Image", "props": { "y": 23, "x": 0, "skin": "SetView/shezhi-1-7.png" }, "compId": 14 }, { "type": "Image", "props": { "y": 28, "x": 70, "width": 51, "skin": "SetView/shezhi-1-8.png", "pivotY": 26, "pivotX": 26, "name": "open", "height": 51 }, "compId": 15 }, { "type": "Image", "props": { "y": 28, "x": 32, "width": 51, "skin": "SetView/shezhi-1-9.png", "pivotY": 26, "pivotX": 26, "name": "close", "height": 51 }, "compId": 16 }, { "type": "Button", "props": { "y": 28, "x": 50, "width": 100, "pivotY": 26, "pivotX": 50, "name": "btn", "height": 51 }, "compId": 18 }] }, { "type": "Text", "props": { "y": 515, "x": 285, "width": 128, "valign": "middle", "text": "UserID:", "pivotY": 26, "pivotX": 64, "height": 52, "fontSize": 30, "align": "center", "runtime": "laya.display.Text" }, "compId": 19 }, { "type": "Text", "props": { "y": 493, "x": 360, "width": 189, "var": "userid", "valign": "middle", "height": 45, "fontSize": 30, "align": "left", "runtime": "laya.display.Text" }, "compId": 20 }], "loadList": ["SetView/shezhi-1-1.png", "SetView/shezhi-1-2.png", "SetView/shezhi-1-3.png", "SetView/shezhi-1-4.png", "SetView/shezhi-1-5.png", "SetView/shezhi-1-6.png", "SetView/shezhi-1-8.png", "SetView/shezhi-1-9.png", "SetView/shezhi-1-7.png"], "loadList3D": [] };
- ui.SetViewUI = SetViewUI;
- REG("ui.SetViewUI", SetViewUI);
- class SignViewUI extends Laya.Scene {
- constructor() { super(); }
- createChildren() {
- super.createChildren();
- this.createView(SignViewUI.uiView);
- }
- }
- SignViewUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 581, "x": 360, "width": 555, "skin": "SetView/shezhi-1-1.png", "sizeGrid": "98,159,125,118", "height": 871, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 3, "child": [{ "type": "Image", "props": { "y": 13, "x": 225, "skin": "SignView/qiandao-1-1.png" }, "compId": 4 }, { "type": "Box", "props": { "y": 109, "x": 27, "width": 497, "var": "ItemList", "height": 572 }, "compId": 5, "child": [{ "type": "Box", "props": { "y": 3, "x": 0, "width": 150, "height": 188 }, "compId": 6, "child": [{ "type": "Image", "props": { "y": 32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-3.png", "sizeGrid": "9,45,22,34", "height": 157 }, "compId": 7, "child": [{ "type": "Image", "props": { "y": -32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-2.png", "height": 46 }, "compId": 8 }, { "type": "Image", "props": { "y": -23, "x": 39, "skin": "SignView/qiandao-1-4.png" }, "compId": 9 }, { "type": "Text", "props": { "y": -23, "x": 66.548095703125, "text": "1", "fontSize": 25, "color": "#ffffff", "runtime": "laya.display.Text" }, "compId": 10 }] }, { "type": "Button", "props": { "y": 114, "x": 74, "width": 147, "pivotY": 73, "pivotX": 74, "name": "btn", "height": 145 }, "compId": 11 }, { "type": "Image", "props": { "y": 94, "x": 74, "width": 100, "pivotY": 50, "pivotX": 50, "name": "icon", "height": 100 }, "compId": 12, "child": [{ "type": "Text", "props": { "y": 119, "x": 50, "width": 99, "valign": "middle", "text": "X3", "pivotY": 16, "pivotX": 50, "name": "num", "height": 31, "fontSize": 25, "align": "center", "runtime": "laya.display.Text" }, "compId": 13 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "width": 148, "visible": false, "skin": "SignView/qiandao-1-7(1).png", "name": "complete", "height": 186 }, "compId": 14, "child": [{ "type": "Image", "props": { "y": 93, "x": 74, "width": 51, "skin": "SignView/qiandao-1-8.png", "pivotY": 26, "pivotX": 26, "height": 51 }, "compId": 15 }] }] }, { "type": "Box", "props": { "y": 3, "x": 173.5, "width": 150, "height": 188 }, "compId": 16, "child": [{ "type": "Image", "props": { "y": 32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-3.png", "sizeGrid": "9,45,22,34", "height": 157 }, "compId": 17, "child": [{ "type": "Image", "props": { "y": -32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-2.png", "height": 46 }, "compId": 18 }, { "type": "Image", "props": { "y": -23, "x": 39, "skin": "SignView/qiandao-1-4.png" }, "compId": 19 }, { "type": "Text", "props": { "y": -23, "x": 66.548095703125, "text": "2", "fontSize": 25, "color": "#ffffff", "runtime": "laya.display.Text" }, "compId": 20 }] }, { "type": "Button", "props": { "y": 114, "x": 74, "width": 147, "pivotY": 73, "pivotX": 74, "name": "btn", "height": 145 }, "compId": 21 }, { "type": "Image", "props": { "y": 94, "x": 74, "width": 100, "pivotY": 50, "pivotX": 50, "name": "icon", "height": 100 }, "compId": 22, "child": [{ "type": "Text", "props": { "y": 119, "x": 50, "width": 99, "valign": "middle", "text": "X3", "pivotY": 16, "pivotX": 50, "name": "num", "height": 31, "fontSize": 25, "align": "center", "runtime": "laya.display.Text" }, "compId": 23 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "width": 148, "visible": false, "skin": "SignView/qiandao-1-7(1).png", "name": "complete", "height": 186 }, "compId": 24, "child": [{ "type": "Image", "props": { "y": 93, "x": 74, "width": 51, "skin": "SignView/qiandao-1-8.png", "pivotY": 26, "pivotX": 26, "height": 51 }, "compId": 25 }] }] }, { "type": "Box", "props": { "y": 3, "x": 347, "width": 150, "height": 188 }, "compId": 26, "child": [{ "type": "Image", "props": { "y": 32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-3.png", "sizeGrid": "9,45,22,34", "height": 157 }, "compId": 27, "child": [{ "type": "Image", "props": { "y": -32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-2.png", "height": 46 }, "compId": 28 }, { "type": "Image", "props": { "y": -23, "x": 39, "skin": "SignView/qiandao-1-4.png" }, "compId": 29 }, { "type": "Text", "props": { "y": -23, "x": 66.548095703125, "text": "3", "fontSize": 25, "color": "#ffffff", "runtime": "laya.display.Text" }, "compId": 30 }] }, { "type": "Button", "props": { "y": 114, "x": 74, "width": 147, "pivotY": 73, "pivotX": 74, "name": "btn", "height": 145 }, "compId": 31 }, { "type": "Image", "props": { "y": 94, "x": 74, "width": 100, "pivotY": 50, "pivotX": 50, "name": "icon", "height": 100 }, "compId": 32, "child": [{ "type": "Text", "props": { "y": 119, "x": 50, "width": 99, "valign": "middle", "text": "X3", "pivotY": 16, "pivotX": 50, "name": "num", "height": 31, "fontSize": 25, "align": "center", "runtime": "laya.display.Text" }, "compId": 33 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "width": 148, "visible": false, "skin": "SignView/qiandao-1-7(1).png", "name": "complete", "height": 186 }, "compId": 34, "child": [{ "type": "Image", "props": { "y": 93, "x": 74, "width": 51, "skin": "SignView/qiandao-1-8.png", "pivotY": 26, "pivotX": 26, "height": 51 }, "compId": 35 }] }] }, { "type": "Box", "props": { "y": 217, "x": 0, "width": 150, "height": 188 }, "compId": 36, "child": [{ "type": "Image", "props": { "y": 32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-3.png", "sizeGrid": "9,45,22,34", "height": 157 }, "compId": 37, "child": [{ "type": "Image", "props": { "y": -32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-2.png", "height": 46 }, "compId": 38 }, { "type": "Image", "props": { "y": -23, "x": 39, "skin": "SignView/qiandao-1-4.png" }, "compId": 39 }, { "type": "Text", "props": { "y": -23, "x": 66.548095703125, "text": "4", "fontSize": 25, "color": "#ffffff", "runtime": "laya.display.Text" }, "compId": 40 }] }, { "type": "Button", "props": { "y": 114, "x": 74, "width": 147, "pivotY": 73, "pivotX": 74, "name": "btn", "height": 145 }, "compId": 41 }, { "type": "Image", "props": { "y": 94, "x": 74, "width": 100, "pivotY": 50, "pivotX": 50, "name": "icon", "height": 100 }, "compId": 42, "child": [{ "type": "Text", "props": { "y": 119, "x": 50, "width": 99, "valign": "middle", "text": "X3", "pivotY": 16, "pivotX": 50, "name": "num", "height": 31, "fontSize": 25, "align": "center", "runtime": "laya.display.Text" }, "compId": 43 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "width": 148, "visible": false, "skin": "SignView/qiandao-1-7(1).png", "name": "complete", "height": 186 }, "compId": 44, "child": [{ "type": "Image", "props": { "y": 93, "x": 74, "width": 51, "skin": "SignView/qiandao-1-8.png", "pivotY": 26, "pivotX": 26, "height": 51 }, "compId": 45 }] }] }, { "type": "Box", "props": { "y": 217, "x": 173.5, "width": 150, "height": 188 }, "compId": 46, "child": [{ "type": "Image", "props": { "y": 32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-3.png", "sizeGrid": "9,45,22,34", "height": 157 }, "compId": 47, "child": [{ "type": "Image", "props": { "y": -32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-2.png", "height": 46 }, "compId": 48 }, { "type": "Image", "props": { "y": -23, "x": 39, "skin": "SignView/qiandao-1-4.png" }, "compId": 49 }, { "type": "Text", "props": { "y": -23, "x": 66.548095703125, "text": "5", "fontSize": 25, "color": "#ffffff", "runtime": "laya.display.Text" }, "compId": 50 }] }, { "type": "Button", "props": { "y": 114, "x": 74, "width": 147, "pivotY": 73, "pivotX": 74, "name": "btn", "height": 145 }, "compId": 51 }, { "type": "Image", "props": { "y": 94, "x": 74, "width": 100, "pivotY": 50, "pivotX": 50, "name": "icon", "height": 100 }, "compId": 52, "child": [{ "type": "Text", "props": { "y": 119, "x": 50, "width": 99, "valign": "middle", "text": "X3", "pivotY": 16, "pivotX": 50, "name": "num", "height": 31, "fontSize": 25, "align": "center", "runtime": "laya.display.Text" }, "compId": 53 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "width": 148, "visible": false, "skin": "SignView/qiandao-1-7(1).png", "name": "complete", "height": 186 }, "compId": 54, "child": [{ "type": "Image", "props": { "y": 93, "x": 74, "width": 51, "skin": "SignView/qiandao-1-8.png", "pivotY": 26, "pivotX": 26, "height": 51 }, "compId": 55 }] }] }, { "type": "Box", "props": { "y": 217, "x": 347, "width": 150, "height": 188 }, "compId": 56, "child": [{ "type": "Image", "props": { "y": 32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-3.png", "sizeGrid": "9,45,22,34", "height": 157 }, "compId": 57, "child": [{ "type": "Image", "props": { "y": -32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-2.png", "height": 46 }, "compId": 58 }, { "type": "Image", "props": { "y": -23, "x": 39, "skin": "SignView/qiandao-1-4.png" }, "compId": 59 }, { "type": "Text", "props": { "y": -23, "x": 66.548095703125, "text": "6", "fontSize": 25, "color": "#ffffff", "runtime": "laya.display.Text" }, "compId": 60 }] }, { "type": "Button", "props": { "y": 114, "x": 74, "width": 147, "pivotY": 73, "pivotX": 74, "name": "btn", "height": 145 }, "compId": 61 }, { "type": "Image", "props": { "y": 94, "x": 74, "width": 100, "pivotY": 50, "pivotX": 50, "name": "icon", "height": 100 }, "compId": 62, "child": [{ "type": "Text", "props": { "y": 119, "x": 50, "width": 99, "valign": "middle", "text": "X3", "pivotY": 16, "pivotX": 50, "name": "num", "height": 31, "fontSize": 25, "align": "center", "runtime": "laya.display.Text" }, "compId": 63 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "width": 148, "visible": false, "skin": "SignView/qiandao-1-7(1).png", "name": "complete", "height": 186 }, "compId": 64, "child": [{ "type": "Image", "props": { "y": 93, "x": 74, "width": 51, "skin": "SignView/qiandao-1-8.png", "pivotY": 26, "pivotX": 26, "height": 51 }, "compId": 65 }] }] }, { "type": "Box", "props": { "y": 413, "x": 1, "width": 490, "height": 158 }, "compId": 66, "child": [{ "type": "Image", "props": { "y": 2, "x": 3, "skin": "SignView/qiandao-1-6.png" }, "compId": 67, "child": [{ "type": "Image", "props": { "y": 20, "x": 243.5, "width": 69, "skin": "SignView/qiandao-1-4.png", "pivotY": 14, "pivotX": 35, "height": 28 }, "compId": 68 }, { "type": "Text", "props": { "y": 6, "x": 237, "text": "7", "fontSize": 25, "color": "#ffffff", "runtime": "laya.display.Text" }, "compId": 69 }] }, { "type": "Button", "props": { "y": 43, "x": 4, "width": 485, "name": "btn", "height": 113 }, "compId": 70 }, { "type": "Image", "props": { "y": 79, "x": 245, "width": 71, "pivotY": 32, "pivotX": 34, "name": "icon", "height": 69 }, "compId": 71, "child": [{ "type": "Text", "props": { "y": 86, "x": 34, "width": 99, "valign": "middle", "text": "X3", "pivotY": 16, "pivotX": 50, "name": "num", "height": 31, "fontSize": 25, "align": "center", "runtime": "laya.display.Text" }, "compId": 72 }] }, { "type": "Image", "props": { "y": 0, "x": 2, "width": 489, "visible": false, "skin": "SignView/qiandao-1-7(1).png", "name": "complete", "height": 157 }, "compId": 73, "child": [{ "type": "Image", "props": { "y": 78.5, "x": 244.5, "width": 51, "skin": "SignView/qiandao-1-8.png", "pivotY": 26, "pivotX": 26, "height": 51 }, "compId": 74 }] }] }] }, { "type": "Button", "props": { "y": 17, "x": 490, "var": "CloseBtn", "stateNum": 1, "skin": "SetView/shezhi-1-3.png" }, "compId": 75 }, { "type": "Button", "props": { "y": 765, "x": 278, "width": 298, "var": "SignBtn", "stateNum": 1, "skin": "SignView/qiandao-1-5.png", "pivotY": 53, "pivotX": 149, "height": 106 }, "compId": 76 }] }], "loadList": ["SetView/shezhi-1-1.png", "SignView/qiandao-1-1.png", "SignView/qiandao-1-3.png", "SignView/qiandao-1-2.png", "SignView/qiandao-1-4.png", "SignView/qiandao-1-7(1).png", "SignView/qiandao-1-8.png", "SignView/qiandao-1-6.png", "SetView/shezhi-1-3.png", "SignView/qiandao-1-5.png"], "loadList3D": [] };
- ui.SignViewUI = SignViewUI;
- REG("ui.SignViewUI", SignViewUI);
- class WinViewUI extends Laya.Scene {
- constructor() { super(); }
- createChildren() {
- super.createChildren();
- this.createView(WinViewUI.uiView);
- }
- }
- WinViewUI.uiView = { "type": "Scene", "props": { "width": 720, "visible": true, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "var": "BG", "top": 0, "skin": "WinView/black.png", "sizeGrid": "12,14,12,12", "right": 0, "left": 0, "bottom": 0 }, "compId": 8 }, { "type": "Image", "props": { "y": 520, "x": 360, "width": 720, "skin": "WinView/guoguan-1-1.png", "pivotY": 510, "pivotX": 360, "height": 994 }, "compId": 4, "child": [{ "type": "Image", "props": { "y": 249, "x": 283, "visible": true, "skin": "WinView/guoguan-1-2.png" }, "compId": 5 }] }, { "type": "Button", "props": { "y": 487, "x": 252, "var": "BackBtn", "stateNum": 1, "skin": "WinView/guoguan-1-3.png" }, "compId": 6 }, { "type": "Button", "props": { "y": 600, "x": 228, "var": "NextBtn", "stateNum": 1, "skin": "WinView/guoguan-1-4.png" }, "compId": 7 }], "loadList": ["WinView/black.png", "WinView/guoguan-1-1.png", "WinView/guoguan-1-2.png", "WinView/guoguan-1-3.png", "WinView/guoguan-1-4.png"], "loadList3D": [] };
- ui.WinViewUI = WinViewUI;
- REG("ui.WinViewUI", WinViewUI);
- })(ui || (ui = {}));
- var PropEffecf;
- (function (PropEffecf) {
- PropEffecf[PropEffecf["NONE"] = 0] = "NONE";
- PropEffecf[PropEffecf["DOUBLE"] = 1] = "DOUBLE";
- PropEffecf[PropEffecf["HAMMER"] = 2] = "HAMMER";
- PropEffecf[PropEffecf["UP"] = 3] = "UP";
- PropEffecf[PropEffecf["CLEARLAST"] = 4] = "CLEARLAST";
- PropEffecf[PropEffecf["CLEARTWO"] = 5] = "CLEARTWO";
- })(PropEffecf || (PropEffecf = {}));
- var StageMode;
- (function (StageMode) {
- StageMode[StageMode["ReStart"] = 0] = "ReStart";
- StageMode[StageMode["Start"] = 1] = "Start";
- StageMode[StageMode["Lose"] = 2] = "Lose";
- StageMode[StageMode["Win"] = 3] = "Win";
- StageMode[StageMode["Clone"] = 4] = "Clone";
- StageMode[StageMode["Over"] = 5] = "Over";
- StageMode[StageMode["Revive"] = 6] = "Revive";
- StageMode[StageMode["Refresh"] = 7] = "Refresh";
- StageMode[StageMode["Check"] = 8] = "Check";
- StageMode[StageMode["GetReward"] = 9] = "GetReward";
- })(StageMode || (StageMode = {}));
- class EventManager {
- static EventOn(_mode, caller, fun, args = []) {
- EventManager.Instance.on(PropEffecf[_mode], caller, fun, args);
- }
- static EventOff(_mode, caller, fun, args = []) {
- EventManager.Instance.off(PropEffecf[_mode], caller, fun);
- }
- static EventTrigger(_mode, args = []) {
- EventManager.Instance.event(PropEffecf[_mode], args);
- EventManager.PropState = _mode;
- }
- static StageOn(_mode, caller, fun, args = []) {
- EventManager.Instance.on(StageMode[_mode], caller, fun, args);
- }
- static StageOff(_mode, caller, fun, args = []) {
- EventManager.Instance.off(StageMode[_mode], caller, fun);
- }
- static StageTrigger(_mode, args = []) {
- EventManager.Instance.event(StageMode[_mode], args);
- }
- }
- EventManager.Instance = new Laya.EventDispatcher();
- EventManager.PropState = PropEffecf.NONE;
- class GameManager {
- constructor() {
- this.ReviveNum = 0;
- this.ScoreProgress = 0;
- this.ScoreRecord2 = 0;
- this.ScoreRecord = 0;
- this.First = true;
- this.Wave = 1;
- this.CheckHeight = true;
- this.played = false;
- this.EliminateNum = 0;
- GameManager.ins = this;
- EventManager.StageOn(StageMode.Refresh, this, this.Fresh);
- }
- static get Instance() {
- if (GameManager.ins) {
- return GameManager.ins;
- }
- else {
- return new GameManager();
- }
- }
- Fresh() {
- this.ScoreProgress = 0;
- }
- }
- class MainView extends ui.MainSceneUI {
- constructor() {
- super();
- this.STAGE = 0;
- }
- static get Instance() {
- if (MainView.ins) {
- return MainView.ins;
- }
- else {
- return new MainView();
- }
- }
- Show() {
- let stage = AccountManager.Instance.curplayerData.GainAccount("stage");
- this.STAGE = Number(stage);
- this.StartBtn.clickHandler = Laya.Handler.create(this, this.ClickStart);
- this.RankBtn.clickHandler = Laya.Handler.create(this, this.ClickRank);
- this.SignBtn.clickHandler = Laya.Handler.create(this, this.ClickSign);
- this.LotteryBtn.clickHandler = Laya.Handler.create(this, this.ClickLottery);
- this.SetBtn.clickHandler = Laya.Handler.create(this, this.ClickSet);
- this.height = Laya.stage.height;
- this.BG.height = Laya.stage.height;
- Laya.stage.on(Laya.Event.RESIZE, this, () => {
- this.height = Laya.stage.height;
- this.BG.height = Laya.stage.height;
- });
- }
- ClickStart() {
- var agrs = [{ "t": AccountManager.Instance.ServerTime.toString() }];
- ServerManager.Instance.SendHttp(BlastToMerge.KaiShi, agrs, Laya.Handler.create(this, this.GameStart), null);
- }
- GameStart(_data) {
- GameManager.Instance.play_id = _data.play_id;
- EventManager.StageTrigger(StageMode.Start);
- }
- ClickRank() {
- ViewManager.Instance.ShowView(ViewType.RankView);
- }
- ClickLottery() {
- ViewManager.Instance.ShowView(ViewType.LotteryView);
- }
- ClickSign() {
- ViewManager.Instance.ShowView(ViewType.SignView);
- }
- ClickSet() {
- ViewManager.Instance.ShowView(ViewType.SetView);
- }
- Close() {
- }
- }
- class faafssfafsa {
- constructor(_message, _pos, _size, _fontSize, _color = null) {
- this.fontSize = 30;
- this.message = "";
- this.size = new Laya.Vector2(_size.x, _size.y);
- this.fontSize = _fontSize;
- this.color = _color;
- this.message = _message;
- this.pos = _pos;
- }
- }
- class GameTools {
- constructor() {
- GameTools.ins = this;
- }
- static get Instance() {
- if (GameTools.ins) {
- return GameTools.ins;
- }
- else {
- return new GameTools();
- }
- }
- lerp(form, to, t) {
- if (t <= 0) {
- return form;
- }
- else if (t >= 1) {
- return to;
- }
- var a = t * to + (1 - t) * form;
- return a;
- }
- SetCollider(setNode, CollisionGroup) {
- var numchild = setNode.numChildren;
- for (var i = 0; i < setNode.numChildren; i++) {
- var numchild2 = setNode.getChildAt(i).numChildren;
- if (numchild2 > 1) {
- this.SetCollider(setNode.getChildAt(i), CollisionGroup);
- }
- var physicsCollider = setNode.getChildAt(i).getComponent(Laya.PhysicsCollider);
- if (physicsCollider) {
- physicsCollider.collisionGroup = CollisionGroup;
- }
- }
- }
- static RandomNumber(from, to) {
- if (from >= to) {
- return 0;
- }
- var size = to - from;
- var curNumber = Math.random() * size + from;
- return curNumber;
- }
- static RandomANumber(from, to) {
- if (from >= to) {
- return 0;
- }
- var size = to - from;
- var curNumber = Math.random() * size + from;
- return Math.floor(curNumber);
- }
- static GetMoney(_num, _pos = null, _completeHandle = null) {
- if (_num == 0)
- return;
- var fafaafsfa = new Laya.Box;
- fafaafsfa.width = 400;
- fafaafsfa.height = 100;
- fafaafsfa.pivotX = fafaafsfa.width / 2;
- fafaafsfa.pivotY = fafaafsfa.height / 2;
- if (_pos == null) {
- _pos = new Laya.Vector2(Laya.stage.width / 2, Laya.stage.height / 2);
- }
- fafaafsfa.pos(_pos.x, _pos.y);
- var aafafaffa = new Laya.Image;
- aafafaffa.skin = "game/qiandao_1_7.png";
- aafafaffa.width = 60;
- aafafaffa.height = 60;
- aafafaffa.left = 50;
- aafafaffa.y = 10;
- fafaafsfa.addChild(aafafaffa);
- var faasfafsafs = new Laya.Text;
- faasfafsafs.width = 300;
- faasfafsafs.height = 50;
- faasfafsafs.align = "center";
- faasfafsafs.valign = "middle";
- faasfafsafs.font = "Microsoft YaHei";
- faasfafsafs.fontSize = 40;
- faasfafsafs.color = "#FFFFFF";
- faasfafsafs.bold = true;
- faasfafsafs.font = "Microsoft YaHei";
- faasfafsafs.text = "金币 +" + _num;
- faasfafsafs.x = 60;
- faasfafsafs.y = 10;
- fafaafsfa.addChild(faasfafsafs);
- Laya.stage.addChild(fafaafsfa);
- var faasfsaf = Laya.Tween.to(fafaafsfa, { y: fafaafsfa.y - 200 }, 1500, Laya.Ease.expoInOut, Laya.Handler.create(this, () => {
- faasfsaf.clear();
- fafaafsfa.destroy();
- if (_completeHandle) {
- _completeHandle.run();
- }
- }), 100);
- }
- static TweenText(faafssfafsa, _hight, _completeHandle = null, hide = true, _duration = 500) {
- var afasafsafsfa = new Laya.Text();
- afasafsafsfa.width = faafssfafsa.size.x;
- afasafsafsfa.height = faafssfafsa.size.y;
- afasafsafsfa.align = "center";
- afasafsafsfa.valign = "middle";
- afasafsafsfa.font = "Microsoft YaHei";
- afasafsafsfa.fontSize = faafssfafsa.fontSize;
- afasafsafsfa.pivotX = afasafsafsfa.width / 2;
- afasafsafsfa.pivotY = afasafsafsfa.height / 2;
- afasafsafsfa.color = "#5ad122";
- afasafsafsfa.bold = true;
- afasafsafsfa.stroke = 5;
- afasafsafsfa.strokeColor = "#ffffff";
- if (faafssfafsa.color) {
- faafssfafsa.color = faafssfafsa.color;
- }
- afasafsafsfa.text = faafssfafsa.message;
- afasafsafsfa.zOrder = 1;
- Laya.stage.addChildAt(afasafsafsfa, Laya.stage.numChildren - 1);
- afasafsafsfa.pos(faafssfafsa.pos.x, faafssfafsa.pos.y);
- var tween = Laya.Tween.to(afasafsafsfa, { y: afasafsafsfa.y - _hight, update: new Laya.Handler(this, function () {
- }) }, _duration, Laya.Ease.expoInOut, Laya.Handler.create(this, function () {
- tween.clear();
- if (hide) {
- afasafsafsfa.destroy();
- }
- if (_completeHandle) {
- _completeHandle.run();
- }
- }));
- if (hide) {
- Laya.Tween.to(afasafsafsfa, { alpha: 0.4 }, 500);
- }
- return afasafsafsfa;
- }
- static StationTweenText(faafssfafsa, _hight, _completeHandle = null, hide = true, _duration = 500) {
- var afasafsafsfa = new Laya.Text();
- afasafsafsfa.width = faafssfafsa.size.x;
- afasafsafsfa.height = faafssfafsa.size.y;
- afasafsafsfa.align = "center";
- afasafsafsfa.valign = "middle";
- afasafsafsfa.font = "Microsoft YaHei";
- afasafsafsfa.fontSize = 50;
- afasafsafsfa.pivotX = afasafsafsfa.width / 2;
- afasafsafsfa.pivotY = afasafsafsfa.height / 2;
- afasafsafsfa.color = "#5ad122";
- afasafsafsfa.bold = true;
- afasafsafsfa.stroke = 5;
- afasafsafsfa.strokeColor = "#ffffff";
- if (faafssfafsa.color) {
- faafssfafsa.color = faafssfafsa.color;
- }
- afasafsafsfa.text = faafssfafsa.message;
- afasafsafsfa.zOrder = 1;
- Laya.stage.addChildAt(afasafsafsfa, Laya.stage.numChildren - 1);
- afasafsafsfa.pos(faafssfafsa.pos.x, faafssfafsa.pos.y);
- var tween = Laya.Tween.to(afasafsafsfa, { y: afasafsafsfa.y - _hight, update: new Laya.Handler(this, function () {
- }) }, _duration, Laya.Ease.expoInOut, Laya.Handler.create(this, function () {
- tween.clear();
- if (hide) {
- afasafsafsfa.destroy();
- }
- if (_completeHandle) {
- _completeHandle.run();
- }
- }));
- if (hide) {
- Laya.Tween.to(afasafsafsfa, { alpha: 0.4 }, 10000);
- }
- return afasafsafsfa;
- }
- static tweenMove(transform, targPos, delay, ease, complete) {
- let curPos = transform.position.clone();
- return Laya.Tween.to(curPos, {
- x: targPos.x,
- y: targPos.y,
- z: targPos.z,
- update: new Laya.Handler(this, () => {
- transform.position = curPos.clone();
- })
- }, delay, ease, complete);
- }
- static tweenRotate(transform, targEuler, delay, ease, complete) {
- let curEuler = transform.rotationEuler.clone();
- return Laya.Tween.to(curEuler, {
- x: targEuler.x,
- y: targEuler.y,
- z: targEuler.z,
- update: new Laya.Handler(this, () => {
- transform.rotationEuler = curEuler.clone();
- })
- }, delay, ease, complete);
- }
- }
- var MusicType;
- (function (MusicType) {
- MusicType[MusicType["clear"] = 0] = "clear";
- MusicType[MusicType["down"] = 1] = "down";
- })(MusicType || (MusicType = {}));
- class AudioManager {
- constructor() { }
- static musicres(_type) {
- return "Game/res/Music/" + MusicType[_type] + ".wav";
- }
- static playMusic(_type) {
- if (!this.open)
- return;
- Laya.SoundManager.playSound(this.musicres(_type));
- }
- static StopMusic() {
- Laya.SoundManager.stopMusic();
- }
- }
- AudioManager.open = true;
- class GamePool {
- constructor() {
- this.maxAcount = 30;
- this.modelpool = {};
- GamePool.ins = this;
- }
- static get Instance() {
- if (GamePool.ins) {
- return GamePool.ins;
- }
- else {
- return new GamePool();
- }
- }
- GetModel(title) {
- let poolname = title;
- if (this.modelpool[poolname] != null && this.modelpool[poolname] != undefined) {
- if (this.modelpool[poolname].length > 0) {
- let model1 = this.modelpool[poolname].shift();
- if (!model1.active) {
- model1.active = true;
- }
- return model1;
- }
- else {
- let model = new Laya.Image();
- model.name = title;
- return model;
- }
- }
- else {
- let model = new Laya.Image();
- model.name = title;
- return model;
- }
- }
- RecoverModel(_image, title = "", modelstate = false) {
- if (_image.destroyed) {
- return;
- }
- if (!modelstate && _image.active == false) {
- return;
- }
- let poolname = title;
- if (this.modelpool[poolname] != null && this.modelpool[poolname] != undefined) {
- let modelnum = this.modelpool[poolname];
- this.modelpool[poolname].push(_image);
- }
- else {
- let modelnum = [];
- modelnum.push(_image);
- this.modelpool[poolname] = modelnum;
- }
- _image.removeSelf();
- _image.active = false;
- }
- }
- class DropRule {
- constructor() {
- this.EffectName = new Array("blue", "yellow", "purple", "green");
- this.EffectArray = [];
- this.PrefabName = new Array("2", "4", "8", "16", "32", "64", "128", "256", "512", "1024", "2048", "4096", "8192", "16384", "32768", "65536", "131072", "262144");
- this.Cloned = false;
- DropRule.ins = this;
- this.Init();
- this.InitEffect();
- EventManager.StageOn(StageMode.Refresh, this, this.Init);
- }
- static get Instance() {
- if (DropRule.ins) {
- return DropRule.ins;
- }
- else {
- return new DropRule();
- }
- }
- Init(_data) {
- this.STAGE = Number(AccountManager.Instance.curplayerData.GainAccount("stage"));
- let level = AccountManager.Instance.curplayerData.GainCollocation("level");
- if (_data) {
- for (var key in level) {
- if (level[key].id == this.STAGE) {
- let Level = level[Number(key)];
- this.DropHeight = Number(Level.hight);
- this.GoalScore = Number(Level.goal);
- this.BallNum = Level.edge.split(";");
- this.StartNum = Number(Level.start_number);
- this.DropNum = Level.drop_number.split(";");
- let min = Number(this.BallNum[0]);
- let minnext = Number(this.BallNum[1]);
- this.MinBall = Number(this.PrefabName[min - 1]);
- this.MinNextBall = Number(this.PrefabName[minnext - 1]);
- }
- }
- }
- else {
- for (var key in level) {
- if (level[key].id == this.STAGE) {
- let Level = level[Number(key)];
- this.DropHeight = Number(Level.hight);
- this.GoalScore = Number(Level.goal);
- this.SizeIndex = Level.index.split(";");
- console.log(this.SizeIndex);
- this.BallNum = Level.edge.split(";");
- this.StartNum = Number(Level.start_number);
- this.DropNum = Level.drop_number.split(";");
- this.EdgeIndex = Level.edgeindex.split(";");
- let min = Number(this.BallNum[0]);
- let minnext = Number(this.BallNum[this.BallNum.length - 1]);
- this.MinBall = Number(this.PrefabName[min - 1]);
- this.MinNextBall = Number(this.PrefabName[minnext - 1]);
- }
- }
- }
- this.Read();
- }
- InitEffect() {
- for (let i = 0; i < this.EffectName.length; i++) {
- this.ReadJson(i);
- }
- }
- ReadJson(i) {
- Laya.loader.create("Effect/" + this.EffectName[i] + ".json", Laya.Handler.create(this, this.creat));
- }
- creat(Prefab) {
- let obj = new Laya.Prefab();
- obj.json = Prefab;
- this.EffectArray.push(obj);
- }
- CreateEffect(_score, _pos) {
- let effect;
- let index;
- if (_score == 2 || _score == 16 || _score == 256 || _score == 2048 || _score == 32768 || _score == 262144) {
- effect = this.EffectArray[3];
- index = 3;
- }
- else if (_score == 8 || _score == 32 || _score == 4096 || _score == 131072) {
- effect = this.EffectArray[1];
- index = 1;
- }
- else if (_score == 64 || _score == 512 || _score == 16384) {
- effect = this.EffectArray[2];
- index = 2;
- }
- else if (_score == 4 || _score == 128 || _score == 1024 || _score == 8192 || _score == 65536) {
- effect = this.EffectArray[0];
- index = 0;
- }
- let pre = Laya.Pool.getItemByCreateFun(this.EffectName[index], effect.create, effect);
- pre.pos(_pos.x, _pos.y);
- Laya.stage.addChild(pre);
- pre.on(Laya.Event.COMPLETE, this, () => {
- pre.removeSelf();
- pre.destroy();
- });
- }
- GetBallIndex(_score) {
- let num;
- for (let i = 0; i < this.PrefabName.length; i++) {
- if (_score == Number(this.PrefabName[i])) {
- num = i;
- }
- else if (_score > Number(this.PrefabName[i]) && _score < Number(this.PrefabName[i + 1])) {
- num = i;
- }
- }
- return num;
- }
- GetScore(_score) {
- let num;
- for (let i = 0; i < this.PrefabName.length; i++) {
- if (_score == Number(this.PrefabName[i])) {
- num = Number(this.PrefabName[i]);
- }
- else if (_score > Number(this.PrefabName[i]) && _score < Number(this.PrefabName[i + 1])) {
- num = Number(this.PrefabName[i]);
- }
- }
- return num;
- }
- GetBallSize(_score) {
- let num;
- let index;
- let size = 0;
- for (let i = 0; i < this.PrefabName.length; i++) {
- if (_score == Number(this.PrefabName[i])) {
- num = i;
- }
- else if (_score > Number(this.PrefabName[i]) && _score < Number(this.PrefabName[i + 1])) {
- num = i;
- }
- }
- for (let j = 0; j < this.EdgeIndex.length; j++) {
- if (num + 1 == Number(this.EdgeIndex[j])) {
- index = Number(this.SizeIndex[j]);
- size = this.Size(num + 1, index);
- }
- }
- if (size == 0) {
- let cimi = Number(this.EdgeIndex[this.EdgeIndex.length - 1]);
- index = Number(this.SizeIndex[this.EdgeIndex.length - 1]);
- size = this.Size(cimi, index);
- let n = (num + 1) - cimi;
- size = size + (n * 5);
- }
- return size;
- }
- Size(_index, sizelevel) {
- let ballsize;
- let ball = AccountManager.Instance.curplayerData.GainCollocation("ball");
- for (var key in ball) {
- let item = ball[key];
- if (_index == item.ball && sizelevel == item.size_level) {
- ballsize = Number(item.size);
- }
- }
- return ballsize;
- }
- CreatBall(_index, size, pos) {
- let ball = GamePool.Instance.GetModel("img" + _index.toString());
- ball.skin = "Game/res/Ball/blast" + _index + ".png";
- ball.anchorX = 0.5;
- ball.anchorY = 0.5;
- ball.height = size;
- ball.width = size;
- let _rig = ball.getComponent(Laya.RigidBody);
- if (!_rig) {
- let rig = ball.addComponent(Laya.RigidBody);
- rig.allowRotation = true;
- rig.gravityScale = 3;
- }
- else {
- _rig.enabled = true;
- }
- let _collider = ball.getComponent(Laya.CircleCollider);
- if (!_collider) {
- let collider = ball.addComponent(Laya.CircleCollider);
- collider.restitution = AccountManager.Instance.curplayerData.Restitution;
- if (this.STAGE == 1 && GameManager.Instance.Wave < 3) {
- collider.restitution = 0;
- }
- collider.radius = size / 2;
- }
- else {
- _collider.enabled = true;
- _collider.isSensor = false;
- }
- let _num = ball.getChildByName("num");
- let zi;
- if (!_num) {
- let num = new Laya.FontClip();
- num.name = "num";
- num.skin = "Game/res/Ball/44.png";
- num.anchorX = 0.5;
- num.anchorY = 0.5;
- num.sheet = "0123456789";
- zi = this.PrefabName[_index];
- num.value = zi;
- ball.addChild(num);
- num.centerX = 0;
- num.centerY = 0;
- }
- let _light = ball.getChildByName("light");
- if (!_light) {
- let light = new Laya.Image();
- light.skin = "Game/res/Ball/" + zi + ".png";
- light.anchorX = 0.5;
- light.anchorY = 0.5;
- light.width = this.LightSize(size);
- light.height = this.LightSize(size);
- light.name = "light";
- ball.addChild(light);
- light.centerX = 0;
- light.centerY = 0;
- }
- else {
- _light.anchorX = 0.5;
- _light.anchorY = 0.5;
- _light.width = this.LightSize(size);
- _light.height = this.LightSize(size);
- _light.centerX = 0;
- _light.centerY = 0;
- }
- let _script = ball.getComponent(Ball);
- if (!_script) {
- let script = ball.addComponent(Ball);
- }
- ball.pos(pos.x, pos.y);
- Laya.timer.once(1, this, () => {
- EventManager.StageTrigger(StageMode.Clone, [ball]);
- });
- this.Cloned = true;
- AudioManager.playMusic(MusicType.down);
- }
- CreatBall2(_index, size, pos) {
- let ball = GamePool.Instance.GetModel("img" + _index.toString());
- ball.skin = "Game/res/Ball/blast" + _index + ".png";
- ball.anchorX = 0.5;
- ball.anchorY = 0.5;
- ball.height = size;
- ball.width = size;
- let _collider = ball.getComponent(Laya.CircleCollider);
- if (!_collider) {
- let collider = ball.addComponent(Laya.CircleCollider);
- collider.restitution = AccountManager.Instance.curplayerData.Restitution;
- if (this.STAGE == 1 && GameManager.Instance.Wave < 3) {
- collider.restitution = 0;
- }
- collider.radius = size / 2;
- }
- else {
- ball.getComponent(Laya.CircleCollider).enabled = true;
- ball.getComponent(Laya.CircleCollider).isSensor = true;
- }
- let _rig = ball.getComponent(Laya.RigidBody);
- if (!_rig) {
- let rig = ball.addComponent(Laya.RigidBody);
- rig.allowRotation = true;
- rig.gravityScale = 3;
- }
- else {
- ball.getComponent(Laya.RigidBody).enabled = true;
- }
- let _num = ball.getChildByName("num");
- let zi;
- if (!_num) {
- let num = new Laya.FontClip();
- num.name = "num";
- num.skin = "Game/res/Ball/44.png";
- num.anchorX = 0.5;
- num.anchorY = 0.5;
- num.sheet = "0123456789";
- zi = this.PrefabName[_index];
- num.value = zi;
- ball.addChild(num);
- num.centerX = 0;
- num.centerY = 0;
- }
- let _light = ball.getChildByName("light");
- if (!_light) {
- let light = new Laya.Image();
- light.skin = "Game/res/Ball/" + zi + ".png";
- light.anchorX = 0.5;
- light.anchorY = 0.5;
- light.width = this.LightSize(size);
- light.height = this.LightSize(size);
- light.name = "light";
- ball.addChild(light);
- light.centerX = 0;
- light.centerY = 0;
- }
- else {
- _light.anchorX = 0.5;
- _light.anchorY = 0.5;
- _light.width = this.LightSize(size);
- _light.height = this.LightSize(size);
- _light.centerX = 0;
- _light.centerY = 0;
- }
- let _script = ball.getComponent(Ball);
- if (!_script) {
- let script = ball.addComponent(Ball);
- }
- ball.pos(pos.x, pos.y);
- Laya.timer.once(1, this, () => {
- EventManager.StageTrigger(StageMode.Clone, [ball]);
- });
- AudioManager.playMusic(MusicType.down);
- }
- SetPosition(_node, _pos) {
- _node.pos(_pos.x, _pos.y);
- }
- LightSize(_size) {
- let num;
- switch (_size) {
- case 65:
- num = 79;
- break;
- case 70:
- num = 87;
- break;
- case 75:
- num = 95;
- break;
- case 80:
- num = 100;
- break;
- case 85:
- num = 105;
- break;
- case 90:
- num = 110;
- break;
- case 95:
- num = 117;
- break;
- case 100:
- num = 124;
- break;
- case 105:
- num = 130;
- break;
- case 110:
- num = 136;
- break;
- case 115:
- num = 143;
- break;
- case 120:
- num = 150;
- break;
- case 125:
- num = 152;
- break;
- case 130:
- num = 160;
- break;
- case 135:
- num = 165;
- break;
- case 140:
- num = 174;
- break;
- case 145:
- num = 181;
- break;
- case 150:
- num = 186;
- break;
- case 155:
- num = 192;
- break;
- case 160:
- num = 199;
- break;
- case 165:
- num = 202;
- break;
- case 170:
- num = 210;
- break;
- case 175:
- num = 215;
- break;
- case 180:
- num = 223;
- break;
- case 185:
- num = 231;
- break;
- case 190:
- num = 236;
- break;
- case 195:
- num = 241;
- break;
- case 200:
- num = 247;
- break;
- case 205:
- num = 253;
- break;
- case 210:
- num = 260;
- break;
- case 215:
- num = 268;
- break;
- case 220:
- num = 275;
- break;
- case 225:
- num = 280;
- break;
- case 230:
- num = 287;
- break;
- }
- return num;
- }
- FallDown(_time) {
- if (!_time) {
- let mindrop = Number(this.DropNum[0]);
- let maxdrop = Number(this.DropNum[1]);
- _time = GameTools.RandomANumber(mindrop, maxdrop + 1);
- }
- let min = Number(this.BallNum[0]);
- let max = Number(this.BallNum[this.BallNum.length - 1]);
- let index;
- let size;
- for (let j = 0; j < _time; j++) {
- let num = GameTools.RandomANumber(min, max + 1);
- for (let i = 0; i < this.BallNum.length; i++) {
- if (num == Number(this.BallNum[i])) {
- index = Number(this.SizeIndex[i]);
- size = this.Size(num, index);
- }
- }
- let X = GameTools.RandomANumber(100, 500);
- let pos = new Laya.Vector2(X, 30);
- this.CreatBall2(num - 1, size, pos);
- }
- }
- GuideFallDown() {
- GameManager.Instance.CheckHeight = false;
- let num;
- let shuliang;
- if (GameManager.Instance.Wave == 1) {
- shuliang = 2;
- num = 1;
- }
- else if (GameManager.Instance.Wave == 2) {
- shuliang = 2;
- num = 2;
- }
- else if (GameManager.Instance.Wave == 3) {
- shuliang = 6;
- num = 1;
- }
- else if (GameManager.Instance.Wave == 4) {
- shuliang = 12;
- num = 1;
- }
- else if (GameManager.Instance.Wave == 5) {
- shuliang = 6;
- num = 2;
- }
- else if (GameManager.Instance.Wave == 6) {
- shuliang = 12;
- num = 2;
- }
- else {
- GameManager.Instance.CheckHeight = true;
- this.DropHeight = AccountManager.Instance.curplayerData.GuideHeight;
- let mindrop = Number(this.DropNum[0]);
- let maxdrop = Number(this.DropNum[1]);
- num = GameTools.RandomANumber(mindrop, maxdrop + 1);
- }
- let score = Number(this.PrefabName[num - 1]);
- let index = this.GetBallIndex(score);
- let size = this.GetBallSize(score);
- for (let j = 0; j < shuliang; j++) {
- let X = GameTools.RandomANumber(100, 500);
- let pos = new Laya.Vector2(X, 30);
- this.CreatBall2(num - 1, size, pos);
- }
- }
- RecoverScene() {
- for (let i = 0; i < this.progress.length - 3; i++) {
- let item = this.progress[i];
- this.CreatBall2(Number(item.index) - 1, Number(item.size), new Laya.Vector2(Number(item.pos.x), Number(item.pos.y)));
- }
- }
- Read() {
- if (this.STAGE > 1) {
- var args = [{ "stage": "0" }];
- ServerManager.Instance.SendHttp(BlastToMerge.GetProgress, args, Laya.Handler.create(this, (res) => {
- let json = JSON.parse(res.user_game.detail);
- this.progress = json;
- if (this.progress.length > 1) {
- let items = this.progress[this.progress.length - 2];
- let _score = Number(items.jindu);
- GameManager.Instance.ScoreProgress = _score;
- this.SizeIndex = this.progress[this.progress.length - 1].sizeindex;
- this.EdgeIndex = this.progress[this.progress.length - 3].edgeindex;
- }
- console.log("获取进度成功");
- }), Laya.Handler.create(this, () => {
- console.log("获取进度失败");
- }));
- }
- }
- }
- var Vector2 = Laya.Vector2;
- class Ball extends Laya.Script {
- constructor() {
- super();
- this.moved = false;
- this.mark = false;
- this.clear = false;
- this.score = 0;
- Ball.ins = this;
- }
- static get Instance() {
- if (Ball.ins) {
- return Ball.ins;
- }
- else {
- return new Ball();
- }
- }
- onAwake() {
- this.Light = this.owner.getChildByName("light");
- this.Light.visible = false;
- this.owner.on(Laya.Event.CLICK, this, this.ClickBall);
- EventManager.EventOn(PropEffecf.DOUBLE, this, this.ClickDouble);
- EventManager.EventOn(PropEffecf.NONE, this, this.ClickNone);
- EventManager.EventOn(PropEffecf.HAMMER, this, this.ClickHammer);
- let score = this.owner.getChildByName("num");
- this.score = Number(score.value);
- }
- onEnable() {
- this.moved = false;
- this.mark = false;
- this.clear = false;
- this.owner.on(Laya.Event.CLICK, this, this.ClickBall);
- EventManager.EventOn(PropEffecf.DOUBLE, this, this.ClickDouble);
- EventManager.EventOn(PropEffecf.NONE, this, this.ClickNone);
- EventManager.EventOn(PropEffecf.HAMMER, this, this.ClickHammer);
- let score = this.owner.getChildByName("num");
- this.score = Number(score.value);
- }
- onUpdate() {
- this.CheckLight();
- if (this.mark) {
- if (!this.moved) {
- let owner = this.owner;
- let _rig = this.owner.getComponent(Laya.RigidBody);
- let _collider = this.owner.getComponent(Laya.CircleCollider);
- _collider.isSensor = true;
- _collider.enabled = false;
- _rig.enabled = false;
- _collider.destroy();
- _rig.destroy();
- this.Move(GameManager.Instance.TargetPosition);
- this.moved = true;
- }
- }
- }
- CheckLight() {
- let light = false;
- let _node = this.owner;
- for (let i = 0; i < InGameView.Instance.prefabbox.numChildren; i++) {
- let other = InGameView.Instance.prefabbox.getChildAt(i);
- let ball = other.getComponent(Ball);
- if (other.x == _node.x && other.y == _node.y) {
- continue;
- }
- let distan = Laya.Vector3.distance(new Laya.Vector3(other.x, other.y, 0), new Laya.Vector3(_node.x, _node.y, 0));
- let dis = _node.width / 2 + other.width / 2;
- if (Math.abs(distan - dis) <= AccountManager.Instance.curplayerData.Distance || Math.abs(distan - dis) <= AccountManager.Instance.curplayerData.Distance || distan < dis) {
- if (ball.score == this.score) {
- light = true;
- }
- }
- }
- if (light) {
- this.Light.visible = true;
- }
- else {
- this.Light.visible = false;
- }
- }
- ClickNone() {
- this.owner.off(Laya.Event.CLICK, this, this.Hammer);
- this.owner.off(Laya.Event.CLICK, this, this.Double);
- this.owner.on(Laya.Event.CLICK, this, this.ClickBall);
- }
- ClickDouble() {
- this.owner.off(Laya.Event.CLICK, this, this.ClickBall);
- this.owner.off(Laya.Event.CLICK, this, this.Hammer);
- this.owner.on(Laya.Event.CLICK, this, this.Double);
- }
- Double() {
- var args = [{ "t": AccountManager.Instance.ServerTime.toString() }, { "play_id": GameManager.Instance.play_id }, { "fid": "1" }];
- ServerManager.Instance.SendHttp(BlastToMerge.Use, args, Laya.Handler.create(this, () => {
- let num = this.score * 2;
- let owner = this.owner;
- let _position = new Laya.Vector2(owner.x, owner.y);
- let _rig = this.owner.getComponent(Laya.RigidBody);
- let _collider = this.owner.getComponent(Laya.CircleCollider);
- _collider.enabled = false;
- _rig.enabled = false;
- _collider.destroy();
- _rig.destroy();
- this.owner.removeSelf();
- let _index = DropRule.Instance.GetBallIndex(this.score).toString();
- GamePool.Instance.RecoverModel(owner, "img" + _index);
- let id = DropRule.Instance.GetBallIndex(num);
- let size = DropRule.Instance.GetBallSize(num);
- GameManager.Instance.ScoreProgress += num;
- DropRule.Instance.CreatBall(id, size, _position);
- InGameView.Instance.SkillNumRefresh();
- EventManager.EventTrigger(PropEffecf.NONE);
- }), Laya.Handler.create(this, () => {
- console.log("道具使用失败");
- }));
- }
- ClickHammer() {
- this.owner.off(Laya.Event.CLICK, this, this.ClickBall);
- this.owner.off(Laya.Event.CLICK, this, this.Double);
- this.owner.on(Laya.Event.CLICK, this, this.Hammer);
- }
- Hammer() {
- var args = [{ "t": AccountManager.Instance.ServerTime.toString() }, { "play_id": GameManager.Instance.play_id }, { "fid": "4" }];
- ServerManager.Instance.SendHttp(BlastToMerge.Use, args, Laya.Handler.create(this, () => {
- let num = this.score;
- let owner = this.owner;
- GameManager.Instance.ScoreProgress += num;
- let _rig = this.owner.getComponent(Laya.RigidBody);
- let _collider = this.owner.getComponent(Laya.CircleCollider);
- _collider.enabled = false;
- _rig.enabled = false;
- _collider.destroy();
- _rig.destroy();
- owner.removeSelf();
- let _index = DropRule.Instance.GetBallIndex(this.score).toString();
- GamePool.Instance.RecoverModel(owner, "img" + _index);
- InGameView.Instance.SkillNumRefresh();
- EventManager.EventTrigger(PropEffecf.NONE);
- InGameView.Instance.EffectMode(false);
- }), Laya.Handler.create(this, () => {
- console.log("道具使用失败");
- }));
- }
- onDestroy() {
- this.owner.offAll();
- EventManager.EventOff(PropEffecf.DOUBLE, this, this.ClickDouble);
- EventManager.EventOff(PropEffecf.NONE, this, this.ClickNone);
- EventManager.EventOff(PropEffecf.HAMMER, this, this.ClickHammer);
- }
- onTriggerEnter(other) {
- let targetparent = other.owner;
- if (DropRule.Instance.STAGE == 1 && GameManager.Instance.Wave < 3) {
- if (targetparent.name == "BottomCollider" && this.Light.visible == true) {
- if (!InGameView.Instance.guide.isPlaying && !GameManager.Instance.played) {
- InGameView.Instance.guide.play(null, false);
- GameManager.Instance.played = true;
- }
- InGameView.Instance.Guide.visible = true;
- }
- }
- }
- Move(_position) {
- if (!this.moved) {
- let owner = this.owner;
- GameManager.Instance.EliminateNum += 1;
- let ball = owner.getComponent(Ball);
- let ownerscore = ball.score;
- GameManager.Instance.ScoreRecord += ownerscore;
- GameManager.Instance.ScoreRecord2 = GameManager.Instance.ScoreRecord;
- let move = Laya.Tween.to(this.owner, {
- x: _position.x, y: _position.y, update: new Laya.Handler(this, function () {
- })
- }, AccountManager.Instance.curplayerData.MergeSpeed * 1000, Laya.Ease.linearInOut, Laya.Handler.create(this, () => {
- move.clear();
- this.owner.removeSelf();
- let _index = DropRule.Instance.GetBallIndex(this.score).toString();
- GamePool.Instance.RecoverModel(owner, "img" + _index);
- if (!DropRule.Instance.Cloned) {
- let num = DropRule.Instance.GetBallIndex(GameManager.Instance.ScoreRecord2);
- let size = DropRule.Instance.GetBallSize(GameManager.Instance.ScoreRecord2);
- let score = DropRule.Instance.GetScore(GameManager.Instance.ScoreRecord2);
- let ball = DropRule.Instance.CreatBall(num, size, GameManager.Instance.TargetPosition);
- GameManager.Instance.ScoreProgress += score;
- if (GameManager.Instance.EliminateNum >= AccountManager.Instance.curplayerData.ShakeNum) {
- WXSDK.Shake();
- }
- if (DropRule.Instance.STAGE > 1 && !InGameView.Instance.OverRun) {
- DropRule.Instance.FallDown();
- }
- GameManager.Instance.EliminateNum = 0;
- GameManager.Instance.ScoreRecord = 0;
- GameManager.Instance.played = false;
- GameManager.Instance.Wave += 1;
- AudioManager.playMusic(MusicType.clear);
- if (DropRule.Instance.STAGE == 1) {
- if (InGameView.Instance.Guide.visible == true) {
- InGameView.Instance.Guide.visible = false;
- }
- DropRule.Instance.GuideFallDown();
- }
- EventManager.StageTrigger(StageMode.Check);
- }
- }));
- }
- }
- ClickBall() {
- let owner = this.owner;
- DropRule.Instance.Cloned = false;
- GameManager.Instance.TargetPosition = new Vector2(owner.x, owner.y);
- this.MouseClick(owner);
- }
- MouseClick(_node) {
- let _nodeball = _node.getComponent(Ball);
- for (let i = 0; i < InGameView.Instance.prefabbox.numChildren; i++) {
- let other = InGameView.Instance.prefabbox.getChildAt(i);
- let ball = other.getComponent(Ball);
- if (other.x == _node.x && other.y == _node.y) {
- continue;
- }
- if (ball.mark) {
- continue;
- }
- let distan = Laya.Vector3.distance(new Laya.Vector3(other.x, other.y, 0), new Laya.Vector3(_node.x, _node.y, 0));
- let dis = _node.width / 2 + other.width / 2;
- if (Math.abs(distan - dis) <= AccountManager.Instance.curplayerData.Distance || Math.abs(distan - dis) <= AccountManager.Instance.curplayerData.Distance || distan < dis) {
- if (ball.score == _nodeball.score) {
- ball.mark = true;
- this.MouseClick(other);
- }
- }
- }
- }
- }
- class InGameView extends ui.InGameSceneUI {
- constructor() {
- super();
- this.LoseView = false;
- this.WinView = false;
- this.OverRun = false;
- InGameView.ins = this;
- EventManager.StageOn(StageMode.Clone, this, this.AddPrefab);
- EventManager.StageOn(StageMode.Win, this, this.Win);
- EventManager.StageOn(StageMode.Lose, this, this.Lose);
- EventManager.StageOn(StageMode.ReStart, this, this.ReStart);
- EventManager.StageOn(StageMode.Over, this, this.Over);
- EventManager.StageOn(StageMode.Revive, this, this.Revive);
- EventManager.StageOn(StageMode.Check, this, this.Check);
- }
- static get Instance() {
- if (InGameView.ins) {
- return InGameView.ins;
- }
- else {
- return new InGameView();
- }
- }
- Show() {
- let stage = AccountManager.Instance.curplayerData.GainAccount("stage");
- this.STAGE = Number(stage);
- Laya.timer.loop(AccountManager.Instance.curplayerData.Save * 1000, this, this.Save);
- Laya.timer.once(200, this, this.SkillRefresh);
- Laya.timer.frameLoop(2, this, this.CheckHeight);
- Laya.timer.frameLoop(1, this, this.Progress);
- Laya.timer.once(AccountManager.Instance.curplayerData.CheckLose * 1000, this, this.CheckLose);
- Laya.timer.frameLoop(500, this, this.SkillAnimation);
- this.ScoreRefresh();
- this.SkillNumRefresh();
- this.arrowbtn.clickHandler = new Laya.Handler(this, this.ClickArrow);
- this.zhunxin1btn.clickHandler = new Laya.Handler(this, this.ClickZhunXin1);
- this.zhunxin2btn.clickHandler = new Laya.Handler(this, this.ClickZhunXin2);
- this.doublebtn.clickHandler = new Laya.Handler(this, this.ClickDouble);
- this.hammerbtn.clickHandler = new Laya.Handler(this, this.ClickHammer);
- this.height = Laya.stage.height;
- this.BG.height = Laya.stage.height;
- Laya.stage.on(Laya.Event.RESIZE, this, () => {
- this.height = Laya.stage.height;
- this.BG.height = Laya.stage.height;
- });
- }
- Check() {
- Laya.timer.clear(this, this.CheckLose);
- Laya.timer.once(AccountManager.Instance.curplayerData.CheckLose * 1000, this, this.CheckLose);
- }
- AddPrefab(ball) {
- this.prefabbox.addChild(ball);
- }
- CheckHeight() {
- if (GameManager.Instance.CheckHeight) {
- let down = false;
- this.OverRun = false;
- for (let i = 0; i < this.prefabbox.numChildren; i++) {
- let child = this.prefabbox.getChildAt(i);
- if (child.y < DropRule.Instance.DropHeight) {
- down = true;
- }
- if (child.y < AccountManager.Instance.curplayerData.OverRun) {
- this.OverRun = true;
- }
- }
- if (!down) {
- DropRule.Instance.FallDown();
- }
- }
- }
- CheckLose() {
- if (!this.LoseView) {
- let lose = true;
- for (let i = 0; i < this.prefabbox.numChildren; i++) {
- let ball = this.prefabbox.getChildAt(i);
- let light = ball.getChildByName("light");
- if (light.visible) {
- lose = false;
- }
- }
- if (lose) {
- this.LoseView = true;
- Laya.timer.clear(this, this.Save);
- this.Save(true);
- EventManager.StageTrigger(StageMode.Lose);
- }
- }
- }
- ScoreRefresh() {
- let score = DropRule.Instance.GoalScore;
- this.NowLv.value = DropRule.Instance.STAGE.toString();
- this.NextLv.value = (DropRule.Instance.STAGE + 1).toString();
- this.NowScore.text = GameManager.Instance.ScoreProgress.toString();
- this.RequireScore.text = score.toString();
- }
- SkillNumRefresh() {
- this.Func1num.text = AccountManager.Instance.curplayerData.GetPropNum(1).toString();
- this.Func2num.text = AccountManager.Instance.curplayerData.GetPropNum(2).toString();
- this.Func3num.text = AccountManager.Instance.curplayerData.GetPropNum(3).toString();
- this.Func4num.text = AccountManager.Instance.curplayerData.GetPropNum(4).toString();
- this.Func5num.text = AccountManager.Instance.curplayerData.GetPropNum(5).toString();
- }
- SkillRefresh() {
- this.ani1.play(null, false);
- this.ani2.play(null, false);
- this.ani3.play(null, false);
- this.ani4.play(null, false);
- this.ani5.play(null, false);
- }
- SkillAnimation() {
- let random = GameTools.RandomANumber(1, 6);
- switch (random) {
- case 1:
- this.ani1.play(null, false);
- break;
- case 2:
- this.ani2.play(null, false);
- break;
- case 3:
- this.ani3.play(null, false);
- break;
- case 4:
- this.ani4.play(null, false);
- break;
- case 5:
- this.ani5.play(null, false);
- break;
- }
- }
- get Ratio() {
- let score = DropRule.Instance.GoalScore;
- let value = GameManager.Instance.ScoreProgress / score;
- return value;
- }
- Progress() {
- if (!this.WinView) {
- this.LevelProgress.value = this.Ratio;
- if (GameManager.Instance.ScoreProgress >= Number(this.RequireScore.text)) {
- GameManager.Instance.ScoreProgress = Number(this.RequireScore.text);
- this.NowScore.text = GameManager.Instance.ScoreProgress.toString();
- Laya.timer.clear(this, this.Save);
- Laya.timer.clear(this, this.CheckLose);
- this.Save(true);
- EventManager.StageTrigger(StageMode.Win);
- this.WinView = true;
- }
- this.NowScore.text = GameManager.Instance.ScoreProgress.toString();
- }
- }
- ClickArrow() {
- console.log("点到了推球道具--");
- if (Number(this.Func5num.text) > 0) {
- var args = [{ "t": AccountManager.Instance.ServerTime.toString() }, { "play_id": GameManager.Instance.play_id }, { "fid": "5" }];
- ServerManager.Instance.SendHttp(BlastToMerge.Use, args, Laya.Handler.create(this, () => {
- for (let i = 0; i < this.prefabbox.numChildren; i++) {
- let ball = this.prefabbox.getChildAt(i);
- if (ball.destroyed) {
- continue;
- }
- else {
- let _rig = ball.getComponent(Laya.RigidBody);
- _rig.applyLinearImpulseToCenter({ x: 0, y: -1000 });
- }
- }
- this.SkillNumRefresh();
- }), Laya.Handler.create(this, () => {
- }));
- }
- }
- ClickDouble() {
- if (EventManager.PropState == PropEffecf.DOUBLE) {
- EventManager.EventTrigger(PropEffecf.NONE);
- console.log("切换为普通模式");
- return;
- }
- if (EventManager.PropState != PropEffecf.NONE) {
- this.EffectMode(false);
- return;
- }
- if (Number(this.Func1num.text) > 0) {
- EventManager.EventTrigger(PropEffecf.DOUBLE);
- console.log("切换为双倍模式");
- }
- }
- ClickZhunXin1() {
- console.log("点到了准心1道具--");
- if (Number(this.Func2num.text) > 0) {
- if (EventManager.PropState == PropEffecf.NONE) {
- this.EffectMode(true, PropEffecf.CLEARLAST);
- }
- else {
- this.EffectMode(false);
- }
- }
- }
- ClickZhunXin2() {
- console.log("点到了准心2道具--");
- if (Number(this.Func3num.text) > 0) {
- if (EventManager.PropState == PropEffecf.NONE) {
- this.EffectMode(true, PropEffecf.CLEARTWO);
- }
- else {
- this.EffectMode(false);
- }
- }
- }
- ClickHammer() {
- console.log("点到了锤子道具--");
- if (Number(this.Func4num.text) > 0) {
- if (EventManager.PropState == PropEffecf.NONE) {
- this.EffectMode(true, PropEffecf.HAMMER);
- }
- else {
- this.EffectMode(false);
- }
- }
- }
- EffectMode(_open, _type = null) {
- this.Effect.visible = _open;
- if (_open) {
- EventManager.PropState = _type;
- let describe2 = this.Effect.getChildByName("describe2");
- let describe = this.Effect.getChildByName("describe");
- let icon = this.Effect.getChildByName("ICON");
- switch (_type) {
- case PropEffecf.CLEARLAST:
- this.EffectBtn.visible = true;
- describe.visible = true;
- describe2.visible = false;
- icon.visible = true;
- icon.skin = this.GetIcon(DropRule.Instance.MinBall);
- this.ClearNum.text = DropRule.Instance.MinBall.toString();
- this.EffectBtn.clickHandler = Laya.Handler.create(this, this.ClearLast);
- break;
- case PropEffecf.CLEARTWO:
- this.EffectBtn.visible = true;
- describe.visible = true;
- describe2.visible = false;
- icon.visible = true;
- icon.skin = this.GetIcon(DropRule.Instance.MinNextBall);
- this.ClearNum.text = DropRule.Instance.MinNextBall.toString();
- this.EffectBtn.clickHandler = Laya.Handler.create(this, this.ClearTwo);
- break;
- case PropEffecf.HAMMER:
- this.EffectBtn.visible = false;
- describe.visible = false;
- describe2.visible = true;
- icon.visible = false;
- EventManager.EventTrigger(PropEffecf.HAMMER);
- break;
- }
- }
- else {
- EventManager.PropState = PropEffecf.NONE;
- this.EffectBtn.clickHandler = null;
- }
- }
- ClearLast() {
- var args = [{ "t": AccountManager.Instance.ServerTime.toString() }, { "play_id": GameManager.Instance.play_id }, { "fid": "2" }];
- ServerManager.Instance.SendHttp(BlastToMerge.Use, args, Laya.Handler.create(this, () => {
- for (let i = this.prefabbox.numChildren - 1; i > -1; i--) {
- let prefab = this.prefabbox.getChildAt(i);
- let ball = prefab.getComponent(Ball);
- if (ball.score == DropRule.Instance.MinBall) {
- GameManager.Instance.ScoreProgress += ball.score;
- DropRule.Instance.CreateEffect(ball.score, new Laya.Vector2(prefab.x, prefab.y));
- let _rig = prefab.getComponent(Laya.RigidBody);
- let _collider = prefab.getComponent(Laya.CircleCollider);
- _collider.enabled = false;
- _rig.enabled = false;
- Laya.timer.clearAll(prefab);
- prefab.removeSelf();
- let _index = DropRule.Instance.GetBallIndex(ball.score);
- GamePool.Instance.RecoverModel(prefab, _index.toString());
- }
- }
- this.SkillNumRefresh();
- this.Effect.visible = false;
- this.EffectBtn.clickHandler = null;
- EventManager.PropState = PropEffecf.NONE;
- }), Laya.Handler.create(this, () => {
- console.log("道具使用失败");
- }));
- }
- ClearTwo() {
- var args = [{ "t": AccountManager.Instance.ServerTime.toString() }, { "play_id": GameManager.Instance.play_id }, { "fid": "3" }];
- ServerManager.Instance.SendHttp(BlastToMerge.Use, args, Laya.Handler.create(this, () => {
- for (let i = this.prefabbox.numChildren - 1; i > -1; i--) {
- let prefab = this.prefabbox.getChildAt(i);
- let ball = prefab.getComponent(Ball);
- if (ball.score == DropRule.Instance.MinNextBall) {
- GameManager.Instance.ScoreProgress += ball.score;
- DropRule.Instance.CreateEffect(ball.score, new Laya.Vector2(prefab.x, prefab.y));
- let _rig = prefab.getComponent(Laya.RigidBody);
- let _collider = prefab.getComponent(Laya.CircleCollider);
- _collider.enabled = false;
- _rig.enabled = false;
- Laya.timer.clearAll(prefab);
- prefab.removeSelf();
- let _index = DropRule.Instance.GetBallIndex(ball.score);
- GamePool.Instance.RecoverModel(prefab, _index.toString());
- }
- }
- this.SkillNumRefresh();
- this.Effect.visible = false;
- this.EffectBtn.clickHandler = null;
- EventManager.PropState = PropEffecf.NONE;
- }), Laya.Handler.create(this, () => {
- console.log("道具使用失败");
- }));
- }
- GetIcon(_score) {
- let index;
- for (let i = 0; i < DropRule.Instance.PrefabName.length; i++) {
- if (_score == Number(DropRule.Instance.PrefabName[i])) {
- index = i.toString();
- }
- }
- return "Ball/blast" + index + ".png";
- }
- ClearStage() {
- if (!this.prefabbox.destroyed) {
- for (let i = this.prefabbox.numChildren - 1; i > -1; i--) {
- let prefab = this.prefabbox.getChildAt(i);
- let ball = prefab.getComponent(Ball);
- let _rig = prefab.getComponent(Laya.RigidBody);
- let _collider = prefab.getComponent(Laya.CircleCollider);
- _collider.enabled = false;
- _rig.enabled = false;
- _collider.destroy();
- _rig.destroy();
- Laya.timer.clearAll(prefab);
- prefab.removeSelf();
- let _index = DropRule.Instance.GetBallIndex(ball.score);
- GamePool.Instance.RecoverModel(prefab, _index.toString());
- }
- }
- }
- Over() {
- this.ClearStage();
- EventManager.StageOff(StageMode.Clone, this, this.AddPrefab);
- EventManager.StageOff(StageMode.Win, this, this.Win);
- EventManager.StageOff(StageMode.Lose, this, this.Lose);
- EventManager.StageOff(StageMode.ReStart, this, this.ReStart);
- EventManager.StageOff(StageMode.Over, this, this.Over);
- EventManager.StageOff(StageMode.Revive, this, this.Revive);
- EventManager.StageOff(StageMode.Check, this, this.Check);
- this.ClearCollider(this.BottomCollider);
- this.ClearCollider(this.RightCollider);
- this.ClearCollider(this.LeftCollider);
- }
- Revive() {
- for (let i = this.prefabbox.numChildren - 1; i > -1; i--) {
- let prefab = this.prefabbox.getChildAt(i);
- let ball = prefab.getComponent(Ball);
- for (let j = 0; j < DropRule.Instance.BallNum.length; j++) {
- let Score = DropRule.Instance.GetBallIndex(ball.score);
- if (Score + 1 == Number(DropRule.Instance.BallNum[j])) {
- DropRule.Instance.CreateEffect(ball.score, new Laya.Vector2(prefab.x, prefab.y));
- let _rig = prefab.getComponent(Laya.RigidBody);
- let _collider = prefab.getComponent(Laya.CircleCollider);
- _collider.enabled = false;
- _rig.enabled = false;
- Laya.timer.clearAll(prefab);
- prefab.removeSelf();
- let _index = DropRule.Instance.GetBallIndex(ball.score);
- GamePool.Instance.RecoverModel(prefab, _index.toString());
- }
- }
- }
- Laya.timer.frameLoop(2, this, this.CheckHeight);
- Laya.timer.once(500, this, () => {
- this.LoseView = false;
- });
- }
- Win() {
- Laya.timer.clear(this, this.CheckHeight);
- }
- Lose() {
- Laya.timer.clear(this, this.CheckHeight);
- }
- ReStart(_data) {
- if (_data) {
- for (let i = this.prefabbox.numChildren - 1; i > -1; i--) {
- let prefab = this.prefabbox.getChildAt(i);
- let ball = prefab.getComponent(Ball);
- for (let j = 0; j < DropRule.Instance.BallNum.length; j++) {
- let Score = DropRule.Instance.GetBallIndex(ball.score);
- if (Score + 1 == Number(DropRule.Instance.BallNum[j])) {
- DropRule.Instance.CreateEffect(ball.score, new Laya.Vector2(prefab.x, prefab.y));
- let _rig = prefab.getComponent(Laya.RigidBody);
- let _collider = prefab.getComponent(Laya.CircleCollider);
- _collider.enabled = false;
- _rig.enabled = false;
- Laya.timer.clearAll(prefab);
- prefab.removeSelf();
- let _index = DropRule.Instance.GetBallIndex(ball.score);
- GamePool.Instance.RecoverModel(prefab, _index.toString());
- }
- }
- }
- let ballarray = this.PassDeal;
- if (ballarray.length > 4) {
- let ballarray2 = [];
- for (let m = 0; m < 4; m++) {
- ballarray2.push(ballarray[m]);
- }
- for (let k = this.prefabbox.numChildren - 1; k > -1; k--) {
- let prefab = this.prefabbox.getChildAt(k);
- let ball = prefab.getComponent(Ball);
- let dispear = true;
- for (let l = 0; l < ballarray2.length; l++) {
- if (ball.score == ballarray2[l]) {
- dispear = false;
- }
- }
- if (dispear) {
- DropRule.Instance.CreateEffect(ball.score, new Laya.Vector2(prefab.x, prefab.y));
- let _rig = prefab.getComponent(Laya.RigidBody);
- let _collider = prefab.getComponent(Laya.CircleCollider);
- _collider.enabled = false;
- _rig.enabled = false;
- Laya.timer.clearAll(prefab);
- prefab.removeSelf();
- let _index = DropRule.Instance.GetBallIndex(ball.score);
- GamePool.Instance.RecoverModel(prefab, _index.toString());
- }
- }
- }
- Laya.timer.loop(5000, this, this.Save);
- this.WinView = false;
- this.ScoreRefresh();
- this.Progress();
- DropRule.Instance.FallDown(DropRule.Instance.StartNum);
- Laya.timer.frameLoop(2, this, this.CheckHeight);
- }
- else {
- this.ClearStage();
- this.LoseView = false;
- this.WinView = false;
- this.ScoreRefresh();
- this.Progress();
- if (DropRule.Instance.STAGE == 1) {
- this.Guide.visible = false;
- GameManager.Instance.Wave = 1;
- DropRule.Instance.GuideFallDown();
- GameManager.Instance.CheckHeight = false;
- }
- else {
- DropRule.Instance.FallDown(DropRule.Instance.StartNum);
- }
- Laya.timer.frameLoop(2, this, this.CheckHeight);
- }
- }
- ClearCollider(_node) {
- let collier = _node.getComponent(Laya.ChainCollider);
- let rig = _node.getComponent(Laya.RigidBody);
- if (collier) {
- collier.enabled = false;
- }
- if (rig) {
- rig.enabled = false;
- }
- if (_node) {
- _node.removeSelf();
- _node.destroy();
- }
- }
- Close() {
- Laya.timer.clearAll(this);
- }
- get PassDeal() {
- let array = [];
- for (let i = 0; i < this.prefabbox.numChildren; i++) {
- let prefab = this.prefabbox.getChildAt(i);
- let ball = prefab.getComponent(Ball);
- if (array.length == 0) {
- array.push(ball.score);
- }
- if (i > 0) {
- let add = true;
- for (let j = 0; j < array.length; j++) {
- if (ball.score == array[j]) {
- add = false;
- }
- }
- if (add) {
- array.push(ball.score);
- }
- }
- }
- if (array.length > 4) {
- for (let k = 0; k < array.length; k++) {
- for (let l = 0; l < array.length - k - 1; l++) {
- if (array[l] < array[l + 1]) {
- let temp = array[l];
- array[l] = array[l + 1];
- array[l + 1] = temp;
- }
- }
- }
- }
- return array;
- }
- Save(_data) {
- let ball;
- let score;
- let size;
- let index;
- let point;
- let obj = {};
- let objarray = [];
- if (!_data) {
- for (let i = 0; i < this.prefabbox.numChildren; i++) {
- let prefab = this.prefabbox.getChildAt(i);
- ball = prefab.getComponent(Ball);
- score = ball.score;
- index = (DropRule.Instance.GetBallIndex(score) + 1).toString();
- size = prefab.width.toString();
- point = new Laya.Vector2(prefab.x, prefab.y);
- obj = { "index": index, "size": size, "pos": point };
- objarray.push(obj);
- }
- let jindutiao = { "jindu": GameManager.Instance.ScoreProgress.toString() };
- let sizeindex = { "sizeindex": DropRule.Instance.SizeIndex };
- let edgeindex = { "edgeindex": DropRule.Instance.EdgeIndex };
- objarray.push(edgeindex);
- objarray.push(jindutiao);
- objarray.push(sizeindex);
- var progress = JSON.stringify(objarray);
- var args = [{ "stage": DropRule.Instance.STAGE.toString() }, { "progress": progress }];
- }
- else {
- obj = { "0": "0" };
- objarray.push(obj);
- var progress = JSON.stringify(objarray);
- var args = [{ "stage": DropRule.Instance.STAGE.toString() }, { "progress": progress }];
- }
- ServerManager.Instance.SendHttp(BlastToMerge.Save, args, Laya.Handler.create(this, (res) => {
- }), Laya.Handler.create(this, () => {
- console.log("保存进度失败++");
- }));
- }
- }
- var on_off;
- (function (on_off) {
- on_off[on_off["on"] = 0] = "on";
- on_off[on_off["off"] = 1] = "off";
- })(on_off || (on_off = {}));
- class Switch extends Laya.Script {
- constructor() {
- super();
- this.kaiguan = on_off.off;
- }
- onAwake() {
- this.CloseSprite = this.owner.getChildByName("close");
- this.OpenSprite = this.owner.getChildByName("open");
- this.Button = this.owner.getChildByName("btn");
- this.Button.clickHandler = Laya.Handler.create(this, () => {
- this.ChangeMode(this.kaiguan);
- this.kaiguan++;
- if (this.kaiguan > 1) {
- this.kaiguan = 0;
- }
- }, null, false);
- }
- ListenOn_Off(on = true, OpenFunction = null, CloseFunction = null) {
- this.kaiguan = on ? on_off.on : on_off.off;
- this.OpenFunction = OpenFunction;
- this.CloseFunction = CloseFunction;
- this.ChangeMode(this.kaiguan);
- this.kaiguan++;
- if (this.kaiguan > 1) {
- this.kaiguan = 0;
- }
- }
- ChangeMode(_mode) {
- switch (_mode) {
- case on_off.off:
- this.OpenSprite.visible = false;
- this.CloseSprite.visible = true;
- this.CloseFunction.run();
- break;
- case on_off.on:
- this.OpenSprite.visible = true;
- this.CloseSprite.visible = false;
- this.OpenFunction.run();
- break;
- }
- }
- }
- class SetView extends ui.SetViewUI {
- constructor() {
- super();
- }
- static get Instance() {
- if (SetView.ins) {
- return SetView.ins;
- }
- else {
- return new SetView();
- }
- }
- Show() {
- this.userid.text = AccountManager.Instance.curplayerData.userId;
- this.CloseBtn.clickHandler = Laya.Handler.create(this, this.ClickClose);
- this.SoundSwitch = this.Sound.addComponent(Switch);
- this.ShakeSwitch = this.Shake.addComponent(Switch);
- this.SoundSwitch.ListenOn_Off(AudioManager.open, Laya.Handler.create(this, this.OpenSound, [true], false), Laya.Handler.create(this, this.OpenSound, [false], false));
- this.ShakeSwitch.ListenOn_Off(WXSDK.shake, Laya.Handler.create(this, this.OpenShake, [true], false), Laya.Handler.create(this, this.OpenShake, [false], false));
- this.height = Laya.stage.height;
- Laya.stage.on(Laya.Event.RESIZE, this, () => {
- this.height = Laya.stage.height;
- });
- }
- Close() {
- }
- ClickClose() {
- ViewManager.Instance.ShowView(ViewType.MainView);
- }
- OpenSound(_open) {
- AudioManager.open = _open;
- }
- OpenShake(_open) {
- WXSDK.shake = _open;
- }
- }
- class RankView extends ui.RankViewUI {
- constructor() {
- super();
- }
- static get Instance() {
- if (RankView.ins) {
- return RankView.ins;
- }
- else {
- return new RankView();
- }
- }
- Show() {
- this.CloseBtn.clickHandler = Laya.Handler.create(this, this.ClickClose);
- this.height = Laya.stage.height;
- Laya.stage.on(Laya.Event.RESIZE, this, () => {
- this.height = Laya.stage.height;
- });
- }
- Close() {
- }
- ClickClose() {
- ViewManager.Instance.ShowView(ViewType.MainView);
- }
- }
- class GuangGao {
- static InitId() {
- }
- static JiaZaiShiPin() {
- if (this.afsfsaafsfsa)
- return;
- if (!Laya.Browser.onWeiXin)
- return;
- this.fsaasfafssfa = Laya.Browser.window.wx.createRewardedVideoAd({ adUnitId: this.videlAdUnitId });
- this.fsaasfafssfa.onLoad(() => {
- console.log('激励视频 广告加载成功');
- this.asfasfsaffsa = true;
- });
- this.fsaasfafssfa.onError(err => {
- console.log("激励视屏加载失败:" + err);
- this.asfasfsaffsa = false;
- });
- this.afsfasfasasf = 0;
- this.afsfsaafsfsa = true;
- }
- static KaiShiPin(callback) {
- if (Laya.Browser.onWeiXin) {
- console.log("showVideoAd , asfasfsaffsa:" + this.asfasfsaffsa);
- if (AccountManager.Instance.curplayerData.videoshare && AccountManager.Instance.curplayerData.fenxiang) ;
- if (AccountManager.Instance.curplayerData.video == false) {
- WXSDK.ShowTxt("暂未开放");
- return;
- }
- this.fassfafasafs(callback);
- this.fsaasfafssfa.show().catch(err => {
- this.fsaasfafssfa.load().then(() => {
- this.fassfafasafs(callback);
- this.fsaasfafssfa.show();
- });
- });
- }
- else {
- callback(false);
- }
- }
- static fassfafasafs(callback) {
- this.fsaasfafssfa.offClose();
- this.fsaasfafssfa.onClose(res => {
- console.log("激励视频关闭:" + res.isEnded);
- if (res && res.isEnded || res === undefined) {
- callback && callback(true);
- }
- else {
- callback && callback(false);
- }
- this.fsaasfafssfa.offClose();
- });
- }
- static OpenBanner(gap = 0, callVack = null, iswait = false) {
- if (!Laya.Browser.onWeiXin)
- return;
- if (this.afsfasfasasf >= 10000) {
- var hh = this.gasagsgasgsa(gap);
- if (iswait) {
- this.asgagassga.hide();
- Laya.timer.once(AccountManager.Instance.curplayerData.wudaoshijian * 1000, this, () => {
- if (callVack != null) {
- callVack(hh);
- }
- this.asgagassga.show();
- });
- }
- else {
- if (callVack != null) {
- callVack(hh);
- }
- this.asgagassga.show();
- }
- }
- else {
- var idd = this.bannerAdUnitId;
- console.log("adUnitId:" + idd);
- let newBanner = Laya.Browser.window.wx.createBannerAd({
- adUnitId: idd,
- style: {
- left: 0,
- top: 0,
- width: 460
- }
- });
- newBanner.onError(err => {
- console.log(err);
- this.gasagsgasgsa(gap);
- });
- newBanner.onLoad(() => {
- this.afsfasfasasf++;
- if (this.asgagassga)
- this.asgagassga.destroy();
- this.asgagassga = newBanner;
- var hight = this.gasagsgasgsa(gap);
- if (iswait) {
- this.asgagassga.hide();
- Laya.timer.once(AccountManager.Instance.curplayerData.wudaoshijian * 1000, this, () => {
- if (callVack != null) {
- callVack(hight);
- }
- this.asgagassga.show();
- });
- }
- else {
- if (callVack != null) {
- callVack(hight);
- }
- this.asgagassga.show();
- }
- });
- }
- }
- static gasagsgasgsa(gap) {
- if (this.asgagassga) {
- let info = Laya.Browser.window.wx.getSystemInfoSync();
- this.asgagassga.style.width = info.windowWidth;
- this.asgagassga.style.top = info.windowHeight - this.asgagassga.style.realHeight - gap - 30;
- return Laya.stage.height / info.windowHeight * this.asgagassga.style.realHeight;
- }
- }
- static Clear() {
- Laya.timer.clearAll(this);
- if (!Laya.Browser.onWeiXin)
- return;
- if (this.asgagassga)
- this.asgagassga.hide();
- }
- static agagsagags() {
- if (!Laya.Browser.onWeiXin)
- return;
- if (this.asgagassga)
- this.asgagassga.hide();
- }
- static gasagsasg() {
- if (!Laya.Browser.onWeiXin)
- return;
- if (this.asgagassga)
- this.asgagassga.show();
- }
- static get keyiwudao() {
- var wudao = AccountManager.Instance.curplayerData.wudao;
- if (wudao == false) {
- console.log("cheat:" + wudao);
- return false;
- }
- if (Main.SceneNum == "1037" || Main.SceneNum == "1007"
- || Main.SceneNum == "1044" || Main.SceneNum == "1104"
- || Main.SceneNum == "1089" || Main.SceneNum == "1001"
- || Main.SceneNum == "00000") {
- console.log("cheat:true-> " + Main.SceneNum);
- return true;
- }
- else {
- var checkscence = AccountManager.Instance.curplayerData.jiancechangjin;
- if (checkscence == false) {
- console.log("cheat:true->checkscence: " + checkscence);
- return true;
- }
- }
- console.log("cheat:false-> " + Main.SceneNum);
- return false;
- }
- static WudaoAnNiu(btn, ShowBanner = true, complete = null, gap = 0) {
- if (AccountManager.Instance.curplayerData.banner) {
- GuangGao.agagsagags();
- if (GuangGao.keyiwudao == false) {
- btn.bottom = 300;
- GuangGao.OpenBanner();
- }
- else {
- if (ShowBanner) {
- btn.bottom = 100;
- btn.mouseEnabled = false;
- console.log("bottom:100");
- GuangGao.OpenBanner(gap, (height) => {
- if (height == null) {
- console.log("展示互推位");
- }
- else {
- var end = Laya.stage.height - height - btn.height;
- btn.y = end;
- btn.bottom = NaN;
- console.log("y:" + end);
- }
- }, true);
- Laya.timer.once(AccountManager.Instance.curplayerData.wudaoshijian * 1000, this, () => {
- btn.mouseEnabled = true;
- if (complete != null) {
- complete();
- }
- });
- }
- else {
- if (complete != null) {
- complete();
- }
- }
- }
- }
- }
- on3DComplete() {
- var scene;
- Laya.stage.addChild(scene);
- var camera1 = new Laya.Camera();
- scene.addChild(camera1);
- camera1.transform.translate(new Laya.Vector3(0, 2, 8), true);
- camera1.transform.rotate(new Laya.Vector3(-23, 0, 0), true, false);
- camera1.viewport = new Laya.Viewport(0, 0, 640, 720);
- var camera2 = new Laya.Camera();
- scene.addChild(camera2);
- camera2.transform.rotate(new Laya.Vector3(-45, 0, 0), false, false);
- camera2.transform.translate(new Laya.Vector3(0, 0, 25), true);
- camera2.viewport = new Laya.Viewport(640, 0, 640, 720);
- }
- onModelOK() {
- var scene = new Laya.Scene();
- Laya.stage.addChild(scene);
- var camera = new Laya.Camera(0, 0.1, 1000);
- scene.addChild(camera);
- camera.transform.rotate(new Laya.Vector3(-25, 0, 0), false, false);
- camera.transform.position = new Laya.Vector3(0, 5, 10);
- var role3D = Laya.loader.getRes("monkey/monkey.lh");
- scene.addChild(role3D);
- }
- }
- GuangGao.videlAdUnitId = "adunit-47ace2391e74f21e";
- GuangGao.bannerAdUnitId = "adunit-876b793421608933";
- GuangGao.afsfsaafsfsa = false;
- GuangGao.asfasfsaffsa = false;
- GuangGao.afsfasfasasf = 0;
- var QianDaoMode;
- (function (QianDaoMode) {
- QianDaoMode[QianDaoMode["start"] = 0] = "start";
- QianDaoMode[QianDaoMode["none"] = 1] = "none";
- QianDaoMode[QianDaoMode["end"] = 2] = "end";
- })(QianDaoMode || (QianDaoMode = {}));
- class reward {
- constructor(_rewradid, _rewradnum) {
- this.rewardid = _rewradid;
- this.rewardnum = _rewradnum;
- }
- }
- class SignItem {
- get GetRewardData() {
- var data = this.rewardids.split(";");
- if (data.length > 1) {
- return new reward(Number(6000), Number(1));
- }
- else {
- return new reward(Number(this.rewardids), Number(this.rewardnum));
- }
- }
- }
- class SignView extends ui.SignViewUI {
- constructor() {
- super();
- this.SignDatas = [];
- this.rewardsdic = {};
- SignView.ins = this;
- }
- static get Instance() {
- if (SignView.ins) {
- return SignView.ins;
- }
- else {
- return new SignView();
- }
- }
- Show() {
- this.SignDatas = this.GainSignDatas();
- this.RefreshDatas();
- this.SignBtn.visible = SignView.CanSign;
- this.SignBtn.clickHandler = Laya.Handler.create(this, this.OnNormalSign);
- this.CloseBtn.clickHandler = Laya.Handler.create(this, this.ClickClose);
- this.height = Laya.stage.height;
- Laya.stage.on(Laya.Event.RESIZE, this, () => {
- this.height = Laya.stage.height;
- });
- }
- Close() {
- }
- ClickClose() {
- ViewManager.Instance.ShowView(ViewType.MainView);
- }
- RefreshDatas() {
- for (var i = 0; i < this.ItemList.numChildren; i++) {
- var sign = this.ItemList.getChildAt(i);
- var data = this.SignDatas[i];
- var rewardid = data.GetRewardData.rewardid;
- var icon = sign.getChildByName("icon");
- var num = sign.getChildByName("icon").getChildByName("num");
- num.text = "X" + data.GetRewardData.rewardnum.toString();
- var roleicon = AccountManager.Instance.curplayerData.GainShiTi(rewardid.toString(), "icon");
- icon.skin = "Game/res/Skin/" + roleicon + ".png";
- var cansign = data.mold;
- if (cansign == QianDaoMode.end) {
- var complete = sign.getChildByName("complete");
- complete.visible = true;
- }
- else if (cansign == QianDaoMode.start) {
- var btn = sign.getChildByName("btn");
- btn.clickHandler = Laya.Handler.create(this, this.OnDoubleSign, null, false);
- }
- }
- }
- OnSign() {
- var curgold = Number(AccountManager.Instance.curplayerData.GainAccount("money"));
- let param = [{ "video": "0" }];
- ServerManager.Instance.SendHttp(BlastToMerge.QianDao, param, Laya.Handler.create(this, function (e) {
- var reward = e["rewards"];
- SignView.Instance.SignDatas = SignView.Instance.GainSignDatas();
- SignView.Instance.SignBtn.visible = false;
- SignView.Instance.RefreshDatas();
- if (reward["1000"]) {
- var gg = Number(AccountManager.Instance.curplayerData.GainAccount("money")) - curgold;
- GameTools.GetMoney(gg, null, Laya.Handler.create(this, () => {
- ViewManager.Instance.ShowView(ViewType.MainView);
- }));
- }
- else {
- 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, () => {
- ViewManager.Instance.ShowView(ViewType.MainView);
- }));
- }
- }), Laya.Handler.create(this, this.OnSignError), true);
- }
- OnNormalSign() {
- this.OnSign();
- }
- OnDoubleSign() {
- GuangGao.KaiShiPin((flag) => {
- if (flag) {
- let param = [{ "video": "1" }];
- ServerManager.Instance.SendHttp(BlastToMerge.QianDao, param, Laya.Handler.create(this, function (e) {
- var reward = e["rewards"];
- SignView.Instance.SignDatas = SignView.Instance.GainSignDatas();
- SignView.Instance.SignBtn.visible = false;
- SignView.Instance.RefreshDatas();
- 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, () => {
- ViewManager.Instance.ShowView(ViewType.MainView);
- }));
- }), Laya.Handler.create(this, this.OnSignError), true);
- }
- });
- }
- OnSignError(e) {
- console.log(e);
- }
- GainSignDatas() {
- var signdatas = [];
- var config = AccountManager.Instance.curplayerData.GainCollocation("sign");
- var signday = Number(AccountManager.Instance.curplayerData.GainQinDao("sign_days"));
- var once = signday < 7;
- var indes = once ? 0 : 7;
- for (var i = indes; i < indes + 7; i++) {
- this.rewardsdic[config[i].id] = config[i].rewards;
- }
- for (var key in this.rewardsdic) {
- var rewardid = this.rewardsdic[key];
- var reward = AccountManager.Instance.curplayerData.GainJiangLi(rewardid);
- var item = new SignItem();
- item.desc = reward.group_name;
- item.icon = reward.icon;
- item.signday = Number(reward.id);
- item.rewardids = reward.reward_item;
- item.rewardnum = reward.reward_num;
- item.weight = reward.reward_weight;
- var num = Number(key);
- if (signday > num - 1)
- item.mold = QianDaoMode.end;
- if (signday < num - 1)
- item.mold = QianDaoMode.none;
- if (signday == num - 1 && SignView.CanSign) {
- item.mold = QianDaoMode.start;
- }
- signdatas.push(item);
- }
- return signdatas;
- }
- static get CanSign() {
- let SSS = new Date(AccountManager.Instance.ServerTime * 1000);
- SSS.setHours(0, 0, 0, 0);
- var AAA = SSS.valueOf();
- var SignTime = Number(AccountManager.Instance.curplayerData.GainQinDao("sign_time"));
- var DDD = SignTime * 1000;
- var TTT = DDD < AAA ? true : false;
- return TTT;
- }
- }
- class LotteryView extends ui.LotteryViewUI {
- constructor() {
- super();
- this.circleNum = 5;
- }
- static get Instance() {
- if (LotteryView.ins) {
- return LotteryView.ins;
- }
- else {
- return new LotteryView();
- }
- }
- Show() {
- this.CloseBtn.clickHandler = Laya.Handler.create(this, this.ClickClose);
- this.LotteryBtn.clickHandler = Laya.Handler.create(this, this.OnVedio);
- this.height = Laya.stage.height;
- Laya.stage.on(Laya.Event.RESIZE, this, () => {
- this.height = Laya.stage.height;
- });
- }
- Close() {
- }
- ClickClose() {
- ViewManager.Instance.ShowView(ViewType.MainView);
- }
- OnVedio() {
- GuangGao.KaiShiPin((flag) => {
- if (flag) {
- this.LotteryBtn.visible = false;
- let param = [{ "channel": "video" }, { "t": AccountManager.Instance.ServerTime.toString() }];
- ServerManager.Instance.SendHttp(BlastToMerge.Lottery, param, Laya.Handler.create(this, function (e) {
- this.RotationDial(e);
- }), Laya.Handler.create(this, () => {
- WXSDK.ShowTxt("抽奖次数已经用完!");
- }), true);
- }
- });
- }
- RotationDial(e) {
- var result = e.lottery_id - 1;
- this.dial.rotation = 0;
- let tween = Laya.Tween.to(this.dial, {
- rotation: 360 * (this.circleNum) - result * 60
- }, 5000, Laya.Ease.quadInOut, new Laya.Handler(null, () => {
- tween.clear();
- this.LotteryBtn.visible = true;
- if (!LotteryView.IsCanLottery()) {
- this.LotteryBtn.gray = true;
- console.log("观看视频抽奖按钮已变灰");
- }
- var reward = e["rewards"];
- 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, () => {
- ViewManager.Instance.ShowView(ViewType.MainView);
- }));
- }));
- }
- static IsCanLottery() {
- var _timer = Number(AccountManager.Instance.curplayerData.lottery.day_video_times);
- return _timer > 0;
- }
- }
- class FailureView extends ui.FailureViewUI {
- constructor() {
- super();
- }
- static get Instance() {
- if (FailureView.ins) {
- return FailureView.ins;
- }
- else {
- return new FailureView();
- }
- }
- Show() {
- this.BackBtn.clickHandler = Laya.Handler.create(this, this.ClickBack);
- this.TryBtn.clickHandler = Laya.Handler.create(this, this.ClickTry);
- this.height = Laya.stage.height;
- this.BG.height = Laya.stage.height;
- Laya.stage.on(Laya.Event.RESIZE, this, () => {
- this.height = Laya.stage.height;
- this.BG.height = Laya.stage.height;
- });
- }
- Close() {
- Laya.timer.clearAll(this);
- }
- ClickBack() {
- var args = [{ "t": AccountManager.Instance.ServerTime.toString() }, { "play_id": GameManager.Instance.play_id }, { "win": "0" }];
- ServerManager.Instance.SendHttp(BlastToMerge.JieShu, args, Laya.Handler.create(this, this.BackMain), null);
- }
- ClickTry() {
- var args = [{ "t": AccountManager.Instance.ServerTime.toString() }, { "play_id": GameManager.Instance.play_id }, { "win": "0" }];
- ServerManager.Instance.SendHttp(BlastToMerge.JieShu, args, Laya.Handler.create(this, this.Try), null);
- }
- BackMain() {
- EventManager.StageTrigger(StageMode.Over);
- EventManager.StageTrigger(StageMode.Refresh);
- ViewManager.Instance.ShowView(ViewType.MainView);
- }
- Try() {
- ViewManager.Instance.ClosePopView(ViewType.FailureView);
- EventManager.StageTrigger(StageMode.Refresh);
- EventManager.StageTrigger(StageMode.ReStart);
- }
- }
- class WinView extends ui.WinViewUI {
- constructor() {
- super();
- }
- static get Instance() {
- if (WinView.ins) {
- return WinView.ins;
- }
- else {
- return new WinView();
- }
- }
- Show() {
- this.BackBtn.clickHandler = Laya.Handler.create(this, this.ClickBack);
- this.NextBtn.clickHandler = Laya.Handler.create(this, this.ClickNextLevel);
- this.height = Laya.stage.height;
- this.BG.height = Laya.stage.height;
- Laya.stage.on(Laya.Event.RESIZE, this, () => {
- this.height = Laya.stage.height;
- this.BG.height = Laya.stage.height;
- });
- }
- Close() {
- Laya.timer.clearAll(this);
- }
- ClickBack() {
- var args = [{ "t": AccountManager.Instance.ServerTime.toString() }, { "play_id": GameManager.Instance.play_id }, { "win": "1" }];
- ServerManager.Instance.SendHttp(BlastToMerge.JieShu, args, Laya.Handler.create(this, this.BackMain), null);
- }
- ClickNextLevel() {
- var args = [{ "t": AccountManager.Instance.ServerTime.toString() }, { "play_id": GameManager.Instance.play_id }, { "win": "1" }];
- ServerManager.Instance.SendHttp(BlastToMerge.JieShu, args, Laya.Handler.create(this, this.NextLevel), null);
- }
- BackMain() {
- EventManager.StageTrigger(StageMode.Over);
- EventManager.StageTrigger(StageMode.Refresh);
- ViewManager.Instance.ShowView(ViewType.MainView);
- let level = DropRule.Instance.STAGE;
- WXSDK.UpdateScore(level);
- }
- NextLevel() {
- var agrs = [{ "t": AccountManager.Instance.ServerTime.toString() }];
- ServerManager.Instance.SendHttp(BlastToMerge.KaiShi, agrs, Laya.Handler.create(this, this.StartNextLevel), null);
- }
- StartNextLevel(_data) {
- ViewManager.Instance.ClosePopView(ViewType.WinView);
- let stage = AccountManager.Instance.curplayerData.GainAccount("stage");
- GameManager.Instance.play_id = _data.play_id;
- DropRule.Instance.STAGE = Number(AccountManager.Instance.curplayerData.GainAccount("stage"));
- EventManager.StageTrigger(StageMode.Refresh, [true]);
- EventManager.StageTrigger(StageMode.ReStart, [true]);
- let level = DropRule.Instance.STAGE;
- WXSDK.UpdateScore(level);
- }
- }
- class ReviveView extends ui.ReviveViewUI {
- constructor() {
- super();
- this.time = 9;
- this.count = false;
- this.fuhuo = false;
- }
- static get Instance() {
- if (ReviveView.ins) {
- return ReviveView.ins;
- }
- else {
- return new ReviveView();
- }
- }
- Show() {
- this.VideoBtn.clickHandler = Laya.Handler.create(this, this.VideoRevive);
- this.NoBtn.visible = false;
- Laya.timer.once(1000, this, () => {
- this.NoBtn.visible = true;
- this.NoBtn.clickHandler = Laya.Handler.create(this, this.DontRevive, null, false);
- });
- this.count = true;
- Laya.timer.loop(1000, this, this.CountTime);
- this.height = Laya.stage.height;
- this.BG.height = Laya.stage.height;
- Laya.stage.on(Laya.Event.RESIZE, this, () => {
- this.height = Laya.stage.height;
- this.BG.height = Laya.stage.height;
- });
- }
- CountTime() {
- if (this.count && this.time > 0) {
- this.time -= 1;
- this.Time.text = this.time.toString();
- if (this.time < 1) {
- Laya.timer.clear(this, this.CountTime);
- this.DontRevive();
- }
- }
- }
- DontRevive() {
- Laya.timer.clear(this, this.CountTime);
- this.count = false;
- ViewManager.Instance.ClosePopView(ViewType.ReviveView);
- ViewManager.Instance.OpenPopView(ViewType.FailureView);
- }
- VideoRevive() {
- Laya.timer.clear(this, this.CountTime);
- this.count = false;
- EventManager.StageTrigger(StageMode.Revive);
- ViewManager.Instance.ClearPopViews();
- }
- Close() {
- Laya.timer.clearAll(this);
- }
- }
- var ViewType;
- (function (ViewType) {
- ViewType[ViewType["MainView"] = 0] = "MainView";
- ViewType[ViewType["SignView"] = 1] = "SignView";
- ViewType[ViewType["SetView"] = 2] = "SetView";
- ViewType[ViewType["LotteryView"] = 3] = "LotteryView";
- ViewType[ViewType["InGameView"] = 4] = "InGameView";
- ViewType[ViewType["RankView"] = 5] = "RankView";
- ViewType[ViewType["WinView"] = 6] = "WinView";
- ViewType[ViewType["FailureView"] = 7] = "FailureView";
- ViewType[ViewType["ReviveView"] = 8] = "ReviveView";
- })(ViewType || (ViewType = {}));
- class ViewManager {
- constructor() {
- this.ViewDic = [];
- this.OtherViewDic = [];
- this.ViewSprite = new Laya.Sprite;
- this.OtherViewSprite = new Laya.Sprite;
- ViewManager.ins = this;
- this.Init();
- }
- static get Instance() {
- if (ViewManager.ins) {
- return ViewManager.ins;
- }
- else {
- return new ViewManager();
- }
- }
- Init() {
- this.ViewDic[ViewType.MainView] = MainView;
- this.ViewDic[ViewType.SignView] = SignView;
- this.ViewDic[ViewType.SetView] = SetView;
- this.ViewDic[ViewType.LotteryView] = LotteryView;
- this.ViewDic[ViewType.InGameView] = InGameView;
- this.ViewDic[ViewType.RankView] = RankView;
- this.ViewDic[ViewType.WinView] = WinView;
- this.ViewDic[ViewType.FailureView] = FailureView;
- this.ViewDic[ViewType.ReviveView] = ReviveView;
- Laya.stage.addChild(this.ViewSprite);
- Laya.stage.addChild(this.OtherViewSprite);
- }
- ShowView(_viewtype, data = null) {
- if (this.curView != null) {
- this.curView.Close();
- this.curView.destroy();
- this.curView.removeSelf();
- }
- this.ClearPopViews();
- this.curView = this.CreateView(_viewtype);
- this.curView.name = ViewType[_viewtype];
- this.ViewSprite.addChild(this.curView);
- this.curView.Show(data);
- }
- CloseView() {
- if (this.curView != null) {
- this.curView.Close();
- this.curView.destroy();
- this.curView.removeSelf();
- }
- }
- OpenPopView(viewType, data = null) {
- GuangGao.Clear();
- var popView;
- if (this.OtherViewDic[viewType]) {
- popView = this.OtherViewDic[viewType];
- this.OtherViewSprite.setChildIndex(popView, this.OtherViewSprite.numChildren - 1);
- popView.visible = true;
- }
- else {
- popView = this.CreateView(viewType);
- this.OtherViewSprite.addChild(popView);
- this.OtherViewDic[viewType] = popView;
- }
- popView.Show(data);
- }
- ClosePopView(viewType) {
- var popView = this.OtherViewDic[viewType];
- if (popView == null) {
- return;
- }
- GuangGao.Clear();
- popView.Close();
- popView.visible = false;
- }
- ClearPopViews() {
- GuangGao.Clear();
- this.ClosePopView(ViewType.WinView);
- this.ClosePopView(ViewType.FailureView);
- this.ClosePopView(ViewType.ReviveView);
- }
- CreateView(_viewtype) {
- switch (_viewtype) {
- case ViewType.MainView:
- return new MainView();
- case ViewType.InGameView:
- return new InGameView();
- case ViewType.SetView:
- return new SetView();
- case ViewType.RankView:
- return new RankView();
- case ViewType.SignView:
- return new SignView();
- case ViewType.LotteryView:
- return new LotteryView();
- case ViewType.FailureView:
- return new FailureView();
- case ViewType.WinView:
- return new WinView();
- case ViewType.ReviveView:
- return new ReviveView();
- }
- return null;
- }
- }
- class GameControl {
- constructor() {
- GameControl.ins = this;
- this.Init();
- }
- static get Instance() {
- if (GameControl.ins) {
- return GameControl.ins;
- }
- else {
- return new GameControl();
- }
- }
- Init() {
- EventManager.StageOn(StageMode.Start, this, this.GameStart);
- EventManager.StageOn(StageMode.Lose, this, this.GameLose);
- EventManager.StageOn(StageMode.Win, this, this.GameWin);
- }
- GameStart() {
- ViewManager.Instance.ShowView(ViewType.InGameView);
- if (DropRule.Instance.STAGE == 1) {
- DropRule.Instance.GuideFallDown();
- return;
- }
- if (DropRule.Instance.progress.length > 1 && GameManager.Instance.First) {
- DropRule.Instance.RecoverScene();
- GameManager.Instance.First = false;
- }
- else {
- DropRule.Instance.FallDown(DropRule.Instance.StartNum);
- }
- }
- GameLose() {
- if (GameManager.Instance.ReviveNum > 0) {
- ViewManager.Instance.OpenPopView(ViewType.ReviveView);
- GameManager.Instance.ReviveNum--;
- }
- else {
- ViewManager.Instance.OpenPopView(ViewType.FailureView);
- }
- }
- GameWin() {
- ViewManager.Instance.OpenPopView(ViewType.WinView);
- }
- }
- class LoadView {
- constructor() {
- this.Login();
- new GameControl();
- new GameManager();
- }
- static get Instance() {
- if (LoadView.ins) {
- return LoadView.ins;
- }
- else {
- return new LoadView();
- }
- }
- Login() {
- if (Laya.Browser.onWeiXin) {
- this.WXLogin();
- }
- else {
- this.LocalLogin();
- }
- }
- WXLogin() {
- if (Laya.Browser.onWeiXin) {
- WXSDK.DengLu((res) => {
- if (res != "error") {
- console.log("1微信登录成功:" + res);
- this.LocalLogin();
- }
- else {
- this.WXLogin();
- }
- });
- }
- else {
- this.LocalLogin();
- ServerManager.Instance.Login(null, Laya.Handler.create(this, this.LoginComplete), Laya.Handler.create(this, this.LoginFail));
- }
- }
- LocalLogin() {
- ServerManager.Instance.Login(null, Laya.Handler.create(this, this.LoginComplete), Laya.Handler.create(this, this.LoginFail));
- }
- LoginComplete() {
- console.log("本地服务器登陆成功");
- this.LoadSubPackage();
- }
- LoginFail(e) {
- console.log("本地服务器登陆失败");
- console.log(e);
- }
- LoadSubPackage() {
- WXSDK.LoadSubPackage("Game", callback => {
- if (callback) {
- new DropRule();
- ViewManager.Instance.ShowView(ViewType.MainView);
- }
- });
- }
- }
- class Main$1 {
- constructor() {
- if (CheckMain.Creat)
- return;
- CheckMain.Creat = true;
- if (window["Laya3D"])
- Laya3D.init(GameConfig.width, GameConfig.height);
- else
- Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
- Laya["Physics"] && Laya["Physics"].enable();
- Laya["DebugPanel"] && Laya["DebugPanel"].enable();
- Laya.stage.scaleMode = GameConfig.scaleMode;
- Laya.stage.screenMode = GameConfig.screenMode;
- Laya.stage.alignV = GameConfig.alignV;
- Laya.stage.alignH = GameConfig.alignH;
- Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
- if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
- Laya.enableDebugPanel();
- if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
- Laya["PhysicsDebugDraw"].enable();
- if (GameConfig.stat)
- Laya.Stat.show();
- Laya.alertGlobalError = true;
- if (Laya.Browser.onWeiXin) {
- Laya.Browser.window.wx.showShareMenu({
- withShareTicket: true
- });
- Laya.Browser.window.wx.onShareAppMessage(function () {
- return {
- title: "试一下你的脑力能到第几关",
- imageUrl: "Game/res/Share/fx.png",
- };
- });
- Laya.Browser.window.wx.onShow((option) => {
- var shareTicket = option.shareTicket;
- var userId = option.query.userId;
- var shareTitle = option.query.shareTitle;
- Main$1.SceneNum = option.scene;
- WXSDK.querychannel = option.query.channel;
- WXSDK.shareOpenId = option.query.userId;
- console.log("option---", option);
- console.log("scene:", option.scene);
- if (WXSDK.querychannel != null) {
- console.log("onShow channel is:", WXSDK.querychannel);
- }
- if (option.referrerInfo) {
- WXSDK.referrerInfoappId = option.referrerInfo.appId;
- console.log("onShow appId is:", option.referrerInfo.appId);
- }
- });
- const updateManager = Laya.Browser.window.wx.getUpdateManager();
- updateManager.onCheckForUpdate(function (res) {
- console.log("最新版本:" + res.hasUpdate);
- });
- updateManager.onUpdateReady(function () {
- Laya.Browser.window.wx.showModal({
- showCancel: false,
- title: '更新提示',
- content: '新版本已经准备好,是否重启应用?',
- success(res) {
- updateManager.applyUpdate();
- },
- fail(res) {
- updateManager.applyUpdate();
- }
- });
- });
- }
- Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
- }
- onVersionLoaded() {
- Laya.AtlasInfoManager.enable("fileconfig.json", Laya.Handler.create(this, this.onConfigLoaded));
- }
- onConfigLoaded() {
- new LoadView();
- }
- }
- Main$1.Ver = "1.0.3";
- Main$1.CFG = "123";
- Main$1.SceneNum = "000";
- new Main$1();
- exports.Main = Main$1;
- return exports;
- }({}));
- //# sourceMappingURL=bundle.js.map
|