1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972 |
- <!DOCTYPE html>
- <html class="SG-game-show" style="background:none;background-color:transparent; width:100%;" >
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta charset="UTF-8">
- <meta http-equiv="Content-Type" content="text/html"><meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="robots" content="index,follow">
- <meta name="apple-touch-fullscreen" content="yes">
- <meta property="og:title" content="麻将连连看">
- <meta property="og:description" content="麻将连连看,超好玩的消除类游戏">
- <meta property="og:type" content="game">
- <meta property="fb:app_id" content="">
- <meta name="description" content="麻将连连看,超好玩的消除类游戏">
- <title>麻将连连看</title>
- <meta name="viewport" content="width=device-width,maximum-scale=1.0, initial-scale=1.0, user-scalable=no"><meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=no;">
- <script type="text/javascript" async src="js/ga.js"></script>
- <!--Google Analytics-->
- </head>
- <body style="margin:0px;padding:0px;-webkit-user-select: none;background: #000;" class="game-show">
- <div id="play68-root"><iframe id="play68-iframe" style="display: none; "></iframe></div>
- <script type="text/javascript" charset="UTF-8">
- //<![CDATA[
- (function () {
- FZ = {
- newClass: function (a, b) {
- a === undefined && (a = {});
- var c = function () {};
- typeof b == "function" && b.hasOwnProperty("prototype") ? c.prototype = b.prototype : typeof b == "object" && (c.prototype = b);
- var d = function () {};
- if (a.hasOwnProperty("init") || "init" in c.prototype) d = function () {
- this.init.apply(this, arguments)
- };
- d.prototype = new c, d.prototype.constructor = d;
- for (var e in a) d.prototype[e] = a[e];
- return d
- },
- $: function (a) {
- return document.getElementById(a)
- },
- Tools: {
- splat: function (a) {
- if (!a) return [];
- return a instanceof Array || typeof a == "object" && typeof a.length == "number" && a.callee ? a : [a]
- },
- bind: function (a, b, c) {
- return function () {
- return b.apply(a, FZ.Tools.splat(c))
- }
- },
- bindWithEvent: function (a, b, c) {
- return function (d) {
- var e = [d];
- Array.prototype.push.apply(e, FZ.Tools.splat(c));
- return b.apply(a, e)
- }
- },
- trim: function (a) {
- return a.replace(/^\s+|\s+$/g, "")
- },
- extend: function (a, b) {
- for (var c in b) a[c] = b[c]
- }
- },
- EngineOptions: {
- DebugLevel: "error"
- },
- _trace: function (a) {
- FZ.EngineOptions.DebugLevel === "info" && console.log(a)
- },
- _assert: function (a, b) {
- (FZ.EngineOptions.DebugLevel === "error" || FZ.EngineOptions.DebugLevel === "info") && !a && alert(b)
- }
- }
- })(),
- function () {
- FZ.ResourceManager = {
- __ResourceCount: 0,
- __ResourceLoaded: 0,
- __GeneralCallback: null,
- __GeneralCallbackObj: null,
- ResourceLib: {},
- isResourceLoaded: function () {
- return this.__ResourceCount === this.__ResourceLoaded
- },
- addResource: function (a) {
- if (this.ResourceFactory.hasOwnProperty(a.Type)) {
- this.__ResourceCount++;
- var b = {
- Resource: null,
- Loaded: !1
- };
- this.ResourceLib[a.Name] = b, FZ._trace("Add/load resource[" + a.Name + "] : " + a.URL);
- var c = new this.ResourceFactory[a.Type](a.URL, b);
- c.setCallback(function () {
- b.Loaded = !0, FZ.ResourceManager.__ResourceLoaded++, a.callback && a.callback(b.Resource), FZ.ResourceManager.__GeneralCallback && FZ.ResourceManager.__GeneralCallback.call()
- }), c.load()
- } else Throw("Error: Do not suppport Resourcetype:" + a.Type)
- },
- setCallback: function (a) {
- this.__GeneralCallback = a
- },
- getLoadingRatio: function () {
- if (this.__ResourceCount === 0) return 1;
- return this.__ResourceLoaded / this.__ResourceCount
- },
- ResourceFactory: {},
- registerResourceType: function (a, b) {
- this.ResourceFactory[a] = b
- }
- }, FZ.Class_Resource = {
- callback: function () {},
- init: function (a, b) {
- this.URL = a, this.target = b
- },
- setCallback: function (a) {
- this.callback = a
- }
- }
- }(),
- function () {
- var a = FZ.newClass({
- load: function () {
- var a = new Audio;
- a.src = this.URL, a.load(), a.play(), a.pause(), this.callback(), this.target.Resource = a
- }
- }, FZ.Class_Resource);
- FZ.ResourceManager.registerResourceType("Audio", a)
- }(),
- function () {
- var a = FZ.newClass({
- load: function () {
- this.target.Resource = document.createElement("script"), this.target.Resource.addEventListener("load", this.callback, !1), this.target.Resource.src = this.URL, document.body.appendChild(this.target.Resource)
- }
- }, FZ.Class_Resource);
- FZ.ResourceManager.registerResourceType("Js", a)
- }(),
- function () {
- var a = FZ.newClass({
- load: function () {
- this.target.Resource = new Image, this.target.Resource.addEventListener("load", this.callback, !1), this.target.Resource.addEventListener("error", function () {
- //alert(this.URL)
- }, !1), this.target.Resource.src = this.URL
- }
- }, FZ.Class_Resource);
- FZ.ResourceManager.registerResourceType("Image", a)
- }(),
- function () {
- FZ.stateStatus = {}, FZ.stateStatus.INIT = 0, FZ.stateStatus.NORMAL = 5, FZ.stateStatus.HIDENOTIFY = 15, FZ.stateStatus.HIDELOGIC = 20, FZ.stateStatus.DONOTHING = 30, FZ.GameStateBase = FZ.newClass({
- StateName: "GameStateBase",
- m_status: FZ.stateStatus.NORMAL,
- init: function () {
- FZ.GameBase.registerState(this.StateName, this)
- },
- pause: function () {
- this.m_status = FZ.stateStatus.HIDENOTIFY
- },
- resume: function () {
- this.m_status = FZ.stateStatus.NORMAL
- },
- preProcess: function () {},
- postProcess: function () {},
- AIUpdate: function (a) {},
- visualUpdate: function () {}
- }), FZ.GameBase = {
- Time: (new Date).getTime(),
- FrameNum: 0,
- Fps: 0,
- Fps_lastTime: 0,
- Fps_lastFrame: 0,
- DefaultFPS: 30,
- CurrentState: null,
- __StateLib: {},
- __stateStack: [],
- Width: 640,
- Height: 480,
- MainCanvas: null,
- MainContext: null,
- Name: "",
- SaveObject: {},
- init: function (a) {
- this.MainCanvas = document.createElement("canvas"), this.MainCanvas.width = this.Width, this.MainCanvas.height = this.Height, this.MainContext = this.MainCanvas.getContext("2d"), this.MainCanvas.addEventListener("mousemove", FZ.Tools.bindWithEvent(FZ.ControlManager, FZ.ControlManager.MouseMove), !1), this.MainCanvas.addEventListener("mousedown", FZ.Tools.bindWithEvent(FZ.ControlManager, FZ.ControlManager.MouseDown), !1), this.MainCanvas.addEventListener("mouseup", FZ.Tools.bindWithEvent(FZ.ControlManager, FZ.ControlManager.MouseUp), !1), this.theInterval = setInterval(FZ.Tools.bind(this, this.update), 1e3 / this.DefaultFPS), a.appendChild(this.MainCanvas)
- },
- update: function () {
- var a = 0,
- b = null;
- this.FrameNum++;
- var c = (new Date).getTime(),
- d = (c - this.Time) / 1e3;
- this.Time = c, this.time - this.Fps_lastTime > 1e3 && (this.Fps = Math.round(10 * (this.FrameNum - this.Fps_lastFrame) / ((this.Time - this.Fps_lastTime) / 1e3)) / 10, this.Fps_lastTime = this.Time, this.Fps_lastFrame = this.FrameNum);
- for (a = 0; a < this.__stateStack.length; a++) b = this.__stateStack[a], b && b !== this.CurrentState && (FZ.stateStatus.NORMAL === b.m_status ? (b.AIUpdate(d), b.visualUpdate()) : FZ.stateStatus.HIDENOTIFY === b.m_status ? b.visualUpdate() : FZ.stateStatus.HIDELOGIC === b.m_status ? b.AIUpdate(d) : FZ.stateStatus.DONOTHING !== b.m_status);
- null !== this.CurrentState && (this.CurrentState.AIUpdate(d), this.CurrentState.visualUpdate())
- },
- saveGame: function () {
- FZ._assert(this.Name != "", "Please set the name of the game first"), localStorage["FZ.Game." + this.Name] = FZ.JSON.stringify(this.SaveObject)
- },
- loadGame: function () {
- FZ._assert(this.Name != "", "Please set the name of the game first");
- if (this.Name == "") return !1;
- if (!localStorage.hasOwnProperty("FZ.Game." + this.Name)) {
- this.SaveObject = {};
- return !1
- }
- this.SaveObject = FZ.JSON.parse(localStorage["FZ.Game." + this.Name]);
- return !0
- },
- registerState: function (a, b) {
- this.__StateLib[a] = b
- },
- getState: function (a) {
- return this.__StateLib[a]
- },
- switchToState: function (a) {
- var b = this.CurrentState.StateName,
- c = [b];
- Array.prototype.push.apply(c, arguments), this.CurrentState.postProcess(), this.CurrentState = this.__StateLib[a], this.CurrentState.preProcess.apply(this.CurrentState, c), FZ.PrintLog("switchToState")
- },
- resetAllState: function () {
- var a = 0;
- a = this.__stateStack.length, this.__stateStack.splice(0, a)
- },
- pushState: function (a) {
- this.__stateStack.push(this.__StateLib[a])
- },
- popState: function () {
- this.CurrentState = this.__stateStack.pop(), undefined !== this.CurrentState && null !== this.CurrentState && this.CurrentState.resume && this.CurrentState.resume.apply(this.CurrentState, arguments)
- }
- }, FZ.GameBase.CurrentState = new FZ.GameStateBase
- }(),
- function () {
- FZ.Sprite = FZ.newClass({
- __currentIdx: 0,
- __currentFrameTime: 0,
- __matrixDirty: !0,
- __inverseMatrixDirty: !0,
- init: function (a, b) {
- this.__theImages = [], this.__children = [], this.__localMatrix = new FZ.Math.Matrix3, this.__worldMatrix = new FZ.Math.Matrix3, this.__inverseMatrix = new FZ.Math.Matrix3, this.__parentSprite = undefined, this.__playing = Boolean(b);
- if (!a || a.length === 0) this.__currentIdx = -1;
- else
- for (var c = 0, d = a.length; c < d; ++c) a[c] instanceof Array ? this.__theImages.push([a[c][0], a[c][1] ? a[c][1] : .033]) : this.__theImages.push([a[c], .033])
- },
- clone: function () {
- var a = new FZ.Sprite;
- a.__theImages = this.__theImages, a.__localMatrix = this.__localMatrix.clone(), a.__currentIdx = this.__theImages.length === 0 ? -1 : 0;
- for (var b = 0, c = this.__children.length; b < c; ++b) a.addChild(this.__children[b].clone());
- return a
- },
- setFrameTime: function (a) {
- if (typeof a == "number")
- for (var b = 0, c = this.__theImages.length; b < c; ++b) this.__theImages[b][1] = a;
- else
- for (var b = 0; b < a.length && b < __theImages.length; ++b) this.__theImages[b][1] = a[b]
- },
- addChild: function (a) {
- this.__children.push(a), a.__parentSprite = this
- },
- update: function (a) {
- if ( !! this.__playing) {
- for (var b = 0, c = this.__children.length; b < c; ++b) this.__children[b].update(a);
- if (this.__currentIdx === -1) return;
- this.__currentFrameTime += a;
- while (this.__currentFrameTime > this.__theImages[this.__currentIdx][1]) this.__currentFrameTime -= this.__theImages[this.__currentIdx][1], this.__currentIdx++, this.__currentIdx === this.__theImages.length && (this.__currentIdx = 0)
- }
- },
- setFrame: function (a) {
- this.__currentIdx = FZ.Math.clamp(a, 0, this.__theImages.length - 1)
- },
- stop: function () {
- this.__playing = !1
- },
- play: function () {
- this.__playing = !0
- },
- getPosition: function () {
- this.__DirtyMatrixProcess();
- var a = new FZ.Math.Vector2(0, 0);
- return a.applyTransform(this.__worldMatrix, a)
- },
- localToWorld: function (a) {
- this.__DirtyMatrixProcess();
- return a.applyTransform(this.__worldMatrix)
- },
- worldToLocal: function (a) {
- this.__DirtyInverseMatrixProcess();
- return a.applyTransform(this.__inverseMatrix)
- },
- __markMatrixDirty: function () {
- if (!this.__matrixDirty) {
- this.__matrixDirty = !0, this.__inverseMatrixDirty = !0;
- for (var a = 0, b = this.__children.length; a < b; ++a) this.__children[a].__markMatrixDirty()
- }
- },
- __DirtyInverseMatrixProcess: function () {
- this.__DirtyMatrixProcess(), this.__inverseMatrixDirty && (this.__worldMatrix.inverseAffine(this.__inverseMatrix), this.__inverseMatrixDirty = !1)
- },
- __DirtyMatrixProcess: function () {
- this.__matrixDirty && (this.__parentSprite ? this.__parentSprite.__worldMatrix.mul(this.__localMatrix, this.__worldMatrix) : this.__worldMatrix = this.__localMatrix, this.__matrixDirty = !1)
- },
- draw: function (a) {
- this.__DirtyMatrixProcess();
- for (var b = 0, c = this.__children.length; b < c; ++b) this.__children[b].draw(a);
- this.__currentIdx !== -1 && (a.setTransform(this.__worldMatrix.m11, this.__worldMatrix.m12, this.__worldMatrix.m21, this.__worldMatrix.m22, this.__worldMatrix.dx, this.__worldMatrix.dy), a.drawImage(this.__theImages[this.__currentIdx][0], 0, 0))
- },
- translate: function (a, b) {
- this.__localMatrix.translate(a, b), this.__markMatrixDirty()
- },
- rotate: function (a) {
- this.__localMatrix.rotate(a), this.__markMatrixDirty()
- },
- scale1: function (a) {
- this.__localMatrix.scale1(a), this.__markMatrixDirty()
- },
- scale2: function (a, b) {
- this.__localMatrix.scale2(a, b), this.__markMatrixDirty()
- },
- makeTranslate: function (a, b) {
- this.__localMatrix.makeTranslate(a, b), this.__markMatrixDirty()
- },
- makeRotate: function (a) {
- this.__localMatrix.makeRotate(a), this.__markMatrixDirty()
- },
- makeScale1: function (a) {
- this.__localMatrix.makeScale1(a), this.__markMatrixDirty()
- },
- makeScale2: function (a, b) {
- this.__localMatrix.makeScale2(a, b), this.__markMatrixDirty()
- },
- resetMatrix: function () {
- this.__localMatrix.identity(), this.__markMatrixDirty()
- }
- }), FZ.spriteManager = {
- __sprites: {},
- addResource: function (a, b, c, d, e, f) {
- FZ.ResourceManager.addResource({
- Name: a,
- Type: "Image",
- URL: c,
- callback: function (b) {
- if (f === 1) FZ.spriteManager.__sprites[a] = new FZ.Sprite([b]);
- else {
- var c = [];
- for (var g = 0; g < f; ++g) {
- var h = document.createElement("canvas");
- h.width = b.width / f, h.height = b.height, h.getContext("2d").drawImage(b, b.width / f * g, 0, b.width / f, b.height, 0, 0, b.width / f, b.height), c.push([h])
- }
- FZ.spriteManager.__sprites[a] = new FZ.Sprite(c)
- }
- FZ.spriteManager.__sprites[a].makeTranslate(d, e)
- }
- })
- },
- getSprite: function (a) {
- return this.__sprites[a]
- }
- }
- }(),
- function () {
- FZ.Math = {
- lerp: function (a, b, c) {
- a = a < 0 ? 0 : a > 1 ? 1 : a;
- return c * a + (1 - a) * b
- },
- random: function (a, b) {
- return FZ.Math.lerp(Math.random(), a, b)
- },
- clamp: function (a, b, c) {
- return a < b ? b : a > c ? c : a
- },
- round: function (a, b) {
- b = Math.pow(10, b || 0);
- return Math.round(a * b) / b
- },
- Vector2: FZ.newClass({
- x: 0,
- y: 0,
- init: function (a, b) {
- b !== undefined && (this.x = a ? a : 0, this.y = b ? b : 0)
- },
- clone: function () {
- return new FZ.Math.Vector2(this.x, this.y)
- },
- add: function (a, b) {
- b === undefined && (b = new FZ.Math.Vector2), b.x = this.x + a.x, b.y = this.y + a.y;
- return b
- },
- sub: function (a, b) {
- b === undefined && (b = new FZ.Math.Vector2), b.x = this.x - a.x, b.y = this.y - a.y;
- return b
- },
- normalize: function (a) {
- a === undefined && (a = new FZ.Math.Vector2);
- var b = 1 / this.length();
- a.x = this.x * b, a.y = this.y * b;
- return a
- },
- scale: function (a, b) {
- b === undefined && (b = new FZ.Math.Vector2), b.x = this.x * a, b.y = this.y * a;
- return b
- },
- applyTransform: function (a, b) {
- b === undefined && (b = new FZ.Math.Vector2), tx = a.m11 * this.x + a.m21 * this.y + a.dx, ty = a.m12 * this.x + a.m22 * this.y + a.dy, b.x = tx, b.y = ty;
- return b
- },
- dot: function (a) {
- return this.x * a.x + this.y * a.y
- },
- length: function () {
- return Math.sqrt(this.x * this.x + this.y * this.y)
- },
- lengthSquared: function () {
- return this.x * this.x + this.y * this.y
- }
- }),
- Matrix3: FZ.newClass({
- m11: 1,
- m21: 0,
- dx: 0,
- m12: 0,
- m22: 1,
- dy: 0,
- set: function (a, b, c, d, e, f) {
- this.m11 = a, this.m21 = c, this.dx = e, this.m12 = b, this.m22 = d, this.dy = f;
- return this
- },
- clone: function () {
- var a = new FZ.Math.Matrix3;
- a.m11 = this.m11, a.m21 = this.m21, a.m12 = this.m12, a.m22 = this.m22, a.dx = this.dx, a.dy = this.dy;
- return a
- },
- identity: function () {
- this.m11 = 1, this.m21 = 0, this.dx = 0, this.m12 = 0, this.m22 = 1, this.dy = 0;
- return this
- },
- mul: function (a, b) {
- b === undefined && (b = new FZ.Math.Matrix3);
- var c = this.m11 * a.m11 + this.m21 * a.m12,
- d = this.m11 * a.m21 + this.m21 * a.m22,
- e = this.m12 * a.m11 + this.m22 * a.m12,
- f = this.m12 * a.m21 + this.m22 * a.m22,
- g = this.dx + this.m11 * a.dx + this.m21 * a.dx,
- h = this.dy + this.m12 * a.dx + this.m22 * a.dy;
- b.m11 = c, b.m21 = d, b.m12 = e, b.m22 = f, b.dx = g, b.dy = h;
- return b
- },
- makeRotate: function (a) {
- var b = Math.sin(a),
- c = Math.cos(a);
- this.m11 = c, this.m21 = -b, this.m12 = b, this.m22 = c;
- return this
- },
- rotate: function (a) {
- var b = Math.sin(a),
- c = Math.cos(a),
- d = this.m11 * c + this.m21 * b,
- e = -this.m11 * b + this.m21 * c,
- f = this.m12 * c + this.m22 * b,
- g = -this.m12 * b + this.m22 * c;
- this.m11 = d, this.m21 = e, this.m12 = f, this.m22 = g;
- return this
- },
- makeScale1: function (a) {
- return this.makeScale2(a, a)
- },
- scale1: function (a) {
- return this.scale2(a, a)
- },
- makeScale2: function (a, b) {
- this.m11 = a, this.m22 = b, this.m12 = 0, this.m21 = 0;
- return this
- },
- scale2: function (a, b) {
- this.m11 *= a, this.m21 *= b, this.m12 *= a, this.m22 *= b;
- return this
- },
- makeTranslate: function (a, b) {
- this.dx = a, this.dy = b;
- return this
- },
- translate: function (a, b) {
- this.dx += this.m11 * a + this.m21 * b, this.dy += this.m12 * a + this.m22 * b;
- return this
- },
- inverseAffine: function (a) {
- a === undefined && (a = new FZ.Math.Matrix3);
- var b = 1 / (this.m11 * this.m22 - this.m21 * this.m12),
- c = this.m22 * b,
- d = this.m12 * b,
- e = this.m21 * b,
- f = this.m11 * b,
- g = -(c * this.dx + d * this.dy),
- h = -(e * this.dx + f * this.dy);
- a.m11 = c, a.m21 = d, a.m12 = e, a.m22 = f, a.dx = g, a.dy = h;
- return a
- }
- })
- }
- }(),
- function () {
- function f(a) {
- return a < 10 ? "0" + a : a
- }
- function str(a, b) {
- var c, d, e, f, g = gap,
- h, i = b[a];
- i && typeof i == "object" && typeof i.toJSON == "function" && (i = i.toJSON(a)), typeof rep == "function" && (i = rep.call(b, a, i));
- switch (typeof i) {
- case "string":
- return quote(i);
- case "number":
- return isFinite(i) ? String(i) : "null";
- case "boolean":
- case "null":
- return String(i);
- case "object":
- if (!i) return "null";
- gap += indent, h = [];
- if (Object.prototype.toString.apply(i) === "[object Array]") {
- f = i.length;
- for (c = 0; c < f; c += 1) h[c] = str(c, i) || "null";
- e = h.length === 0 ? "[]" : gap ? "[\n" + gap + h.join(",\n" + gap) + "\n" + g + "]" : "[" + h.join(",") + "]", gap = g;
- return e
- }
- if (rep && typeof rep == "object") {
- f = rep.length;
- for (c = 0; c < f; c += 1) d = rep[c], typeof d == "string" && (e = str(d, i), e && h.push(quote(d) + (gap ? ": " : ":") + e))
- } else
- for (d in i) Object.hasOwnProperty.call(i, d) && (e = str(d, i), e && h.push(quote(d) + (gap ? ": " : ":") + e));
- e = h.length === 0 ? "{}" : gap ? "{\n" + gap + h.join(",\n" + gap) + "\n" + g + "}" : "{" + h.join(",") + "}", gap = g;
- return e
- }
- }
- function quote(a) {
- escapable.lastIndex = 0;
- return escapable.test(a) ? '"' + a.replace(escapable, function (a) {
- var b = meta[a];
- return typeof b == "string" ? b : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4)
- }) + '"' : '"' + a + '"'
- }
- FZ.JSON = {
- parse: function (text, reviver) {
- function walk(a, b) {
- var c, d, e = a[b];
- if (e && typeof e == "object")
- for (c in e) Object.hasOwnProperty.call(e, c) && (d = walk(e, c), d !== undefined ? e[c] = d : delete e[c]);
- return reviver.call(a, b, e)
- }
- var j;
- text = String(text), cx.lastIndex = 0, cx.test(text) && (text = text.replace(cx, function (a) {
- return "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4)
- }));
- if (/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) {
- j = eval("(" + text + ")");
- return typeof reviver == "function" ? walk({
- "": j
- }, "") : j
- }
- throw new SyntaxError("JSON.parse")
- },
- stringify: function (a, b, c) {
- var d;
- gap = "", indent = "";
- if (typeof c == "number")
- for (d = 0; d < c; d += 1) indent += " ";
- else typeof c == "string" && (indent = c);
- rep = b;
- if (b && typeof b != "function" && (typeof b != "object" || typeof b.length != "number")) throw new Error("JSON.stringify");
- return str("", {
- "": a
- })
- }
- };
- var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
- escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
- gap, indent, meta = {
- "\b": "\\b",
- "\t": "\\t",
- "\n": "\\n",
- "\f": "\\f",
- "\r": "\\r",
- '"': '\\"',
- "\\": "\\\\"
- }, rep;
- typeof Date.prototype.toJSON != "function" && (Date.prototype.toJSON = function (a) {
- return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds()) + "Z" : null
- }, String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function (a) {
- return this.valueOf()
- })
- }(),
- function () {
- FZ.ArrayIndexof = function (a, b) {
- var c = 0;
- for (c = 0; c < a.length; c++)
- if (b === a[c]) return c;
- return -1
- }, FZ.ControlManager = {
- m_monitor_list: [],
- Mouse: {
- x: 0,
- y: 0,
- leftKey: !1,
- middleKey: !1,
- rightKey: !1
- },
- MouseMove: function (a) {
- a.offsetX ? (this.Mouse.x = a.offsetX, this.Mouse.y = a.offsetY) : a.layerX && (this.Mouse.x = a.layerX - FZ.GameBase.MainCanvas.offsetLeft, this.Mouse.y = a.layerY - FZ.GameBase.MainCanvas.offsetTop)
- },
- MouseUp: function (a) {
- if (a.button === 0) {
- this.Mouse.leftKey = !1;
- for (var b = 0; b < this.m_monitor_list.length; b++) {
- var c = this.m_monitor_list[b];
- c && c.CustomMouseUp && c.CustomMouseUp(this.Mouse)
- }
- }
- },
- MouseDown: function (a) {
- if (a.button === 0) {
- this.Mouse.leftKey = !0;
- for (var b = 0; b < this.m_monitor_list.length; b++) {
- var c = this.m_monitor_list[b];
- c && c.CustomMouseDown && c.CustomMouseDown(this.Mouse)
- }
- }
- },
- addMonitor: function (a) {
- var b = FZ.ArrayIndexof(this.m_monitor_list, a); - 1 === b && this.m_monitor_list.push(a)
- },
- removeMonitor: function (a) {
- var b = FZ.ArrayIndexof(this.m_monitor_list, a); - 1 !== b && this.m_monitor_list.splice(b, 1)
- },
- clearMonitor: function () {
- while (this.m_monitor_list.length > 0) this.m_monitor_list.pop()
- }
- }
- }(),
- function () {
- FZ.Music = {
- theAudio: null,
- theIntervalId: 0,
- isMute: !1,
- set: function (a, b) {
- this.loop = Boolean(b), this.theAudio = a, a.loop = b
- },
- setMute: function (a) {
- this.isMute = a, this.isMute ? this.stop() : this.play()
- },
- play: function () {
- this.isMute || (this.stop(), this.theAudio.play(), this.theAudio.duration && (this.loop ? this.theIntervalId = window.setInterval(this.replay, Math.floor(this.theAudio.duration * 1e3) - 1e3) : window.setTimeout(function () {
- this.theAudio.pause();
- try {
- this.theAudio.currentTime = 0
- } catch (a) {}
- }, Math.floor(this.theAudio.duration * 1e3) - 1e3)))
- },
- stop: function () {
- if ( !! this.theAudio) {
- this.theAudio.pause();
- try {
- this.theAudio.currentTime = 0
- } catch (a) {}
- window.clearInterval(this.theIntervalId)
- }
- },
- replay: function () {
- FZ.Music.stop(), FZ.Music.play()
- },
- pageHide: function (a) {
- FZ.Music.theAudio && FZ.Music.stop()
- },
- pageShow: function (a) {
- FZ.Music.theAudio && FZ.Music.play()
- }
- }, window.addEventListener("pagehide", FZ.Music.pageHide, !1), window.addEventListener("pageshow", FZ.Music.pageShow, !1)
- }(),
- function () {
- FZ.StateDefs = {
- STATE_UNKNOW: -1,
- STATE_INIT: 5,
- STATE_LOAD: 10,
- STATE_NORMAL: 15,
- STATE_HIDE: 20,
- STATE_SHOW_NO_LOGIC: 25,
- STATE_UNLOAD: 30,
- STATE_DESTROY: 35,
- GAME_STATE_UNKNOW: "",
- GAME_STATE_PRELOADING: "gamepreloading",
- GAME_STATE_LOADING: "gameloading",
- GAME_STATE_LOGO: "gamelogo",
- GAME_STATE_MAINMEN: "gamemainmenu",
- GAME_STATE_GAME_IN: "gamein",
- GAME_STATE_GAME_CLEAR: "gameclear",
- GAME_STATE_OVER: "gameover",
- GAME_STATE_RESET: "gamereset",
- GAME_STATE_NEXT_LEVEL: "gamenextlevel",
- GAME_STATE_GAME_WIN: "gamewin",
- GAME_STATE_CREDITS: "gamecredits",
- GAME_STATE_HELP: "gamehelp"
- }
- }(),
- function () {
- FZ.IphoneMusic = ["res/music/htmlMahjong.mp3"], FZ.IphoneUI = [{
- name: "ARROW_CENTER",
- zOrder: 3,
- fileURL: "ARROW_CENTER.png",
- x: 0,
- y: 0,
- w: 149,
- h: 156,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "ARROW_DOWN",
- zOrder: 3,
- fileURL: "ARROW_DOWN.png",
- x: 137,
- y: 112,
- w: 43,
- h: 258,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "ARROW_LEFT",
- zOrder: 3,
- fileURL: "ARROW_LEFT.png",
- x: 64,
- y: 214,
- w: 188,
- h: 43,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "ARROW_LEFT_RIGHT",
- zOrder: 3,
- fileURL: "ARROW_LEFT_RIGHT.png",
- x: 64,
- y: 213,
- w: 191,
- h: 43,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "ARROW_RIGHT",
- zOrder: 3,
- fileURL: "ARROW_RIGHT.png",
- x: 68,
- y: 214,
- w: 188,
- h: 43,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "ARROW_UP",
- zOrder: 3,
- fileURL: "ARROW_UP.png",
- x: 136,
- y: 113,
- w: 44,
- h: 258,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "ARROW_UP_DOWN",
- zOrder: 3,
- fileURL: "ARROW_UP_DOWN.png",
- x: 137,
- y: 121,
- w: 43,
- h: 241,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "BTN_GAME_NO",
- zOrder: 4,
- fileURL: "BTN_GAME_NO.png",
- x: 84,
- y: 258,
- w: 158,
- h: 45,
- tags: ["quit"],
- cols: 1
- }, {
- name: "BTN_CLEAR_GAME_NO",
- zOrder: 4,
- fileURL: "BTN_GAME_NO.png",
- x: 84,
- y: 331,
- w: 158,
- h: 45,
- tags: ["ClearGame"],
- cols: 1
- }, {
- name: "BTN_GAME_NO_TOUCH",
- zOrder: 4,
- fileURL: "BTN_GAME_NO_TOUCH.png",
- x: 84,
- y: 258,
- w: 158,
- h: 45,
- tags: ["quit"],
- cols: 1
- }, {
- name: "BTN_CLEAR_GAME_NO_TOUCH",
- zOrder: 4,
- fileURL: "BTN_GAME_NO_TOUCH.png",
- x: 84,
- y: 331,
- w: 158,
- h: 45,
- tags: ["ClearGame"],
- cols: 1
- }, {
- name: "BTN_GAME_YES",
- zOrder: 4,
- fileURL: "BTN_GAME_YES.png",
- x: 84,
- y: 208,
- w: 158,
- h: 46,
- tags: ["quit"],
- cols: 1
- }, {
- name: "BTN_CLEAR_GAME_YES",
- zOrder: 4,
- fileURL: "BTN_GAME_YES.png",
- x: 84,
- y: 281,
- w: 158,
- h: 46,
- tags: ["ClearGame"],
- cols: 1
- }, {
- name: "BTN_GAME_YES_TOUCH",
- zOrder: 0,
- fileURL: "BTN_GAME_YES_TOUCH.png",
- x: 84,
- y: 208,
- w: 158,
- h: 46,
- tags: ["quit"],
- cols: 1
- }, {
- name: "BTN_CLEAR_GAME_YES_TOUCH",
- zOrder: 4,
- fileURL: "BTN_GAME_YES_TOUCH.png",
- x: 83,
- y: 281,
- w: 158,
- h: 46,
- tags: ["ClearGame"],
- cols: 1
- }, {
- name: "BTN_HINT",
- zOrder: 3,
- fileURL: "BTN_HINT.png",
- x: 218,
- y: 31,
- w: 39,
- h: 40,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "BTN_HINT_GREY",
- zOrder: 2,
- fileURL: "BTN_HINT_GREY.png",
- x: 218,
- y: 31,
- w: 39,
- h: 40,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "BTN_HINT_TOUCH",
- zOrder: 2,
- fileURL: "BTN_HINT_TOUCH.png",
- x: 218,
- y: 31,
- w: 39,
- h: 40,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "BTN_MAIN_MENU",
- zOrder: 4,
- fileURL: "BTN_MAIN_MENU.png",
- x: 85,
- y: 360,
- w: 160,
- h: 45,
- tags: ["win"],
- cols: 1
- }, {
- name: "BTN_MAIN_MENU_ICON",
- zOrder: 2,
- fileURL: "BTN_MAIN_MENU_ICON.png",
- x: 212,
- y: 34,
- w: 41,
- h: 38,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "BTN_MAIN_MENU_TOUCH",
- zOrder: 4,
- fileURL: "BTN_MAIN_MENU_TOUCH.png",
- x: 85,
- y: 360,
- w: 160,
- h: 45,
- tags: ["win"],
- cols: 1
- }, {
- name: "BTN_MAIN_MENU_ICON_TOUCH",
- zOrder: 2,
- fileURL: "BTN_MAIN_MENU_ICON_TOUCH.png",
- x: 212,
- y: 34,
- w: 41,
- h: 38,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "BTN_NEXT_LEVEL",
- zOrder: 4,
- fileURL: "BTN_NEXT_LEVEL.png",
- x: 79,
- y: 272,
- w: 158,
- h: 45,
- tags: ["NextLevel"],
- cols: 1
- }, {
- name: "BTN_NEXT_LEVEL_TOUCH",
- zOrder: 4,
- fileURL: "BTN_NEXT_LEVEL_TOUCH.png",
- x: 79,
- y: 272,
- w: 158,
- h: 45,
- tags: ["NextLevel"],
- cols: 1
- }, {
- name: "BTN_PAUSE",
- zOrder: 2,
- fileURL: "BTN_PAUSE.png",
- x: 268,
- y: 33,
- w: 39,
- h: 39,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "BTN_START",
- zOrder: 2,
- fileURL: "BTN_PAUSE_START.png",
- x: 268,
- y: 33,
- w: 39,
- h: 39,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "BTN_START_TOUCH",
- zOrder: 2,
- fileURL: "BTN_PAUSE_START_TOUCH.png",
- x: 268,
- y: 33,
- w: 39,
- h: 39,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "BTN_PAUSE_TOUCH",
- zOrder: 2,
- fileURL: "BTN_PAUSE_TOUCH.png",
- x: 268,
- y: 33,
- w: 39,
- h: 39,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "BTN_RETRY",
- zOrder: 4,
- fileURL: "BTN_RETRY.png",
- x: 90,
- y: 267,
- w: 158,
- h: 45,
- tags: ["over"],
- cols: 1
- }, {
- name: "BTN_RETRY_TOUCH",
- zOrder: 4,
- fileURL: "BTN_RETRY_TOUCH.png",
- x: 90,
- y: 267,
- w: 158,
- h: 45,
- tags: ["over"],
- cols: 1
- }, {
- name: "BTN_SOUND",
- zOrder: 2,
- fileURL: "BTN_SOUND.png",
- x: 177,
- y: 33,
- w: 42,
- h: 35,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "BTN_MENU_SOUND",
- zOrder: 2,
- fileURL: "BTN_SOUND.png",
- x: 259,
- y: 22,
- w: 42,
- h: 35,
- tags: ["MainMenu"],
- cols: 1
- }, {
- name: "BTN_SOUND_OFF",
- zOrder: 2,
- fileURL: "BTN_SOUND_OFF.png",
- x: 177,
- y: 33,
- w: 42,
- h: 35,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "BTN_MENU_SOUND_OFF",
- zOrder: 2,
- fileURL: "BTN_SOUND_OFF.png",
- x: 259,
- y: 22,
- w: 42,
- h: 35,
- tags: ["MainMenu"],
- cols: 1
- }, {
- name: "BTN_SOUND_OFF_TOUCH",
- zOrder: 2,
- fileURL: "BTN_SOUND_OFF_TOUCH.png",
- x: 177,
- y: 33,
- w: 42,
- h: 35,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "BTN_MENU_SOUND_OFF_TOUCH",
- zOrder: 2,
- fileURL: "BTN_SOUND_OFF_TOUCH.png",
- x: 259,
- y: 22,
- w: 42,
- h: 35,
- tags: ["MainMenu"],
- cols: 1
- }, {
- name: "BTN_SOUND_TOUCH",
- zOrder: 2,
- fileURL: "BTN_SOUND_TOUCH.png",
- x: 177,
- y: 33,
- w: 42,
- h: 35,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "BTN_MENU_SOUND_TOUCH",
- zOrder: 2,
- fileURL: "BTN_SOUND_TOUCH.png",
- x: 259,
- y: 22,
- w: 42,
- h: 35,
- tags: ["MainMenu"],
- cols: 1
- }, {
- name: "BTN_GAME_START",
- zOrder: 2,
- fileURL: "BTN_START.png",
- x: 93,
- y: 264,
- w: 149,
- h: 63,
- tags: ["MainMenu"],
- cols: 1
- }, {
- name: "BTN_GAME_START_TOUCH",
- zOrder: 2,
- fileURL: "BTN_START_TOUCH.png",
- x: 93,
- y: 264,
- w: 149,
- h: 63,
- tags: ["MainMenu"],
- cols: 1
- }, {
- name: "BTN_GAME_CONTINUE",
- zOrder: 2,
- fileURL: "BTN_CONTINUE.png",
- x: 95,
- y: 330,
- w: 149,
- h: 63,
- tags: ["MainMenu"],
- cols: 1
- }, {
- name: "BTN_GAME_CONTINUE_TOUCH",
- zOrder: 2,
- fileURL: "BTN_CONTINUE_TOUCH.png",
- x: 95,
- y: 330,
- w: 149,
- h: 63,
- tags: ["MainMenu"],
- cols: 1
- }, {
- name: "game_in_BG",
- zOrder: 1,
- fileURL: "game_in_BG.png",
- x: 0,
- y: 0,
- w: 321,
- h: 479,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "loading_empty",
- zOrder: 2,
- fileURL: "loading_empty.png",
- x: 26,
- y: 286,
- w: 270,
- h: 46,
- tags: ["Loading"],
- cols: 1
- }, {
- name: "loading_full",
- zOrder: 3,
- fileURL: "loading_full.png",
- x: 26,
- y: 286,
- w: 270,
- h: 46,
- tags: ["Loading"],
- cols: 1
- }, {
- name: "LOADING_BG",
- zOrder: 2,
- fileURL: "MAIN_MENU_AND_LOADING_BG.png",
- x: 0,
- y: 0,
- w: 318,
- h: 426,
- tags: ["Loading"],
- cols: 1
- }, {
- name: "MAIN_MENU_BG",
- zOrder: 1,
- fileURL: "MAIN_MENU_AND_LOADING_BG.png",
- x: 0,
- y: 0,
- w: 318,
- h: 426,
- tags: ["MainMenu"],
- cols: 1
- }, {
- name: "majong_BG",
- zOrder: 0,
- fileURL: "majong_BG.png",
- x: 0,
- y: 0,
- w: 320,
- h: 480,
- tags: ["Loading"],
- cols: 1
- }, {
- name: "majong_BG_GAME",
- zOrder: 0,
- fileURL: "majong_BG.png",
- x: 0,
- y: 0,
- w: 320,
- h: 480,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "majong_BG_MAINMENU",
- zOrder: 0,
- fileURL: "majong_BG.png",
- x: 0,
- y: 0,
- w: 320,
- h: 480,
- tags: ["MainMenu"],
- cols: 1
- }, {
- name: "NEXT_LEVEL_BG",
- zOrder: 3,
- fileURL: "NEXT_LEVEL_BG.png",
- x: 3,
- y: 107,
- w: 314,
- h: 228,
- tags: ["NextLevel", "over", "quit"],
- cols: 1
- }, {
- name: "DIALOG_BG_CLEAR_GAME",
- zOrder: 3,
- fileURL: "NEXT_LEVEL_BG.png",
- x: 3,
- y: 170,
- w: 314,
- h: 228,
- tags: ["ClearGame"],
- cols: 1
- }, {
- name: "NO_MORE_MATCHS",
- zOrder: 5,
- fileURL: "NO_MORE_MATCHS.png",
- x: 27,
- y: 188,
- w: 272,
- h: 99,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "NUM_STAGE_1",
- zOrder: 4,
- fileURL: "NUM_0.png",
- x: 138,
- y: 206,
- w: 18,
- h: 22,
- tags: ["NextLevel"],
- cols: 1
- }, {
- name: "NUM_STAGE_WIN_1",
- zOrder: 4,
- fileURL: "NUM_0.png",
- x: 138,
- y: 206,
- w: 18,
- h: 22,
- tags: ["win"],
- cols: 1
- }, {
- name: "NUM_STAGE_2",
- zOrder: 4,
- fileURL: "NUM_0.png",
- x: 149,
- y: 206,
- w: 18,
- h: 22,
- tags: ["NextLevel"],
- cols: 1
- }, {
- name: "NUM_STAGE_WIN_2",
- zOrder: 4,
- fileURL: "NUM_0.png",
- x: 149,
- y: 206,
- w: 18,
- h: 22,
- tags: ["win"],
- cols: 1
- }, {
- name: "NUM_STAGE_3",
- zOrder: 4,
- fileURL: "NUM_0.png",
- x: 160,
- y: 206,
- w: 18,
- h: 22,
- tags: ["NextLevel"],
- cols: 1
- }, {
- name: "NUM_STAGE_WIN_3",
- zOrder: 4,
- fileURL: "NUM_0.png",
- x: 160,
- y: 206,
- w: 18,
- h: 22,
- tags: ["win"],
- cols: 1
- }, {
- name: "NUM_STAGE_4",
- zOrder: 4,
- fileURL: "NUM_0.png",
- x: 171,
- y: 206,
- w: 18,
- h: 22,
- tags: ["NextLevel"],
- cols: 1
- }, {
- name: "NUM_STAGE_WIN_4",
- zOrder: 4,
- fileURL: "NUM_0.png",
- x: 171,
- y: 206,
- w: 18,
- h: 22,
- tags: ["win"],
- cols: 1
- }, {
- name: "NUM_STAGE_TOTAL_1",
- zOrder: 4,
- fileURL: "NUM_0.png",
- x: 132,
- y: 254,
- w: 18,
- h: 22,
- tags: ["NextLevel"],
- cols: 1
- }, {
- name: "NUM_STAGE_OVER_TOTAL_1",
- zOrder: 4,
- fileURL: "NUM_0.png",
- x: 132,
- y: 234,
- w: 18,
- h: 22,
- tags: ["over"],
- cols: 1
- }, {
- name: "NUM_STAGE_WIN_TOTAL_1",
- zOrder: 4,
- fileURL: "NUM_0.png",
- x: 132,
- y: 257,
- w: 18,
- h: 22,
- tags: ["win"],
- cols: 1
- }, {
- name: "NUM_STAGE_TOTAL_2",
- zOrder: 4,
- fileURL: "NUM_0.png",
- x: 143,
- y: 254,
- w: 18,
- h: 22,
- tags: ["NextLevel"],
- cols: 1
- }, {
- name: "NUM_STAGE_OVER_TOTAL_2",
- zOrder: 4,
- fileURL: "NUM_0.png",
- x: 143,
- y: 234,
- w: 18,
- h: 22,
- tags: ["over"],
- cols: 1
- }, {
- name: "NUM_STAGE_WIN_TOTAL_2",
- zOrder: 4,
- fileURL: "NUM_0.png",
- x: 143,
- y: 257,
- w: 18,
- h: 22,
- tags: ["win"],
- cols: 1
- }, {
- name: "NUM_STAGE_TOTAL_3",
- zOrder: 4,
- fileURL: "NUM_0.png",
- x: 154,
- y: 254,
- w: 18,
- h: 22,
- tags: ["NextLevel"],
- cols: 1
- }, {
- name: "NUM_STAGE_OVER_TOTAL_3",
- zOrder: 4,
- fileURL: "NUM_0.png",
- x: 154,
- y: 234,
- w: 18,
- h: 22,
- tags: ["over"],
- cols: 1
- }, {
- name: "NUM_STAGE_WIN_TOTAL_3",
- zOrder: 4,
- fileURL: "NUM_0.png",
- x: 154,
- y: 257,
- w: 18,
- h: 22,
- tags: ["win"],
- cols: 1
- }, {
- name: "NUM_STAGE_TOTAL_4",
- zOrder: 4,
- fileURL: "NUM_0.png",
- x: 165,
- y: 254,
- w: 18,
- h: 22,
- tags: ["NextLevel"],
- cols: 1
- }, {
- name: "NUM_STAGE_WIN_TOTAL_4",
- zOrder: 4,
- fileURL: "NUM_0.png",
- x: 165,
- y: 257,
- w: 18,
- h: 22,
- tags: ["win"],
- cols: 1
- }, {
- name: "NUM_STAGE_OVER_TOTAL_4",
- zOrder: 4,
- fileURL: "NUM_0.png",
- x: 165,
- y: 234,
- w: 18,
- h: 22,
- tags: ["over"],
- cols: 1
- }, {
- name: "NUM_STAGE_TOTAL_5",
- zOrder: 4,
- fileURL: "NUM_0.png",
- x: 176,
- y: 254,
- w: 18,
- h: 22,
- tags: ["NextLevel"],
- cols: 1
- }, {
- name: "NUM_STAGE_WIN_TOTAL_5",
- zOrder: 4,
- fileURL: "NUM_0.png",
- x: 176,
- y: 257,
- w: 18,
- h: 22,
- tags: ["win"],
- cols: 1
- }, {
- name: "NUM_STAGE_OVER_TOTAL_5",
- zOrder: 4,
- fileURL: "NUM_0.png",
- x: 176,
- y: 234,
- w: 18,
- h: 22,
- tags: ["over"],
- cols: 1
- }, {
- name: "NUM_1",
- zOrder: 4,
- fileURL: "NUM_1.png",
- x: 0,
- y: 0,
- w: 18,
- h: 22,
- tags: ["NextLevel"],
- cols: 1
- }, {
- name: "NUM_2",
- zOrder: 4,
- fileURL: "NUM_2.png",
- x: 0,
- y: 0,
- w: 18,
- h: 22,
- tags: ["NextLevel"],
- cols: 1
- }, {
- name: "NUM_3",
- zOrder: 4,
- fileURL: "NUM_3.png",
- x: 0,
- y: 0,
- w: 18,
- h: 22,
- tags: ["NextLevel"],
- cols: 1
- }, {
- name: "NUM_4",
- zOrder: 4,
- fileURL: "NUM_4.png",
- x: 0,
- y: 0,
- w: 18,
- h: 22,
- tags: ["NextLevel"],
- cols: 1
- }, {
- name: "NUM_5",
- zOrder: 4,
- fileURL: "NUM_5.png",
- x: 0,
- y: 0,
- w: 18,
- h: 22,
- tags: ["NextLevel"],
- cols: 1
- }, {
- name: "NUM_6",
- zOrder: 4,
- fileURL: "NUM_6.png",
- x: 0,
- y: 0,
- w: 18,
- h: 22,
- tags: ["NextLevel"],
- cols: 1
- }, {
- name: "NUM_7",
- zOrder: 4,
- fileURL: "NUM_7.png",
- x: 0,
- y: 0,
- w: 18,
- h: 22,
- tags: ["NextLevel"],
- cols: 1
- }, {
- name: "NUM_8",
- zOrder: 4,
- fileURL: "NUM_8.png",
- x: 0,
- y: 0,
- w: 18,
- h: 22,
- tags: ["NextLevel"],
- cols: 1
- }, {
- name: "NUM_9",
- zOrder: 4,
- fileURL: "NUM_9.png",
- x: 0,
- y: 0,
- w: 18,
- h: 22,
- tags: ["NextLevel"],
- cols: 1
- }, {
- name: "NUM_LEVEL_0",
- zOrder: 3,
- fileURL: "NUM_LEVEL_0.png",
- x: 73,
- y: 32,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "number_score_1",
- zOrder: 3,
- fileURL: "NUM_LEVEL_0.png",
- x: 110,
- y: 31,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "number_score_2",
- zOrder: 3,
- fileURL: "NUM_LEVEL_0.png",
- x: 121,
- y: 31,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "number_score_3",
- zOrder: 3,
- fileURL: "NUM_LEVEL_0.png",
- x: 132,
- y: 31,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "number_score_4",
- zOrder: 3,
- fileURL: "NUM_LEVEL_0.png",
- x: 143,
- y: 31,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "number_score_5",
- zOrder: 3,
- fileURL: "NUM_LEVEL_0.png",
- x: 154,
- y: 31,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "number_hint_0",
- zOrder: 3,
- fileURL: "NUM_LEVEL_0.png",
- x: 256,
- y: 57,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "number_hint_1",
- zOrder: 3,
- fileURL: "NUM_LEVEL_1.png",
- x: 256,
- y: 57,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "number_hint_2",
- zOrder: 3,
- fileURL: "NUM_LEVEL_2.png",
- x: 256,
- y: 57,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "number_hint_3",
- zOrder: 3,
- fileURL: "NUM_LEVEL_3.png",
- x: 256,
- y: 57,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "number_hint_4",
- zOrder: 3,
- fileURL: "NUM_LEVEL_4.png",
- x: 256,
- y: 57,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "number_hint_5",
- zOrder: 3,
- fileURL: "NUM_LEVEL_5.png",
- x: 256,
- y: 57,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "number_hint_6",
- zOrder: 3,
- fileURL: "NUM_LEVEL_6.png",
- x: 256,
- y: 57,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "number_hint_7",
- zOrder: 3,
- fileURL: "NUM_LEVEL_7.png",
- x: 256,
- y: 57,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "number_hint_8",
- zOrder: 3,
- fileURL: "NUM_LEVEL_8.png",
- x: 256,
- y: 57,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "number_hint_9",
- zOrder: 3,
- fileURL: "NUM_LEVEL_9.png",
- x: 256,
- y: 57,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "number_hint_clone_0",
- zOrder: 3,
- fileURL: "NUM_LEVEL_0.png",
- x: 246,
- y: 57,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "number_hint_clone_1",
- zOrder: 3,
- fileURL: "NUM_LEVEL_1.png",
- x: 246,
- y: 57,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "number_hint_clone_2",
- zOrder: 3,
- fileURL: "NUM_LEVEL_2.png",
- x: 246,
- y: 57,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "number_hint_clone_3",
- zOrder: 3,
- fileURL: "NUM_LEVEL_3.png",
- x: 246,
- y: 57,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "number_hint_clone_4",
- zOrder: 3,
- fileURL: "NUM_LEVEL_4.png",
- x: 246,
- y: 57,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "number_hint_clone_5",
- zOrder: 3,
- fileURL: "NUM_LEVEL_5.png",
- x: 246,
- y: 57,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "number_hint_clone_6",
- zOrder: 3,
- fileURL: "NUM_LEVEL_6.png",
- x: 246,
- y: 57,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "number_hint_clone_7",
- zOrder: 3,
- fileURL: "NUM_LEVEL_7.png",
- x: 246,
- y: 57,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "number_hint_clone_8",
- zOrder: 3,
- fileURL: "NUM_LEVEL_8.png",
- x: 246,
- y: 57,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "number_hint_clone_9",
- zOrder: 3,
- fileURL: "NUM_LEVEL_9.png",
- x: 246,
- y: 57,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "NUM_LEVEL_1",
- zOrder: 0,
- fileURL: "NUM_LEVEL_1.png",
- x: 0,
- y: 0,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "NUM_LEVEL_2",
- zOrder: 0,
- fileURL: "NUM_LEVEL_2.png",
- x: 0,
- y: 0,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "NUM_LEVEL_3",
- zOrder: 0,
- fileURL: "NUM_LEVEL_3.png",
- x: 0,
- y: 0,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "NUM_LEVEL_4",
- zOrder: 0,
- fileURL: "NUM_LEVEL_4.png",
- x: 0,
- y: 0,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "NUM_LEVEL_5",
- zOrder: 0,
- fileURL: "NUM_LEVEL_5.png",
- x: 0,
- y: 0,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "NUM_LEVEL_6",
- zOrder: 0,
- fileURL: "NUM_LEVEL_6.png",
- x: 0,
- y: 0,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "NUM_LEVEL_7",
- zOrder: 0,
- fileURL: "NUM_LEVEL_7.png",
- x: 0,
- y: 0,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "NUM_LEVEL_8",
- zOrder: 0,
- fileURL: "NUM_LEVEL_8.png",
- x: 0,
- y: 0,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "NUM_LEVEL_9",
- zOrder: 0,
- fileURL: "NUM_LEVEL_9.png",
- x: 0,
- y: 0,
- w: 13,
- h: 14,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "OrientationWarning",
- zOrder: 0,
- fileURL: "OrientationWarning.png",
- x: 0,
- y: 3,
- w: 250,
- h: 250,
- tags: [],
- cols: 1
- }, {
- name: "PAUSE_BG",
- zOrder: 3,
- fileURL: "PAUSE_BG.png",
- x: 13,
- y: 78,
- w: 290,
- h: 354,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "splash",
- zOrder: 0,
- fileURL: "splash.png",
- x: 0,
- y: 48,
- w: 320,
- h: 320,
- tags: ["Logo"],
- cols: 1
- }, {
- name: "TIME_EMPTY",
- zOrder: 2,
- fileURL: "TIME_EMPTY.png",
- x: 35,
- y: 53,
- w: 137,
- h: 18,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "TIME__FULL",
- zOrder: 2,
- fileURL: "TIME__FULL.png",
- x: 35,
- y: 53,
- w: 137,
- h: 18,
- tags: ["GameIn"],
- cols: 1
- }, {
- name: "TXT_ARE_YOU_SURE",
- zOrder: 4,
- fileURL: "TXT_ARE_YOU_SURE.png",
- x: 46,
- y: 142,
- w: 229,
- h: 57,
- tags: ["quit"],
- cols: 1
- }, {
- name: "STR_SURE_CLEAR_GAME",
- zOrder: 3,
- fileURL: "TXT_CLEAR_THE_DATE.png",
- x: 37,
- y: 198,
- w: 246,
- h: 77,
- tags: ["ClearGame"],
- cols: 1
- }, {
- name: "TXT_GAME_OVER",
- zOrder: 4,
- fileURL: "TXT_GAME_OVER.png",
- x: 62,
- y: 150,
- w: 196,
- h: 33,
- tags: ["over"],
- cols: 1
- }, {
- name: "TXT_LEVEL_CLEAR",
- zOrder: 4,
- fileURL: "TXT_LEVEL_CLEAR.png",
- x: 52,
- y: 141,
- w: 220,
- h: 33,
- tags: ["NextLevel"],
- cols: 1
- }, {
- name: "TXT_STAGE_SCORE",
- zOrder: 4,
- fileURL: "TXT_STAGE_SCORE.png",
- x: 82,
- y: 179,
- w: 150,
- h: 26,
- tags: ["NextLevel"],
- cols: 1
- }, {
- name: "TXT_TOTAL_SCORE",
- zOrder: 4,
- fileURL: "TXT_TOTAL_SCORE.png",
- x: 83,
- y: 229,
- w: 149,
- h: 26,
- tags: ["NextLevel"],
- cols: 1
- }, {
- name: "TXT_WIN_STAGE_SCORE",
- zOrder: 4,
- fileURL: "TXT_STAGE_SCORE.png",
- x: 82,
- y: 179,
- w: 150,
- h: 26,
- tags: ["win"],
- cols: 1
- }, {
- name: "TXT_WIN_TOTAL_SCORE",
- zOrder: 4,
- fileURL: "TXT_TOTAL_SCORE.png",
- x: 83,
- y: 229,
- w: 149,
- h: 26,
- tags: ["win"],
- cols: 1
- }, {
- name: "TXT_TOTAL_OVER_SCORE",
- zOrder: 4,
- fileURL: "TXT_TOTAL_SCORE.png",
- x: 88,
- y: 196,
- w: 149,
- h: 26,
- tags: ["over"],
- cols: 1
- }, {
- name: "TXT_YOUR_TOTAL_SCORE",
- zOrder: 0,
- fileURL: "TXT_YOUR_TOTAL_SCORE.png",
- x: 0,
- y: 0,
- w: 200,
- h: 26,
- tags: [],
- cols: 1
- }, {
- name: "YOU_WIN_BG",
- zOrder: 3,
- fileURL: "YOU_WIN_BG.png",
- x: 5,
- y: 82,
- w: 310,
- h: 249,
- tags: ["win"],
- cols: 1
- }, {
- name: "majong_1",
- zOrder: 0,
- fileURL: "majong/1.png",
- x: 0,
- y: 0,
- w: 38,
- h: 44,
- tags: [],
- cols: 1
- }, {
- name: "majong_10",
- zOrder: 0,
- fileURL: "majong/10.png",
- x: 0,
- y: 0,
- w: 38,
- h: 46,
- tags: [],
- cols: 1
- }, {
- name: "majong_11",
- zOrder: 0,
- fileURL: "majong/11.png",
- x: 0,
- y: 0,
- w: 38,
- h: 46,
- tags: [],
- cols: 1
- }, {
- name: "majong_12",
- zOrder: 0,
- fileURL: "majong/12.png",
- x: 0,
- y: 0,
- w: 38,
- h: 46,
- tags: [],
- cols: 1
- }, {
- name: "majong_13",
- zOrder: 0,
- fileURL: "majong/13.png",
- x: 0,
- y: 0,
- w: 38,
- h: 46,
- tags: [],
- cols: 1
- }, {
- name: "majong_14",
- zOrder: 0,
- fileURL: "majong/14.png",
- x: 0,
- y: 0,
- w: 38,
- h: 46,
- tags: [],
- cols: 1
- }, {
- name: "majong_15",
- zOrder: 0,
- fileURL: "majong/15.png",
- x: 0,
- y: 0,
- w: 38,
- h: 46,
- tags: [],
- cols: 1
- }, {
- name: "majong_16",
- zOrder: 0,
- fileURL: "majong/16.png",
- x: 0,
- y: 0,
- w: 38,
- h: 46,
- tags: [],
- cols: 1
- }, {
- name: "majong_17",
- zOrder: 0,
- fileURL: "majong/17.png",
- x: 0,
- y: 0,
- w: 38,
- h: 46,
- tags: [],
- cols: 1
- }, {
- name: "majong_18",
- zOrder: 0,
- fileURL: "majong/18.png",
- x: 0,
- y: 0,
- w: 38,
- h: 46,
- tags: [],
- cols: 1
- }, {
- name: "majong_19",
- zOrder: 0,
- fileURL: "majong/19.png",
- x: 0,
- y: 0,
- w: 38,
- h: 46,
- tags: [],
- cols: 1
- }, {
- name: "majong_2",
- zOrder: 0,
- fileURL: "majong/2.png",
- x: 0,
- y: 0,
- w: 38,
- h: 46,
- tags: [],
- cols: 1
- }, {
- name: "majong_20",
- zOrder: 0,
- fileURL: "majong/20.png",
- x: 0,
- y: 0,
- w: 38,
- h: 46,
- tags: [],
- cols: 1
- }, {
- name: "majong_21",
- zOrder: 0,
- fileURL: "majong/21.png",
- x: 0,
- y: 0,
- w: 38,
- h: 46,
- tags: [],
- cols: 1
- }, {
- name: "majong_22",
- zOrder: 0,
- fileURL: "majong/22.png",
- x: 0,
- y: 0,
- w: 38,
- h: 46,
- tags: [],
- cols: 1
- }, {
- name: "majong_23",
- zOrder: 0,
- fileURL: "majong/23.png",
- x: 0,
- y: 0,
- w: 38,
- h: 46,
- tags: [],
- cols: 1
- }, {
- name: "majong_24",
- zOrder: 0,
- fileURL: "majong/24.png",
- x: 0,
- y: 0,
- w: 38,
- h: 46,
- tags: [],
- cols: 1
- }, {
- name: "majong_25",
- zOrder: 0,
- fileURL: "majong/25.png",
- x: 0,
- y: 0,
- w: 38,
- h: 46,
- tags: [],
- cols: 1
- }, {
- name: "majong_26",
- zOrder: 0,
- fileURL: "majong/26.png",
- x: 0,
- y: 0,
- w: 38,
- h: 46,
- tags: [],
- cols: 1
- }, {
- name: "majong_27",
- zOrder: 0,
- fileURL: "majong/27.png",
- x: 0,
- y: 0,
- w: 38,
- h: 46,
- tags: [],
- cols: 1
- }, {
- name: "majong_28",
- zOrder: 0,
- fileURL: "majong/28.png",
- x: 0,
- y: 0,
- w: 38,
- h: 46,
- tags: [],
- cols: 1
- }, {
- name: "majong_29",
- zOrder: 0,
- fileURL: "majong/29.png",
- x: 0,
- y: 0,
- w: 38,
- h: 46,
- tags: [],
- cols: 1
- }, {
- name: "majong_3",
- zOrder: 0,
- fileURL: "majong/3.png",
- x: 0,
- y: 0,
- w: 38,
- h: 46,
- tags: [],
- cols: 1
- }, {
- name: "majong_30",
- zOrder: 0,
- fileURL: "majong/30.png",
- x: 0,
- y: 0,
- w: 38,
- h: 46,
- tags: [],
- cols: 1
- }, {
- name: "majong_31",
- zOrder: 0,
- fileURL: "majong/31.png",
- x: 0,
- y: 0,
- w: 38,
- h: 46,
- tags: [],
- cols: 1
- }, {
- name: "majong_4",
- zOrder: 0,
- fileURL: "majong/4.png",
- x: 0,
- y: 0,
- w: 38,
- h: 46,
- tags: [],
- cols: 1
- }, {
- name: "majong_5",
- zOrder: 0,
- fileURL: "majong/5.png",
- x: 0,
- y: 0,
- w: 38,
- h: 46,
- tags: [],
- cols: 1
- }, {
- name: "majong_6",
- zOrder: 0,
- fileURL: "majong/6.png",
- x: 0,
- y: 0,
- w: 38,
- h: 46,
- tags: [],
- cols: 1
- }, {
- name: "majong_7",
- zOrder: 0,
- fileURL: "majong/7.png",
- x: 0,
- y: 0,
- w: 38,
- h: 46,
- tags: [],
- cols: 1
- }, {
- name: "majong_8",
- zOrder: 0,
- fileURL: "majong/8.png",
- x: 0,
- y: 0,
- w: 38,
- h: 46,
- tags: [],
- cols: 1
- }, {
- name: "majong_9",
- zOrder: 0,
- fileURL: "majong/9.png",
- x: 0,
- y: 0,
- w: 38,
- h: 46,
- tags: [],
- cols: 1
- }, {
- name: "PET_FOCUS",
- zOrder: 0,
- fileURL: "MAJONG_FOCUS.png",
- x: 0,
- y: 0,
- w: 34,
- h: 42,
- tags: [],
- cols: 1
- }, {
- name: "PET_FOCUS_HINT",
- zOrder: 0,
- fileURL: "MAJONG_FOCUS_HINT.png",
- x: 0,
- y: 0,
- w: 34,
- h: 42,
- tags: [],
- cols: 1
- }], FZ.getImgInfo = function (a) {
- var b = 0,
- c = null;
- for (b = 0; b < FZ.IphoneUI.length; b++) {
- c = FZ.IphoneUI[b];
- if (a === c.name) return c
- }
- return null
- }
- }(),
- function () {
- FZ.GameDefs = {
- STATS_FONT_SIZE: 16,
- SCREEN_W: 320,
- SCREEN_H: 480,
- SCREEN_BOTTOM_H: 44,
- SCREEN_TOP_H: 20,
- TIME_RATE: 8,
- HALF_ACCELERATION_OF_GRAVITY: 5,
- FLASH_COUNT: 0,
- FLASH_FOCUS_COUNT: 1,
- DIAMOND_SPEED_X: 6,
- DIAMOND_SPEED_Y: 6,
- FALLING_SPEED_X: 4,
- FALLING_SPEED_Y: -4,
- DIAMOND_RORATE_NONE: 0,
- DIAMOND_RORATE_LEFT: 1,
- DIAMOND_RORATE_RIGHT: 2,
- DIAMOND_RORATE_RATE: 20,
- GAME_STATE_UNKNOW: -1,
- GAME_STATE_LOADING: 0,
- GAME_STATE_INIT: 1,
- GAME_STATE_GAME: 2,
- PET_FLICKER_TIME: 100,
- PET_FLICKER_FOCUS_TIME: 50,
- PET_TYPE_0: 0,
- PET_TYPE_1: 1,
- PET_TYPE_2: 2,
- PET_TYPE_3: 3,
- PET_TYPE_4: 4,
- PET_TYPE_5: 5,
- PET_TYPE_6: 6,
- PET_TYPE_7: 7,
- PET_TYPE_8: 8,
- PET_TYPE_9: 9,
- PET_TYPE_10: 10,
- PET_TYPE_11: 11,
- PET_TYPE_12: 12,
- PET_TYPE_13: 13,
- PET_TYPE_14: 14,
- PET_TYPE_15: 15,
- PET_TYPE_16: 16,
- PET_TYPE_17: 17,
- PET_TYPE_18: 18,
- PET_TYPE_19: 19,
- PET_TYPE_20: 20,
- PET_TYPE_21: 21,
- PET_TYPE_22: 22,
- PET_TYPE_23: 23,
- PET_TYPE_24: 24,
- PET_TYPE_25: 25,
- PET_TYPE_26: 26,
- PET_TYPE_27: 27,
- PET_TYPE_28: 28,
- PET_TYPE_29: 29,
- PET_TYPE_30: 30,
- PET_TYPE_31: 31,
- PET_TYPE_32: 32,
- PET_TYPE_33: 33,
- PET_TYPE_34: 34,
- PET_TYPE_35: 35,
- PET_TYPE_36: 36,
- PET_TYPE_37: 37,
- PET_TYPE_38: 38,
- PET_TYPE_39: 39,
- DIAMOND_TYPES: 31,
- DREAMPET_NUM_LINE_HALF: 4,
- DREAMPET_NUM_COL_HALF: 4,
- DREAMPET_NUM_COL: 8,
- DREAMPET_NUM_LINE: 8,
- ALL_PET_NUM: 64,
- ALL_GENERAL: 100,
- ALL_GENERAL_HALF: 50,
- DRAW_LINE_TIME: 6,
- PET_FLASH_TIME: 20,
- GRID_WIDTH: 36,
- GRID_WIDTH_HALF: 18,
- GRID_HEIGHT: 44,
- GRID_HEIGHT_HALF: 22,
- OFFSET_X: 16,
- OFFSET_Y: 80,
- DREAMPET_OFFSET_X: -20,
- DREAMPET_OFFSET_Y: 36,
- SEARCH_NONE: 0,
- SEARCH_INIT: 1,
- SEARCH_ING: 2,
- SEARCH_FINISHED: 3,
- GAME_CLEAR_TIME: 1500,
- DREAMPET_REMOVE: -1,
- DREAMPET_INIT: 0,
- DREAMPET_FOCUS: 1,
- DREAMPET_FLASH: 2,
- DREAMPET_FLASH_HINT: 3,
- DREAMPET_MOVING: 4,
- LEVEL_HINT_NUMBER: [0, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6],
- MAX_LEVEL_RANK: 9,
- LEVEL_TIME: [0, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180],
- LEVEL_PET_KIND: [5, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31],
- PET_1: 0,
- PET_2: 1,
- PET_3: 2,
- PET_4: 3,
- PET_5: 4,
- PET_6: 5,
- PET_7: 6,
- PET_8: 7,
- PET_9: 8,
- PET_10: 9,
- PET_11: 10,
- PET_12: 11,
- PET_13: 12,
- PET_14: 13,
- PET_15: 14,
- PET_16: 15,
- PET_17: 16,
- PET_18: 17,
- PET_19: 18,
- PET_20: 19,
- PET_21: 20,
- PET_22: 21,
- PET_23: 22,
- PET_24: 23,
- PET_25: 24,
- PET_26: 25,
- PET_27: 26,
- PET_28: 27,
- PET_29: 28,
- PET_30: 29,
- PET_31: 30,
- PET_32: 31,
- PET_33: 32,
- PET_34: 33,
- PET_35: 34,
- PET_36: 35,
- PET_37: 36,
- PET_38: 37,
- PET_39: 38,
- PET_40: 39
- }
- }(),
- function () {
- var a = -1,
- b = 0,
- c = 1,
- d = 0,
- e = 0,
- f = null,
- g = null,
- h = function () {
- if (null === g) g = g || [];
- else
- while (g.length > 0) g.pop()
- }, i = function (a, b, c, d) {
- var e = 0;
- e = Math.abs(a - c) + Math.abs(b - d);
- return e
- }, j = function (a, b, c, d) {
- var g = null,
- h = b * e + a;
- if (a !== c && b !== d) return !1;
- var i = 0,
- j = 0,
- k = 0,
- l = 0;
- if (a === c) {
- i = a, j = b, k = c, l = d, b > d && (j = d, l = b);
- for (h = (j + 1) * e + i; h < l * e + k; h += e) {
- g = f[h];
- if (FZ.GameDefs.DREAMPET_REMOVE !== g.m_state) return !1
- }
- } else if (b === d) {
- i = a, j = b, k = c, l = d, a > c && (i = c, k = a);
- for (h = j * e + i + 1; h < l * e + k; h++) {
- g = f[h];
- if (FZ.GameDefs.DREAMPET_REMOVE !== g.m_state) return !1
- }
- }
- return !0
- }, k = function (a, b, c, d) {
- var h = 0,
- i = 0,
- k = 0,
- l = !1,
- m = null;
- h = c, i = b, m = f[i * e + h];
- if (FZ.GameDefs.DREAMPET_REMOVE === m.m_state) {
- l = j(a, b, h, i);
- if (l) {
- l = j(h, i, c, d);
- if (l) {
- g.push([h, i]);
- return !0
- }
- }
- }
- h = a, i = d, m = f[i * e + h];
- if (FZ.GameDefs.DREAMPET_REMOVE === m.m_state) {
- l = j(a, b, h, i);
- if (l) {
- l = j(h, i, c, d);
- if (l) {
- g.push([h, i]);
- return !0
- }
- }
- }
- return !1
- }, l = function (a, b, c, i) {
- var j = 0,
- l = 0,
- m = 0,
- n = 0,
- o = 0,
- p = 0,
- q = 0,
- r = 0,
- s = null;
- a < c ? (l = a, m = b, p = c, q = i) : (l = c, m = i, p = a, q = b), n = l, o = m;
- for (n = n + 1; n < e; n++) {
- s = f[o * e + n];
- if (FZ.GameDefs.DREAMPET_REMOVE !== s.m_state) break;
- h(), g.push([l, m]), g.push([n, o]);
- if (k(n, o, p, q)) {
- g.push([p, q]);
- return !0
- }
- }
- b < i ? (l = a, m = b, p = c, q = i) : (l = c, m = i, p = a, q = b), n = l, o = m;
- for (o = o + 1; o < d; o++) {
- s = f[o * e + n];
- if (FZ.GameDefs.DREAMPET_REMOVE !== s.m_state) break;
- h(), g.push([l, m]), g.push([n, o]);
- if (k(n, o, p, q)) {
- g.push([p, q]);
- return !0
- }
- }
- a < c ? (l = a, m = b, p = c, q = i) : (l = c, m = i, p = a, q = b), n = l, o = m;
- for (n = n - 1; n >= 0; n--) {
- s = f[o * e + n];
- if (FZ.GameDefs.DREAMPET_REMOVE !== s.m_state) break;
- h(), g.push([l, m]), g.push([n, o]);
- if (k(n, o, p, q)) {
- g.push([p, q]);
- return !0
- }
- }
- b < i ? (l = a, m = b, p = c, q = i) : (l = c, m = i, p = a, q = b), n = l, o = m;
- for (o = o - 1; o >= 0; o--) {
- s = f[o * e + n];
- if (FZ.GameDefs.DREAMPET_REMOVE !== s.m_state) break;
- h(), g.push([l, m]), g.push([n, o]);
- if (k(n, o, p, q)) {
- g.push([p, q]);
- return !0
- }
- }
- };
- FZ.AG = {}, FZ.AG.SearchSpecialPath = {
- getPath: function (a, b, c, i, m, n, o) {
- if (undefined === a) return null;
- if (a.length < b * c) return null;
- var p = 0;
- f = a, d = b, e = c, h(), g.push([i, m]);
- if (j(i, m, n, o)) {
- g.push([n, o]);
- return g
- }
- h(), g.push([i, m]);
- if (k(i, m, n, o)) {
- g.push([n, o]);
- return g
- }
- h();
- if (l(i, m, n, o)) return g;
- return null
- },
- drawNum: function (a, b, c, d, e) {
- var f = b,
- g = 0;
- if (f === 0) a.setFrame(0), a.draw(FZ.GameBase.MainContext);
- else {
- a.resetMatrix(), a.makeTranslate(c, d);
- for (var h = 0; f !== 0; h++) g = Math.floor(f % 10), a.setFrame(g), a.draw(FZ.GameBase.MainContext), a.translate(-e, 0), f = Math.floor(f / 10);
- a.setFrame(0), a.makeTranslate(c, d)
- }
- },
- setNumDiv: function (a, b) {
- var c = b,
- d = 0,
- e = null,
- f = 0,
- g = null;
- if (c === 0) {
- a[0] = document.createElement("div"), a[0].style.zIndex = 202, e = FZ.getImgInfo("number_hint_0"), FZ.GameBase.setCss(a[0], e);
- return 1
- }
- if (c > 10) {
- d = Math.floor(c % 10), g = document.createElement("div"), g.style.zIndex = 202, e = FZ.getImgInfo("number_hint_" + d), FZ.GameBase.setCss(g, e), a.push(g), d = Math.floor(c / 10), g = document.createElement("div"), g.style.zIndex = 205, e = FZ.getImgInfo("number_hint_clone_" + d), FZ.GameBase.setCss(g, e), a.push(g);
- return 2
- }
- d = Math.floor(c % 10), g = document.createElement("div"), g.style.zIndex = 202, e = FZ.getImgInfo("number_hint_" + d), FZ.GameBase.setCss(g, e), a.push(g), d = Math.floor(c / 10), g = document.createElement("div"), g.style.zIndex = 205, e = FZ.getImgInfo("number_hint_clone_" + d), FZ.GameBase.setCss(g, e), g.style.visibility = "hidden", a.push(g);
- return 2
- },
- setScoreNum: function (a) {
- var b = a,
- c = 0,
- d = [];
- while (b > 0) c = Math.floor(b % 10), d.push(c), b = Math.floor(b / 10);
- return d
- },
- getPolygonVertex: function (a, b, c, d) {
- if (d < 3) return null;
- var e = [],
- f = 0,
- g = 2 * Math.PI / d;
- for (var h = 0; h < d; h++) {
- var i = [];
- i.push(a + Math.floor(c * Math.sin(f))), i.push(b + Math.floor(c * Math.cos(f))), f += g, e.push(i)
- }
- return e
- }
- }
- }(),
- function () {
- var a = function (a, b) {
- var c = 0;
- for (c = 0; c < a.length; c++)
- if (b === a[c]) return c;
- return -1
- };
- FZ.DivManager = {
- m_init: !1,
- m_parentContainer: null,
- m_display_list: null,
- offsetLeft: 0,
- offsetTop: 0,
- init: function () {
- this.m_init || (this.m_init = !0, this.m_parentContainer = null, this.m_display_list = this.m_display_list || [])
- },
- setSize: function (a, b) {
- null !== this.m_parentContainer && (this.m_parentContainer.style.width = a + "px", this.m_parentContainer.style.height = b + "px")
- },
- setParent: function (a) {
- this.m_parentContainer = a, this.m_parentContainer.style.position = "absolute", this.m_parentContainer.style.overflow = "hidden", this.offsetLeft = this.m_parentContainer.offsetLeft, this.offsetTop = this.m_parentContainer.offsetTop
- },
- setOffset: function (a, b) {
- this.offsetLeft = a, this.offsetTop = b
- },
- getOffsetX: function () {
- this.offsetLeft = this.m_parentContainer.offsetLeft;
- return this.offsetLeft
- },
- getOffsetY: function () {
- this.offsetTop = this.m_parentContainer.offsetTop;
- return this.offsetTop
- },
- setOverflow: function (a) {
- this.m_parentContainer && (this.m_parentContainer.style.overflow = a)
- },
- onmousemove: function (a) {
- var b = 0;
- b = 5
- },
- addChild: function (a) {
- this.m_parentContainer.appendChild(a), this.m_display_list.push(a)
- },
- removeChild: function (b) {
- var c = -1;
- for (c = 0; c < this.m_parentContainer.childNodes.length; c++)
- if (b == this.m_parentContainer.childNodes[c]) {
- this.m_parentContainer.removeChild(b);
- break
- }
- c = a(this.m_display_list, b), -1 !== c && this.m_display_list.splice(c, 1)
- },
- removeAllChild: function () {
- var a = null;
- while (this.m_display_list.length > 0) a = this.m_display_list.pop(), this.m_parentContainer.contains(a) && this.m_parentContainer.removeChild(a)
- }
- }
- }(),
- function () {
- FZ.stateStatus = {}, FZ.stateStatus.INIT = 0, FZ.stateStatus.NORMAL = 5, FZ.stateStatus.HIDENOTIFY = 15, FZ.stateStatus.HIDELOGIC = 20, FZ.stateStatus.DONOTHING = 30, FZ.BaseState = FZ.newClass({
- StateName: "GameStateBase",
- m_status: FZ.stateStatus.NORMAL,
- m_timer: null,
- m_main_div: null,
- m_main_div_clone: null,
- m_ui_list: null,
- m_btn_list: null,
- init: function () {
- FZ.GameBase.registerState(this.StateName, this), this.m_main_div = document.createElement("div"), this.m_main_div_clone = document.createElement("div"), this.m_ui_list = [], this.m_btn_list = []
- },
- pause: function () {},
- resume: function () {},
- createUIs: function (a) {
- var b = 0,
- c = null,
- d = null;
- for (b = 0; b < a.length; b++) c = FZ.getImgInfo(a[b]), d = document.createElement("div"), FZ.GameBase.setCss(d, c), this.m_ui_list.push(d), this.m_main_div.appendChild(d)
- },
- createBtns: function (a, b) {
- var c = 0,
- d = null,
- e = null;
- for (c = 0; c < a.length; c++) d = FZ.getImgInfo(a[c][0]), e = FZ.getImgInfo(a[c][1]), btn = new FZ.UIButton(d.w, d.h, d.cols, d.fileURL, e.fileURL), btn.setPos(d.x, d.y), btn.addMonitor(this), this.m_btn_list.push(btn), b && this.m_main_div.appendChild(btn.m_div)
- },
- resetTranslate: function (a) {
- this.m_remove_div = !1, this.m_main_div.style.display = "inline", this.m_main_div.style.zIndex = 0, this.m_main_div.style.webkitTransitionDuration = "0s", this.m_main_div.style.opacity = a, this.m_main_div.style.webkitTransform = "translate(0px, 0px) rotate(0deg)"
- },
- fade_in: function (a, b) {
- var c = this;
- this.m_remove_div = !1, this.m_main_div.style.webkitTransitionDuration = a + "ms", this.m_main_div.style.opacity = b, this.m_main_div.style.webkitTransform = "translate(0px, 0px) rotate(0deg)"
- },
- fade_out: function (a, b, c) {
- var d = this,
- e = FZ.GameDefs.SCREEN_W,
- f = 0;
- this.m_remove_div = !0, this.m_main_div.style.webkitTransitionDuration = a + "ms", setTimeout(function () {
- d.m_main_div.style.opacity = b, d.m_main_div.style.webkitTransform = "translate(" + e + "px, " + f + "0px) rotate(" + c + "deg)"
- }, 1), setTimeout(function () {
- d.m_remove_div && (d.m_main_div.style.display = "none")
- }, a)
- },
- preProcess: function () {},
- postProcess: function () {},
- AIUpdate: function (a) {},
- pushState: function (a) {
- this.__stateStack.push(this.__StateLib[a])
- },
- popState: function () {
- this.CurrentState = this.__stateStack.pop(), undefined !== this.CurrentState && null !== this.CurrentState && this.CurrentState.resume && this.CurrentState.resume.apply(this.CurrentState, arguments)
- }
- })
- }(),
- function () {
- FZ.Game = {}, FZ.Game.checkButtun = function (a) {
- var b = a.getPosition();
- if (FZ.ControlManager.Mouse.x > b.x && FZ.ControlManager.Mouse.y > b.y && FZ.ControlManager.Mouse.x < b.x + a.__theImages[0][0].width && FZ.ControlManager.Mouse.y < b.y + a.__theImages[0][0].height) {
- a.setFrame(1 + (FZ.ControlManager.Mouse.leftKey ? 1 : 0));
- return !0
- }
- a.setFrame(0);
- return !1
- }, FZ.Game.PreLoadingState = new(FZ.newClass({
- StateName: FZ.StateDefs.GAME_STATE_PRELOADING,
- m_test_timer: 0,
- preProcess: function () {
- FZ.spriteManager.addResource("LOADING_BG", 0, "res/images/MAIN_MENU_AND_LOADING_BG.png", 0, 0, 1), FZ.spriteManager.addResource("majong_BG", 0, "res/images/majong_BG.png", 0, 0, 1), FZ.spriteManager.addResource("loading_empty", 0, "res/images/loading_empty.png", 0, 0, 1), FZ.spriteManager.addResource("loading_full", 0, "res/images/loading_full.png", 0, 0, 1), FZ.spriteManager.addResource("splash", 0, "res/images/splash.png", 0, 0, 1), this.m_timer = setTimeout(FZ.Tools.bind(this, this.AIUpdate), 500)
- },
- postProcess: function () {},
- AIUpdate: function () {
- FZ.PrintLog("" + this.m_test_timer), FZ.ResourceManager.isResourceLoaded() ? FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_LOGO) : this.m_timer = setTimeout(FZ.Tools.bind(this, this.AIUpdate), 200)
- }
- }, FZ.BaseState))
- }(), FZ.Diamond = FZ.newClass({
- BLOCK_SPR_LIST: ["majong_1", "majong_2", "majong_3", "majong_4", "majong_5", "majong_6", "majong_7", "majong_8", "majong_9", "majong_10", "majong_11", "majong_12", "majong_13", "majong_14", "majong_15", "majong_16", "majong_17", "majong_18", "majong_19", "majong_20", "majong_21", "majong_22", "majong_23", "majong_24", "majong_25", "majong_26", "majong_27", "majong_28", "majong_29", "majong_30", "majong_31"],
- m_state: FZ.GameDefs.DREAMPET_INIT,
- m_search_flag: FZ.GameDefs.SEARCH_NONE,
- m_style: -1,
- m_module: -1,
- m_line: 0,
- m_col: 0,
- m_x: 0,
- m_y: 0,
- m_dest_x: 0,
- m_dest_y: 0,
- m_fall_time: 0,
- m_fall_speed_x: 0,
- m_fall_speed_y: 0,
- m_fall_x: 0,
- m_fall_y: 0,
- m_turn: FZ.GameDefs.DIAMOND_RORATE_NONE,
- m_angle: 0,
- m_spr: null,
- m_flashTime: 0,
- m_worldMatrix: null,
- m_back_list: null,
- m_div: null,
- m_div_focus: null,
- m_div_hint: null,
- m_callback: null,
- m_anim_callback: null,
- m_flash_count: FZ.GameDefs.FLASH_COUNT,
- init: function (a, b, c, d) {
- this.m_search_flag = FZ.GameDefs.SEARCH_NONE, this.m_line = a, this.m_col = b, this.m_x = this.m_col * FZ.GameDefs.GRID_WIDTH + FZ.GameDefs.DREAMPET_OFFSET_X, this.m_y = this.m_line * FZ.GameDefs.GRID_HEIGHT + FZ.GameDefs.DREAMPET_OFFSET_Y, this.m_dest_x = this.m_x, this.m_dest_y = this.m_y, this.m_fall_time = 0, this.m_fall_speed_x = 0, this.m_fall_speed_y = 0, this.m_fall_x = this.m_x, this.m_fall_y = this.m_y, this.m_turn = FZ.GameDefs.DIAMOND_RORATE_NONE, this.m_style = Math.floor(c), this.m_state = Math.floor(d), this.m_flashTime = 0, this.m_worldMatrix = new FZ.Math.Matrix3, this.m_worldMatrix.identity();
- switch (this.m_style) {
- case FZ.GameDefs.PET_TYPE_0:
- this.m_module = FZ.GameDefs.PET_1;
- break;
- case FZ.GameDefs.PET_TYPE_1:
- this.m_module = FZ.GameDefs.PET_2;
- break;
- case FZ.GameDefs.PET_TYPE_2:
- this.m_module = FZ.GameDefs.PET_3;
- break;
- case FZ.GameDefs.PET_TYPE_3:
- this.m_module = FZ.GameDefs.PET_4;
- break;
- case FZ.GameDefs.PET_TYPE_4:
- this.m_module = FZ.GameDefs.PET_5;
- break;
- case FZ.GameDefs.PET_TYPE_5:
- this.m_module = FZ.GameDefs.PET_6;
- break;
- case FZ.GameDefs.PET_TYPE_6:
- this.m_module = FZ.GameDefs.PET_7;
- break;
- case FZ.GameDefs.PET_TYPE_7:
- this.m_module = FZ.GameDefs.PET_8;
- break;
- case FZ.GameDefs.PET_TYPE_8:
- this.m_module = FZ.GameDefs.PET_9;
- break;
- case FZ.GameDefs.PET_TYPE_9:
- this.m_module = FZ.GameDefs.PET_10;
- break;
- case FZ.GameDefs.PET_TYPE_10:
- this.m_module = FZ.GameDefs.PET_11;
- break;
- case FZ.GameDefs.PET_TYPE_11:
- this.m_module = FZ.GameDefs.PET_12;
- break;
- case FZ.GameDefs.PET_TYPE_12:
- this.m_module = FZ.GameDefs.PET_13;
- break;
- case FZ.GameDefs.PET_TYPE_13:
- this.m_module = FZ.GameDefs.PET_14;
- break;
- case FZ.GameDefs.PET_TYPE_14:
- this.m_module = FZ.GameDefs.PET_15;
- break;
- case FZ.GameDefs.PET_TYPE_15:
- this.m_module = FZ.GameDefs.PET_16;
- break;
- case FZ.GameDefs.PET_TYPE_16:
- this.m_module = FZ.GameDefs.PET_17;
- break;
- case FZ.GameDefs.PET_TYPE_17:
- this.m_module = FZ.GameDefs.PET_18;
- break;
- case FZ.GameDefs.PET_TYPE_18:
- this.m_module = FZ.GameDefs.PET_19;
- break;
- case FZ.GameDefs.PET_TYPE_19:
- this.m_module = FZ.GameDefs.PET_20;
- break;
- case FZ.GameDefs.PET_TYPE_20:
- this.m_module = FZ.GameDefs.PET_21;
- break;
- case FZ.GameDefs.PET_TYPE_21:
- this.m_module = FZ.GameDefs.PET_22;
- break;
- case FZ.GameDefs.PET_TYPE_22:
- this.m_module = FZ.GameDefs.PET_23;
- break;
- case FZ.GameDefs.PET_TYPE_23:
- this.m_module = FZ.GameDefs.PET_24;
- break;
- case FZ.GameDefs.PET_TYPE_24:
- this.m_module = FZ.GameDefs.PET_25;
- break;
- case FZ.GameDefs.PET_TYPE_25:
- this.m_module = FZ.GameDefs.PET_26;
- break;
- case FZ.GameDefs.PET_TYPE_26:
- this.m_module = FZ.GameDefs.PET_27;
- break;
- case FZ.GameDefs.PET_TYPE_27:
- this.m_module = FZ.GameDefs.PET_28;
- break;
- case FZ.GameDefs.PET_TYPE_28:
- this.m_module = FZ.GameDefs.PET_29;
- break;
- case FZ.GameDefs.PET_TYPE_29:
- this.m_module = FZ.GameDefs.PET_30;
- break;
- case FZ.GameDefs.PET_TYPE_30:
- this.m_module = FZ.GameDefs.PET_31;
- break;
- case FZ.GameDefs.PET_TYPE_31:
- this.m_module = FZ.GameDefs.PET_32;
- break;
- case FZ.GameDefs.PET_TYPE_32:
- this.m_module = FZ.GameDefs.PET_33;
- break;
- case FZ.GameDefs.PET_TYPE_33:
- this.m_module = FZ.GameDefs.PET_34;
- break;
- case FZ.GameDefs.PET_TYPE_34:
- this.m_module = FZ.GameDefs.PET_35;
- break;
- case FZ.GameDefs.PET_TYPE_35:
- this.m_module = FZ.GameDefs.PET_36;
- break;
- case FZ.GameDefs.PET_TYPE_36:
- this.m_module = FZ.GameDefs.PET_37;
- break;
- case FZ.GameDefs.PET_TYPE_37:
- this.m_module = FZ.GameDefs.PET_38;
- break;
- case FZ.GameDefs.PET_TYPE_38:
- this.m_module = FZ.GameDefs.PET_39;
- break;
- case FZ.GameDefs.PET_TYPE_39:
- this.m_module = FZ.GameDefs.PET_40;
- break;
- default:
- this.m_module = FZ.GameDefs.PET_1
- }
- var e = null,
- f = null;
- this.m_back_list = [], f = FZ.getImgInfo(this.BLOCK_SPR_LIST[this.m_module]), e = "url(res/images/" + f.fileURL + ")", this.m_back_list.push(e), this.m_callback = null;
- FZ.GameDefs.DREAMPET_REMOVE === d ? (this.m_div = document.createElement("div"), this.m_div_focus = document.createElement("div"), this.m_div_hint = document.createElement("div")) : (this.setCss(), this.m_div_focus = document.createElement("div"), this.m_div_focus.style.width = FZ.GameDefs.GRID_WIDTH + "px", this.m_div_focus.style.height = FZ.GameDefs.GRID_HEIGHT + "px", this.m_div_focus.style.position = "absolute", this.m_div_focus.style.backgroundRepeat = "no-repeat", this.m_div_focus.style.backgroundImage = "url(res/images/MAJONG_FOCUS.png)", this.hidden(), this.m_div_focus.style.webkitTransition = "opacity, translate", this.m_div.appendChild(this.m_div_focus), this.m_div_hint = document.createElement("div"), this.m_div_hint.style.width = FZ.GameDefs.GRID_WIDTH + "px", this.m_div_hint.style.height = FZ.GameDefs.GRID_HEIGHT + "px", this.m_div_hint.style.position = "absolute", this.m_div_hint.style.backgroundRepeat = "no-repeat", this.m_div_hint.style.backgroundImage = "url(res/images/MAJONG_FOCUS_HINT.png)", this.hiddenHint(), this.m_div_hint.style.webkitTransition = "opacity, translate", this.m_div.appendChild(this.m_div_hint), this.setPetFocus())
- },
- setCss: function () {
- this.m_div = document.createElement("div"), this.m_div.style.width = FZ.GameDefs.GRID_WIDTH + 2 + "px", this.m_div.style.height = FZ.GameDefs.GRID_HEIGHT + 2 + "px", this.m_div.style.position = "absolute", this.m_div.style.webkitTransition = "opacity, left, top, translate", this.m_div.style.webkitTransition = "opacity, translate", this.m_div.style.backgroundRepeat = "no-repeat", this.m_div.style.left = this.m_x + "px", this.m_div.style.top = this.m_y + "px"
- },
- fade_in: function () {
- this.m_div.style.webkitTransitionDuration = FZ.GameDefs.PET_FLICKER_TIME + "ms", this.m_div.style.opacity = 1, this.m_timer = setTimeout(FZ.Tools.bind(this, this.fade_out), FZ.GameDefs.PET_FLICKER_TIME)
- },
- flash: function () {
- this.m_flash_count > 0 && (this.m_div_focus.style.webkitTransitionDuration = FZ.GameDefs.PET_FLICKER_FOCUS_TIME + "ms", this.m_div_focus.style.opacity = 0, this.m_flash_count--, this.m_timer = setTimeout(FZ.Tools.bind(this, this.flash_again), FZ.GameDefs.PET_FLICKER_FOCUS_TIME))
- },
- flash_again: function () {
- this.m_div_focus.style.webkitTransitionDuration = FZ.GameDefs.PET_FLICKER_FOCUS_TIME + "ms", this.m_div_focus.style.opacity = 1, this.m_timer = setTimeout(FZ.Tools.bind(this, this.flash), FZ.GameDefs.PET_FLICKER_FOCUS_TIME)
- },
- fade_out: function () {
- this.m_flash_count > 0 ? (this.m_div.style.webkitTransitionDuration = FZ.GameDefs.PET_FLICKER_TIME + "ms", this.m_div.style.opacity = 0, this.m_flash_count--, this.m_timer = setTimeout(FZ.Tools.bind(this, this.fade_in), FZ.GameDefs.PET_FLICKER_TIME)) : FZ.GameDefs.DREAMPET_FLASH_HINT === this.m_state && (this.setState(FZ.GameDefs.DREAMPET_INIT), this.hiddenHint())
- },
- fadeOut: function () {
- this.m_div.style.webkitTransitionDuration = "500ms", this.m_div.style.opacity = 0, this.m_timer = setTimeout(FZ.Tools.bind(this, this.fadeEnd), 500)
- },
- fadeEnd: function () {
- this.setState(FZ.GameDefs.DREAMPET_REMOVE), this.m_div.style.visibility = "hidden"
- },
- setPetFocus: function () {
- FZ.GameDefs.DREAMPET_FLASH === this.m_state ? (this.m_div.style.backgroundImage = this.m_back_list[0], this.m_div.style.opacity = 1, this.fadeOut()) : FZ.GameDefs.DREAMPET_FLASH_HINT === this.m_state ? (this.m_div.style.backgroundImage = this.m_back_list[0], this.showHint(), this.m_timer = setTimeout(FZ.Tools.bind(this, function () {
- FZ.GameDefs.DREAMPET_FLASH_HINT === this.m_state ? (this.setState(FZ.GameDefs.DREAMPET_INIT), this.hiddenHint()) : this.m_state === FZ.GameDefs.DREAMPET_FOCUS && this.hiddenHint()
- }), 1500)) : this.m_state === FZ.GameDefs.DREAMPET_INIT ? this.m_div.style.backgroundImage = this.m_back_list[0] : this.m_state === FZ.GameDefs.DREAMPET_FOCUS ? (this.m_div.style.backgroundImage = this.m_back_list[0], this.m_div_focus.style.visibility = "visible", this.m_div_focus.style.webkitTransitionDuration = FZ.GameDefs.PET_FLICKER_FOCUS_TIME + "ms", this.m_div_focus.style.opacity = 1, this.m_flash_count = FZ.GameDefs.FLASH_FOCUS_COUNT) : this.m_state === FZ.GameDefs.DREAMPET_REMOVE && (this.m_div.style.visibility = "hidden")
- },
- show: function () {
- this.m_div_focus.style.visibility = "visible"
- },
- hidden: function () {
- this.m_div_focus.style.visibility = "hidden"
- },
- showHint: function () {
- this.m_div_hint.style.visibility = "visible"
- },
- hiddenHint: function () {
- this.m_div_hint.style.visibility = "hidden"
- },
- destroy: function () {
- this.m_div && this.m_div.parentNode && this.m_div.parentNode.removeChild(this.m_div)
- },
- getLine: function () {
- return this.m_line
- },
- getCol: function () {
- return this.m_col
- },
- setLine: function (a) {
- this.m_line = a
- },
- setCol: function (a) {
- this.m_col = a
- },
- getStyle: function () {
- return this.m_style
- },
- getState: function () {
- return this.m_state
- },
- setStyle: function (a) {
- this.m_style = a
- },
- setState: function (a) {
- this.m_state = a
- },
- getSearchFlag: function () {
- return this.m_search_flag
- },
- setSearchFlag: function (a) {
- this.m_search_flag = a
- },
- updatePos: function () {
- !this.m_div || (this.m_x = FZ.GameDefs.DREAMPET_OFFSET_X + FZ.GameDefs.GRID_WIDTH * this.m_col, this.m_y = FZ.GameDefs.DREAMPET_OFFSET_Y + FZ.GameDefs.GRID_HEIGHT * this.m_line, this.m_div.style.backgroundImage = this.m_back_list[0], this.m_div.style.left = this.m_x + "px", this.m_div.style.top = this.m_y + "px")
- }
- }), FZ.GRID_COOR = FZ.newClass({
- line: 0,
- col: 0,
- init: function () {
- this.line = 0, this.col = 0
- }
- }), FZ.DiamondManager = FZ.newClass({
- EVT_MOUSE_OVER: "mouseover",
- EVT_MOUSE_MOVE: "mousemove",
- EVT_MOUSE_OUT: "mouseout",
- EVT_MOUSE_CLICK: "click",
- m_hintX: 0,
- m_hintY: 0,
- m_hintScore: null,
- m_last_selected: -1,
- m_dialog: !1,
- m_leftNum: -1,
- m_allPets: null,
- m_missDiamonds: null,
- m_hintCount: 0,
- m_bonus_time: 0,
- m_firstPet: null,
- m_secondPet: null,
- m_PetFirstIndex: 0,
- m_PetSecondIndex: 0,
- m_drawLineTime: 0,
- m_left_pet: 0,
- m_ctx: null,
- m_level: 0,
- m_displayPetsIndex: null,
- m_reset_finished: !0,
- m_parent: null,
- m_observer: null,
- m_stop_bubble: !1,
- m_call_mOver: null,
- m_call_mOut: null,
- m_call_mMove: null,
- m_call_mClick: null,
- m_call_tStart: null,
- m_call_tMove: null,
- m_call_tEnd: null,
- m_div_line: [],
- isDebug: !1,
- m_debug_div: null,
- init: function () {
- this.m_hintX = 0, this.m_hintY = 0, this.m_hintScore = "", this.m_last_selected = -1, this.m_dialog = !1, this.m_leftNum = -1, this.m_allPets = this.m_allPets || [], this.m_missDiamonds = this.m_missDiamonds || [], this.m_hintCount = 0, this.m_firstPet = null, this.m_secondPet = null, this.m_PetFirstIndex = 0, this.m_PetSecondIndex = 0, this.m_drawLineTime = 0, this.m_left_pet = FZ.GameDefs.ALL_PET_NUM;
- for (var a = 0; a < 3; ++a) this.m_div_line[a] = document.createElement("div"), this.m_div_line[a].style.position = "absolute", this.m_div_line[a].style.backgroundRepeat = "no-repeat", this.m_div_line[a].style.backgroundColor = "#ffff00", this.m_div_line[a].style.visibility = "hidden", FZ.DivManager.addChild(this.m_div_line[a]);
- this.isDebug && (this.m_debug_div = document.createElement("div"), this.m_debug_div.style.zIndex = 500, this.m_debug_div.style.width = "320px", this.m_debug_div.style.height = "40px", this.m_debug_div.style.left = "0px", this.m_debug_div.style.top = "438px", this.m_debug_div.style.position = "absolute", this.m_debug_div.style.color = "#ff0", this.m_debug_div.style.fontSize = FZ.GameDefs.STATS_FONT_SIZE + "px", this.m_debug_div.style.fontFamily = "Arial", this.m_debug_div.style.lineHeight = "40px", this.m_debug_div.style.textAlign = "center", this.m_debug_div.style.innerHTML = "", FZ.DivManager.addChild(this.m_debug_div))
- },
- removeEvent: function () {
- !this.m_parent || (FZ.TARGET_DEF.MOBILE === FZ.TargetPort ? (FZ.EventRemove(this, this.m_parent, FZ.EVENT_DEF.T_START, this.m_call_tStart), this.m_call_tStart = null, FZ.EventRemove(this, this.m_parent, FZ.EVENT_DEF.T_MOVE, this.m_call_tMove), this.m_call_tMove = null, FZ.EventRemove(this, this.m_parent, FZ.EVENT_DEF.T_END, this.m_call_tEnd), this.m_call_tEnd = null) : (FZ.EventRemove(this, this.m_parent, FZ.EVENT_DEF.M_OVER, this.m_call_mOver), this.m_call_mOver = null, FZ.EventRemove(this, this.m_parent, FZ.EVENT_DEF.M_OUT, this.m_call_mOut), this.m_call_mOut = null, FZ.EventRemove(this, this.m_parent, FZ.EVENT_DEF.M_MOVE, this.m_call_mMove), this.m_call_mMove = null, FZ.EventRemove(this, this.m_parent, FZ.EVENT_DEF.M_CLICK, this.m_call_mClick), this.m_call_mClick = null))
- },
- setParent: function (a) {
- a ? (this.m_parent = a, FZ.TARGET_DEF.MOBILE === FZ.TargetPort ? (FZ.EventHandler(this, this.m_parent, FZ.EVENT_DEF.T_START, this.mouseHandler), FZ.EventHandler(this, this.m_parent, FZ.EVENT_DEF.T_MOVE, this.mouseHandler), FZ.EventHandler(this, this.m_parent, FZ.EVENT_DEF.T_END, this.mouseHandler)) : (FZ.EventHandler(this, this.m_parent, FZ.EVENT_DEF.M_OVER, this.mouseHandler), FZ.EventHandler(this, this.m_parent, FZ.EVENT_DEF.M_MOVE, this.mouseHandler), FZ.EventHandler(this, this.m_parent, FZ.EVENT_DEF.M_OUT, this.mouseHandler), FZ.EventHandler(this, this.m_parent, FZ.EVENT_DEF.M_CLICK, this.mouseHandler))) : this.m_parent && (FZ.TARGET_DEF.MOBILE === FZ.TargetPort ? (FZ.EventRemove(this, this.m_parent, FZ.EVENT_DEF.T_START, this.m_call_tStart), this.m_call_tStart = null, FZ.EventRemove(this, this.m_parent, FZ.EVENT_DEF.T_MOVE, this.m_call_tMove), this.m_call_tMove = null, FZ.EventRemove(this, this.m_parent, FZ.EVENT_DEF.T_END, this.m_call_tEnd), this.m_call_tEnd = null) : (FZ.EventRemove(this, this.m_parent, FZ.EVENT_DEF.M_OVER, this.m_call_mOver), this.m_call_mOver = null, FZ.EventRemove(this, this.m_parent, FZ.EVENT_DEF.M_OUT, this.m_call_mOut), this.m_call_mOut = null, FZ.EventRemove(this, this.m_parent, FZ.EVENT_DEF.M_MOVE, this.m_call_mMove), this.m_call_mMove = null, FZ.EventRemove(this, this.m_parent, FZ.EVENT_DEF.M_CLICK, this.m_call_mClick), this.m_call_mClick = null))
- },
- setBubble: function (a) {
- this.m_stop_bubble = a
- },
- setObserver: function (a) {
- this.m_observer = a
- },
- setCtx: function (a) {
- this.m_ctx = a
- },
- setASprite: function (a) {
- this.m_spr = a
- },
- clearAllPets: function () {
- var a = null;
- while (this.m_allPets.length > 0) a = this.m_allPets.pop(), a && a.destroy()
- },
- getTouchPetIndex: function (a, b) {
- var c = 0;
- if (a < FZ.GameDefs.DREAMPET_OFFSET_X || a > FZ.GameDefs.DREAMPET_OFFSET_X + (FZ.GameDefs.DREAMPET_NUM_COL + 1) * FZ.GameDefs.GRID_WIDTH || b < FZ.GameDefs.DREAMPET_OFFSET_Y || b > FZ.GameDefs.DREAMPET_OFFSET_Y + (FZ.GameDefs.DREAMPET_NUM_LINE + 1) * FZ.GameDefs.GRID_HEIGHT) return -1;
- var d = (b - FZ.GameDefs.DREAMPET_OFFSET_Y) / FZ.GameDefs.GRID_HEIGHT,
- e = (a - FZ.GameDefs.DREAMPET_OFFSET_X) / FZ.GameDefs.GRID_WIDTH;
- c = d * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + e, c >= (FZ.GameDefs.DREAMPET_NUM_LINE + 2) * (FZ.GameDefs.DREAMPET_NUM_COL + 2) && (c = -1);
- return c
- },
- checkFocus: function () {
- var a = 0;
- for (a = 0; a < FZ.GameDefs.ALL_GENERAL; a++) {
- var b = this.m_allPets[a].getState();
- if (b === FZ.GameDefs.DREAMPET_FOCUS) return !0
- }
- return !1
- },
- searchHint: function () {
- var a = new FZ.GRID_COOR,
- b = new FZ.GRID_COOR,
- c = Math.floor(FZ.Math.random(0, FZ.GameDefs.ALL_GENERAL - 1));
- for (var d = c; d < FZ.GameDefs.ALL_GENERAL; d++) {
- if (this.m_allPets[d].getState() === FZ.GameDefs.DREAMPET_REMOVE) continue;
- a.col = this.m_allPets[d].getCol(), a.line = this.m_allPets[d].getLine();
- for (var e = d + 1; e < FZ.GameDefs.ALL_GENERAL; e++) {
- if (this.m_allPets[e].getState() === FZ.GameDefs.DREAMPET_REMOVE) continue;
- if (this.m_allPets[d].getStyle() !== this.m_allPets[e].getStyle()) continue;
- b.col = this.m_allPets[e].getCol(), b.line = this.m_allPets[e].getLine();
- if (FZ.AG.SearchSpecialPath.getPath(this.m_allPets, FZ.GameDefs.DREAMPET_NUM_LINE + 2, FZ.GameDefs.DREAMPET_NUM_COL + 2, a.col, a.line, b.col, b.line) !== null) {
- this.m_allPets[d].setState(FZ.GameDefs.DREAMPET_FLASH_HINT), this.m_allPets[d].setPetFocus(), this.m_allPets[e].setState(FZ.GameDefs.DREAMPET_FLASH_HINT), this.m_allPets[e].setPetFocus(), this.m_hintCount--;
- return !0
- }
- }
- }
- for (var d = 0; d < c; d++) {
- if (this.m_allPets[d].getState() === FZ.GameDefs.DREAMPET_REMOVE) continue;
- a.col = this.m_allPets[d].getCol(), a.line = this.m_allPets[d].getLine();
- for (var e = d + 1; e < FZ.GameDefs.ALL_GENERAL; e++) {
- if (this.m_allPets[e].getState() === FZ.GameDefs.DREAMPET_REMOVE) continue;
- if (this.m_allPets[d].getStyle() !== this.m_allPets[e].getStyle()) continue;
- b.col = this.m_allPets[e].getCol(), b.line = this.m_allPets[e].getLine();
- if (FZ.AG.SearchSpecialPath.getPath(this.m_allPets, FZ.GameDefs.DREAMPET_NUM_LINE + 2, FZ.GameDefs.DREAMPET_NUM_COL + 2, a.col, a.line, b.col, b.line) !== null) {
- this.m_allPets[d].setState(FZ.GameDefs.DREAMPET_FLASH_HINT), this.m_allPets[d].setPetFocus(), this.m_allPets[e].setState(FZ.GameDefs.DREAMPET_FLASH_HINT), this.m_allPets[e].setPetFocus(), this.m_hintCount--;
- return !0
- }
- }
- }
- return !1
- },
- searchHasMatch: function () {
- var a = new FZ.GRID_COOR,
- b = new FZ.GRID_COOR,
- c = this.m_PointPath;
- for (var d = 0; d < FZ.GameDefs.ALL_GENERAL; d++) {
- if (this.m_allPets[d].getState() === FZ.GameDefs.DREAMPET_REMOVE) continue;
- a.col = this.m_allPets[d].getCol();
- if (a.col < 0) continue;
- a.line = this.m_allPets[d].getLine();
- if (a.line < 0) continue;
- for (var e = d + 1; e < FZ.GameDefs.ALL_GENERAL; e++) {
- if (this.m_allPets[e].getState() === FZ.GameDefs.DREAMPET_REMOVE) continue;
- if (this.m_allPets[d].getStyle() !== this.m_allPets[e].getStyle()) continue;
- b.col = this.m_allPets[e].getCol();
- if (b.col < 0) continue;
- b.line = this.m_allPets[e].getLine();
- if (b.line < 0) continue;
- if (FZ.AG.SearchSpecialPath.getPath(this.m_allPets, FZ.GameDefs.DREAMPET_NUM_LINE + 2, FZ.GameDefs.DREAMPET_NUM_COL + 2, a.col, a.line, b.col, b.line) !== null) {
- this.m_PointPath = c;
- return !0
- }
- }
- }
- this.isDebug && (this.m_debug_div.style.backgroundColor = "#000"), this.m_PointPath = c;
- return !1
- },
- ResetPosition: function () {
- var a, b, c = null;
- this.getDisplayPet(), c = this.m_displayPetsIndex;
- var d = c.length,
- e = 0;
- if (d === 4) this.exchagePet(c[0], c[1]);
- else {
- e = Math.floor(FZ.Math.random(1, d - 2));
- for (var f = 0; f < e - 1; f++) a = c[f], b = c[f + 1], this.exchagePet(a, b);
- for (var f = e; f < d - 2; f++) a = c[f], b = c[f + 1], this.exchagePet(a, b)
- }
- },
- ResetTwoPosition: function () {
- var a, b, c = null;
- this.getDisplayPet(), c = this.m_displayPetsIndex;
- var d = c.length;
- a = c[0];
- for (var e = 1; e < d - 1; e++) {
- b = c[e];
- if (this.m_allPets[a].getStyle() !== this.m_allPets[b].getStyle()) continue;
- this.exchagePet(c[1], b);
- break
- }
- },
- resetPetPosEffect: function () {
- if (this.m_PetFirstIndex > 0) {
- var a = FZ.GameBase.SaveObject.m_cur_level;
- switch (a) {
- case 1:
- break;
- case 2:
- break;
- case 3:
- this.updownReset(this.m_PetFirstIndex, this.m_PetSecondIndex);
- break;
- case 4:
- break;
- case 5:
- this.leftrightReset(this.m_PetFirstIndex, this.m_PetSecondIndex);
- break;
- case 6:
- this.downReset(this.m_PetFirstIndex, this.m_PetSecondIndex);
- break;
- case 7:
- this.rightReset(this.m_PetFirstIndex, this.m_PetSecondIndex);
- break;
- case 8:
- this.leftReset(this.m_PetFirstIndex, this.m_PetSecondIndex);
- break;
- case 9:
- this.upReset(this.m_PetFirstIndex, this.m_PetSecondIndex);
- break;
- default:
- }
- this.m_PetFirstIndex = 0
- }
- },
- getDisplayPet: function () {
- var a = 0;
- this.m_displayPetsIndex = [];
- for (var b = 0; b < FZ.GameDefs.ALL_GENERAL; b++) {
- var c = this.m_allPets[b].getState();
- c !== FZ.GameDefs.DREAMPET_REMOVE && (a++, this.m_displayPetsIndex.push(b))
- }
- return a
- },
- isGreat: function (a, b) {
- return a >= b ? !0 : !1
- },
- setPetDisappear: function (a, b) {
- var c = 0,
- d = [];
- if (a < FZ.GameDefs.DREAMPET_OFFSET_X || a > FZ.GameDefs.DREAMPET_OFFSET_X + (FZ.GameDefs.DREAMPET_NUM_COL + 1) * FZ.GameDefs.GRID_WIDTH || b < FZ.GameDefs.DREAMPET_OFFSET_Y || b > FZ.GameDefs.DREAMPET_OFFSET_Y + (FZ.GameDefs.DREAMPET_NUM_LINE + 1) * FZ.GameDefs.GRID_HEIGHT) return !1;
- var e = Math.floor((b - FZ.GameDefs.DREAMPET_OFFSET_Y) / FZ.GameDefs.GRID_HEIGHT),
- f = Math.floor((a - FZ.GameDefs.DREAMPET_OFFSET_X) / FZ.GameDefs.GRID_WIDTH);
- c = e * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + f, c >= (FZ.GameDefs.DREAMPET_NUM_LINE + 2) * (FZ.GameDefs.DREAMPET_NUM_COL + 2) && (c = -1);
- if (c < 0) return !1;
- var g = this.m_allPets[c];
- if (null === g || undefined ===
- g) return !1;
- if (g.getState() === FZ.GameDefs.DREAMPET_FOCUS || g.getState() === FZ.GameDefs.DREAMPET_REMOVE) return !1;
- if (!1 === this.checkFocus()) {
- this.m_allPets[c].setState(FZ.GameDefs.DREAMPET_FOCUS), this.m_allPets[c].show(), this.m_firstPet = this.m_allPets[c];
- return !1
- }
- this.m_secondPet = g, p1 = new FZ.GRID_COOR, p1.line = this.m_firstPet.getLine(), p1.col = this.m_firstPet.getCol(), p2 = new FZ.GRID_COOR, p2.line = this.m_secondPet.getLine(), p2.col = this.m_secondPet.getCol();
- if (this.m_firstPet.getStyle() !== this.m_secondPet.getStyle()) {
- this.m_allPets[c].setState(FZ.GameDefs.DREAMPET_FOCUS), this.m_allPets[c].show(), this.m_firstPet.setState(FZ.GameDefs.DREAMPET_INIT), this.m_firstPet.hidden(), this.m_firstPet = this.m_secondPet;
- return !1
- }
- if ((d = FZ.AG.SearchSpecialPath.getPath(this.m_allPets, FZ.GameDefs.DREAMPET_NUM_LINE + 2, FZ.GameDefs.DREAMPET_NUM_COL + 2, p1.col, p1.line, p2.col, p2.line)) !== null) {
- this.m_PointPath = d, this.m_allPets[(FZ.GameDefs.DREAMPET_NUM_COL + 2) * p1.line + p1.col].setState(FZ.GameDefs.DREAMPET_FLASH), this.m_allPets[(FZ.GameDefs.DREAMPET_NUM_COL + 2) * p2.line + p2.col].setState(FZ.GameDefs.DREAMPET_FLASH), this.m_PetFirstIndex = (FZ.GameDefs.DREAMPET_NUM_COL + 2) * p1.line + p1.col, this.m_allPets[this.m_PetFirstIndex].hidden(), this.m_PetSecondIndex = (FZ.GameDefs.DREAMPET_NUM_COL + 2) * p2.line + p2.col, this.m_allPets[this.m_PetFirstIndex].setPetFocus(), this.m_allPets[this.m_PetSecondIndex].setPetFocus(), this.m_score += 100, this.m_bonus_time += 5;
- var h = this.m_PointPath.length,
- i = [];
- for (var j = 0; j < h - 1; ++j) {
- i[1] = this.m_PointPath[j + 1][1], i[0] = this.m_PointPath[j + 1][0];
- var k, l, m = this.ABS(FZ.GameDefs.DREAMPET_OFFSET_X + FZ.GameDefs.GRID_WIDTH * i[0] + FZ.GameDefs.GRID_WIDTH_HALF, FZ.GameDefs.DREAMPET_OFFSET_X + FZ.GameDefs.GRID_WIDTH * this.m_PointPath[j][0] + FZ.GameDefs.GRID_WIDTH_HALF),
- n = this.ABS(FZ.GameDefs.DREAMPET_OFFSET_Y + FZ.GameDefs.GRID_HEIGHT * i[1] + FZ.GameDefs.GRID_HEIGHT_HALF, FZ.GameDefs.DREAMPET_OFFSET_Y + FZ.GameDefs.GRID_HEIGHT * this.m_PointPath[j][1] + FZ.GameDefs.GRID_HEIGHT_HALF),
- o, p;
- 0 === Math.floor(m) && (m = 3), 0 === Math.floor(n) && (n = 3), m === 3 && (k = this.isGreat(FZ.GameDefs.DREAMPET_OFFSET_Y + FZ.GameDefs.GRID_HEIGHT * i[1] + FZ.GameDefs.GRID_HEIGHT_HALF, FZ.GameDefs.DREAMPET_OFFSET_Y + FZ.GameDefs.GRID_HEIGHT * this.m_PointPath[j][1] + FZ.GameDefs.GRID_HEIGHT_HALF), k ? (o = FZ.GameDefs.DREAMPET_OFFSET_X + FZ.GameDefs.GRID_WIDTH * this.m_PointPath[j][0] + FZ.GameDefs.GRID_WIDTH_HALF, p = FZ.GameDefs.DREAMPET_OFFSET_Y + FZ.GameDefs.GRID_HEIGHT * this.m_PointPath[j][1] + FZ.GameDefs.GRID_HEIGHT_HALF) : (o = FZ.GameDefs.DREAMPET_OFFSET_X + FZ.GameDefs.GRID_WIDTH * this.m_PointPath[j][0] + FZ.GameDefs.GRID_WIDTH_HALF, p = FZ.GameDefs.DREAMPET_OFFSET_Y + FZ.GameDefs.GRID_HEIGHT * i[1] + FZ.GameDefs.GRID_HEIGHT_HALF, n += 3)), n === 3 && (l = this.isGreat(FZ.GameDefs.DREAMPET_OFFSET_X + FZ.GameDefs.GRID_WIDTH * i[0] + FZ.GameDefs.GRID_WIDTH_HALF, FZ.GameDefs.DREAMPET_OFFSET_X + FZ.GameDefs.GRID_WIDTH * this.m_PointPath[j][0] + FZ.GameDefs.GRID_WIDTH_HALF), l ? (o = FZ.GameDefs.DREAMPET_OFFSET_X + FZ.GameDefs.GRID_WIDTH * this.m_PointPath[j][0] + FZ.GameDefs.GRID_WIDTH_HALF, p = FZ.GameDefs.DREAMPET_OFFSET_Y + FZ.GameDefs.GRID_HEIGHT * this.m_PointPath[j][1] + FZ.GameDefs.GRID_HEIGHT_HALF) : (o = FZ.GameDefs.DREAMPET_OFFSET_X + FZ.GameDefs.GRID_WIDTH * i[0] + FZ.GameDefs.GRID_WIDTH_HALF, p = FZ.GameDefs.DREAMPET_OFFSET_Y + FZ.GameDefs.GRID_HEIGHT * this.m_PointPath[j][1] + FZ.GameDefs.GRID_HEIGHT_HALF, m += 3)), o < FZ.GameDefs.OFFSET_X ? (this.m_div_line[j].style.left = "5px", m > 3 && (m -= 24)) : o + m > FZ.GameDefs.SCREEN_W && m > 3 ? (m = 315 - o, this.m_div_line[j].style.left = o + "px") : o > FZ.GameDefs.SCREEN_W ? this.m_div_line[j].style.left = "312px" : this.m_div_line[j].style.left = o + "px", p < FZ.GameDefs.OFFSET_Y ? this.m_div_line[j].style.top = "70px" : p + n > FZ.GameDefs.SCREEN_H - FZ.GameDefs.SCREEN_BOTTOM_H && n > 3 ? (n = FZ.GameDefs.SCREEN_H - FZ.GameDefs.SCREEN_BOTTOM_H - 5 - p, this.m_div_line[j].style.top = p + "px") : p > FZ.GameDefs.SCREEN_H - FZ.GameDefs.SCREEN_BOTTOM_H ? (this.m_div_line[j].style.top = FZ.GameDefs.SCREEN_H - FZ.GameDefs.SCREEN_BOTTOM_H - 5 + "px", l === !0 && (m += 3)) : this.m_div_line[j].style.top = p + "px", this.m_div_line[j].style.width = m + "px", this.m_div_line[j].style.height = n + "px", this.m_div_line[j].style.zIndex = 100, this.m_div_line[j].style.visibility = "visible"
- }
- var q = this;
- q.m_reset_finished = !1, setTimeout(function () {
- for (var a = 0; a < h - 1; ++a) q.m_div_line[a].style.visibility = "hidden"
- }, 400), setTimeout(function () {
- q.resetPetPosEffect(), q.getLeftPet() !== 0 && q.searchHasMatch() === !1 && (FZ.Game.GameState.m_isNoMatch = !0, FZ.Game.GameState.levelCurrentTime = (new Date).getTime()), q.m_reset_finished = !0
- }, 600), this.m_left_pet -= 2;
- return !0
- }
- this.m_allPets[c].setState(FZ.GameDefs.DREAMPET_FOCUS), this.m_firstPet && (this.m_firstPet.setState(FZ.GameDefs.DREAMPET_INIT), this.m_firstPet.hidden(), this.m_secondPet && (this.m_secondPet.setState(FZ.GameDefs.DREAMPET_FOCUS), this.m_secondPet.show(), this.m_firstPet = this.m_secondPet));
- return !1
- },
- ABS: function (a, b) {
- return a > b ? a - b : b - a
- },
- updownReset: function (a, b) {
- var c = 0,
- d = 0;
- a > b ? (c = a, d = b) : (c = b, d = a);
- if (d > (FZ.GameDefs.DREAMPET_NUM_LINE_HALF + 1) * (FZ.GameDefs.DREAMPET_NUM_COL + 2)) {
- for (var e = d; e > (FZ.GameDefs.DREAMPET_NUM_LINE_HALF + 2) * (FZ.GameDefs.DREAMPET_NUM_COL + 2); e = e - (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(e, e - (FZ.GameDefs.DREAMPET_NUM_COL + 2));
- for (var e = c; e > (FZ.GameDefs.DREAMPET_NUM_LINE_HALF + 2) * (FZ.GameDefs.DREAMPET_NUM_COL + 2); e = e - (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(e, e - (FZ.GameDefs.DREAMPET_NUM_COL + 2))
- } else if (c > (FZ.GameDefs.DREAMPET_NUM_LINE_HALF + 1) * (FZ.GameDefs.DREAMPET_NUM_COL + 2) && d < (FZ.GameDefs.DREAMPET_NUM_LINE_HALF + 1) * (FZ.GameDefs.DREAMPET_NUM_COL + 2)) {
- for (var e = d; e < FZ.GameDefs.DREAMPET_NUM_LINE_HALF * (FZ.GameDefs.DREAMPET_NUM_COL + 2); e = e + (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(e, e + (FZ.GameDefs.DREAMPET_NUM_COL + 2));
- for (var e = c; e > (FZ.GameDefs.DREAMPET_NUM_LINE_HALF + 2) * (FZ.GameDefs.DREAMPET_NUM_COL + 2); e = e - (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(e, e - (FZ.GameDefs.DREAMPET_NUM_COL + 2))
- } else {
- for (var e = c; e < FZ.GameDefs.DREAMPET_NUM_LINE_HALF * (FZ.GameDefs.DREAMPET_NUM_COL + 2); e = e + (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(e, e + (FZ.GameDefs.DREAMPET_NUM_COL + 2));
- for (var e = d; e < FZ.GameDefs.DREAMPET_NUM_LINE_HALF * (FZ.GameDefs.DREAMPET_NUM_COL + 2); e = e + (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(e, e + (FZ.GameDefs.DREAMPET_NUM_COL + 2))
- }
- },
- leftrightReset: function (a, b) {
- var c = 0,
- d = 0;
- a > b ? (c = a, d = b) : (c = b, d = a);
- var e = this.m_allPets[c].getLine(),
- f = this.m_allPets[c].getCol(),
- g = this.m_allPets[d].getLine(),
- h = this.m_allPets[d].getCol();
- if (f <= FZ.GameDefs.DREAMPET_NUM_COL_HALF && h <= FZ.GameDefs.DREAMPET_NUM_COL_HALF) {
- for (var i = f; i < FZ.GameDefs.DREAMPET_NUM_COL_HALF; i++) this.exchagePet(e * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i, e * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i + 1);
- for (var i = h; i < FZ.GameDefs.DREAMPET_NUM_COL_HALF; i++) this.exchagePet(g * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i, g * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i + 1)
- } else if (h > FZ.GameDefs.DREAMPET_NUM_COL_HALF && f > FZ.GameDefs.DREAMPET_NUM_COL_HALF) {
- for (var i = h; i > FZ.GameDefs.DREAMPET_NUM_COL_HALF + 1; i--) this.exchagePet(g * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i, g * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i - 1);
- for (var i = f; i > FZ.GameDefs.DREAMPET_NUM_COL_HALF + 1; i--) this.exchagePet(e * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i, e * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i - 1)
- } else if (h <= FZ.GameDefs.DREAMPET_NUM_COL_HALF && f > FZ.GameDefs.DREAMPET_NUM_COL_HALF) {
- for (var i = h; i < FZ.GameDefs.DREAMPET_NUM_COL_HALF; i++) this.exchagePet(g * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i, g * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i + 1);
- for (var i = f; i > FZ.GameDefs.DREAMPET_NUM_COL_HALF + 1; i--) this.exchagePet(e * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i, e * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i - 1)
- } else {
- for (var i = h; i > FZ.GameDefs.DREAMPET_NUM_COL_HALF + 1; i--) this.exchagePet(g * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i, g * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i - 1);
- for (var i = f; i < FZ.GameDefs.DREAMPET_NUM_COL_HALF; i++) this.exchagePet(e * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i, e * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i + 1)
- }
- },
- leftReset: function (a, b) {
- var c = 0,
- d = 0;
- b > a ? (c = a, d = b) : (c = b, d = a);
- var e = this.m_allPets[c].getLine(),
- f = this.m_allPets[c].getCol(),
- g = this.m_allPets[d].getLine(),
- h = this.m_allPets[d].getCol();
- for (var i = h; i < FZ.GameDefs.DREAMPET_NUM_COL; i++) this.exchagePet(g * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i, g * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i + 1);
- for (var i = f; i < FZ.GameDefs.DREAMPET_NUM_COL; i++) this.exchagePet(e * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i, e * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i + 1)
- },
- rightReset: function (a, b) {
- var c = 0,
- d = 0;
- a > b ? (c = a, d = b) : (c = b, d = a);
- var e = this.m_allPets[c].getLine(),
- f = this.m_allPets[c].getCol(),
- g = this.m_allPets[d].getLine(),
- h = this.m_allPets[d].getCol();
- for (var i = h; i > 0; i--) {
- if (i === 1) break;
- this.exchagePet(g * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i, g * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i - 1)
- }
- for (var i = f; i > 0; i--) {
- if (i === 1) break;
- this.exchagePet(e * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i, e * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i - 1)
- }
- },
- downReset: function (a, b) {
- var c = 0,
- d = 0,
- e = 0;
- a > b ? (d = a, e = b) : (d = b, e = a);
- if (!(d - (FZ.GameDefs.DREAMPET_NUM_COL + 2) < FZ.GameDefs.DREAMPET_NUM_COL + 2))
- if (e - (FZ.GameDefs.DREAMPET_NUM_COL + 2) > FZ.GameDefs.DREAMPET_NUM_COL + 2 && (e - d) % (FZ.GameDefs.DREAMPET_NUM_COL + 2) == 0) {
- for (var f = e - (FZ.GameDefs.DREAMPET_NUM_COL + 2); f > FZ.GameDefs.DREAMPET_NUM_COL + 2; f = f - (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(f + (FZ.GameDefs.DREAMPET_NUM_COL + 2), f), c = f;
- for (var f = d - (FZ.GameDefs.DREAMPET_NUM_COL + 2); f >= c; f = f - (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(f + (FZ.GameDefs.DREAMPET_NUM_COL + 2), f)
- } else {
- for (var f = d - (FZ.GameDefs.DREAMPET_NUM_COL + 2); f > FZ.GameDefs.DREAMPET_NUM_COL + 2; f = f - (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(f + (FZ.GameDefs.DREAMPET_NUM_COL + 2), f);
- for (var f = e - (FZ.GameDefs.DREAMPET_NUM_COL + 2); f > FZ.GameDefs.DREAMPET_NUM_COL + 2; f = f - (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(f + (FZ.GameDefs.DREAMPET_NUM_COL + 2), f)
- }
- },
- upReset: function (a, b) {
- var c = 0,
- d, e;
- a > b ? (d = a, e = b) : (d = b, e = a);
- if (!(FZ.GameDefs.ALL_GENERAL - e - (FZ.GameDefs.DREAMPET_NUM_COL + 2) < FZ.GameDefs.DREAMPET_NUM_COL + 2)) {
- for (var f = d; f + (FZ.GameDefs.DREAMPET_NUM_COL + 2) < FZ.GameDefs.ALL_GENERAL - (FZ.GameDefs.DREAMPET_NUM_COL + 2); f = f + (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(f, f + (FZ.GameDefs.DREAMPET_NUM_COL + 2));
- for (var f = e; f + (FZ.GameDefs.DREAMPET_NUM_COL + 2) < FZ.GameDefs.ALL_GENERAL - (FZ.GameDefs.DREAMPET_NUM_COL + 2); f = f + (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(f + (FZ.GameDefs.DREAMPET_NUM_COL + 2), f)
- }
- },
- centerReset: function (a, b) {
- var c = 0,
- d, e;
- b > a ? (d = a, e = b) : (d = b, e = a);
- var f = this.m_allPets[d].getLine(),
- g = this.m_allPets[d].getCol(),
- h = this.m_allPets[e].getLine(),
- i = this.m_allPets[e].getCol();
- if (g <= FZ.GameDefs.DREAMPET_NUM_COL_HALF && f > FZ.GameDefs.DREAMPET_NUM_LINE_HALF) {
- if (i <= FZ.GameDefs.DREAMPET_NUM_COL_HALF && h > FZ.GameDefs.DREAMPET_NUM_LINE_HALF && Math.floor((e - d) % (FZ.GameDefs.DREAMPET_NUM_COL + 2)) === 0) {
- c = e;
- for (var j = e; j > 0; j--) {
- if (this.m_allPets[j - 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
- c = j;
- break
- }
- this.exchagePet(j, j - 1)
- }
- for (var j = c; j < FZ.GameDefs.ALL_GENERAL - (FZ.GameDefs.DREAMPET_NUM_COL + 2); j = j + (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(j, j + (FZ.GameDefs.DREAMPET_NUM_COL + 2));
- c = d;
- for (var j = d; j > 0; j--) {
- if (this.m_allPets[j - 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
- c = j;
- break
- }
- this.exchagePet(j, j - 1)
- }
- for (var j = c; j < FZ.GameDefs.ALL_GENERAL - (FZ.GameDefs.DREAMPET_NUM_COL + 2); j = j + (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(j, j + (FZ.GameDefs.DREAMPET_NUM_COL + 2));
- return
- }
- if (i <= FZ.GameDefs.DREAMPET_NUM_COL_HALF && h > FZ.GameDefs.DREAMPET_NUM_LINE_HALF && Math.floor((e - d) % (FZ.GameDefs.DREAMPET_NUM_COL + 2)) === 0) {
- c = e;
- for (var j = e; j > 0; j--) {
- if (this.m_allPets[j - 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
- c = j;
- break
- }
- this.exchagePet(j, j - 1)
- }
- for (var j = c; j < FZ.GameDefs.ALL_GENERAL - (FZ.GameDefs.DREAMPET_NUM_COL + 2); j = j + (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(j, j + (FZ.GameDefs.DREAMPET_NUM_COL + 2));
- c = d;
- for (var j = d; j > 0; j--) {
- if (this.m_allPets[j - 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
- c = j;
- break
- }
- this.exchagePet(j, j - 1)
- }
- for (var j = c; j < FZ.GameDefs.ALL_GENERAL - (FZ.GameDefs.DREAMPET_NUM_COL + 2); j = j + (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(j, j + (FZ.GameDefs.DREAMPET_NUM_COL + 2));
- return
- }
- }
- if (g > FZ.GameDefs.DREAMPET_NUM_COL_HALF && f <= FZ.GameDefs.DREAMPET_NUM_LINE_HALF && i > FZ.GameDefs.DREAMPET_NUM_COL_HALF && h <= FZ.GameDefs.DREAMPET_NUM_LINE_HALF && e - d < FZ.GameDefs.DREAMPET_NUM_COL_HALF) {
- c = e;
- for (var j = e; j < (h + 1) * (FZ.GameDefs.DREAMPET_NUM_COL + 2); j++) {
- if (this.m_allPets[j + 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
- c = j;
- break
- }
- this.exchagePet(j, j + 1)
- }
- for (var j = c; j > FZ.GameDefs.DREAMPET_NUM_COL + 2; j = j - (FZ.GameDefs.DREAMPET_NUM_COL + 2)) {
- if (this.m_allPets[j].getState() === FZ.GameDefs.DREAMPET_REMOVE && this.m_allPets[j - (FZ.GameDefs.DREAMPET_NUM_COL + 2)].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
- c = j;
- break
- }
- this.exchagePet(j, j - (FZ.GameDefs.DREAMPET_NUM_COL + 2))
- }
- c = d;
- for (var j = d; j < (f + 1) * (FZ.GameDefs.DREAMPET_NUM_COL + 2); j++) {
- if (this.m_allPets[j + 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
- c = j;
- break
- }
- this.exchagePet(j, j + 1)
- }
- for (var j = c; j > FZ.GameDefs.DREAMPET_NUM_COL + 2; j = j - (FZ.GameDefs.DREAMPET_NUM_COL + 2)) {
- if (this.m_allPets[j].getState() === FZ.GameDefs.DREAMPET_REMOVE && this.m_allPets[j - (FZ.GameDefs.DREAMPET_NUM_COL + 2)].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
- c = j;
- break
- }
- this.exchagePet(j, j - (FZ.GameDefs.DREAMPET_NUM_COL + 2))
- }
- } else {
- if (g > FZ.GameDefs.DREAMPET_NUM_COL_HALF && f > FZ.GameDefs.DREAMPET_NUM_LINE_HALF) {
- if (i > FZ.GameDefs.DREAMPET_NUM_COL_HALF && h > FZ.GameDefs.DREAMPET_NUM_LINE_HALF && (Math.floor((e - d) % (FZ.GameDefs.DREAMPET_NUM_COL + 2)) === 0 || e - d < FZ.GameDefs.DREAMPET_NUM_COL_HALF)) {
- c = e;
- for (var j = e; j < (h + 1) * (FZ.GameDefs.DREAMPET_NUM_COL + 2); j++) {
- if (this.m_allPets[j + 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
- c = j;
- break
- }
- this.exchagePet(j, j + 1)
- }
- for (var j = c; j < FZ.GameDefs.ALL_GENERAL - (FZ.GameDefs.DREAMPET_NUM_COL + 2); j = j + (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(j, j + (FZ.GameDefs.DREAMPET_NUM_COL + 2));
- c = d;
- for (var j = d; j < (f + 1) * (FZ.GameDefs.DREAMPET_NUM_COL + 2); j++) {
- if (this.m_allPets[j + 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
- c = j;
- break
- }
- this.exchagePet(j, j + 1)
- }
- for (var j = c; j < FZ.GameDefs.ALL_GENERAL - (FZ.GameDefs.DREAMPET_NUM_COL + 2); j = j + (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(j, j + (FZ.GameDefs.DREAMPET_NUM_COL + 2));
- return
- }
- if (i > FZ.GameDefs.DREAMPET_NUM_COL_HALF && h > FZ.GameDefs.DREAMPET_NUM_LINE_HALF && Math.floor((e - d) % (FZ.GameDefs.DREAMPET_NUM_COL + 2)) !== 0) {
- c = d;
- for (var j = d; j < (f + 1) * (FZ.GameDefs.DREAMPET_NUM_COL + 2); j++) {
- if (this.m_allPets[j + 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
- c = j;
- break
- }
- this.exchagePet(j, j + 1)
- }
- for (var j = c; j < FZ.GameDefs.ALL_GENERAL - (FZ.GameDefs.DREAMPET_NUM_COL + 2); j = j + (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(j, j + (FZ.GameDefs.DREAMPET_NUM_COL + 2));
- c = e;
- for (var j = e; j < (h + 1) * (FZ.GameDefs.DREAMPET_NUM_COL + 2); j++) {
- if (this.m_allPets[j + 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
- c = j;
- break
- }
- this.exchagePet(j, j + 1)
- }
- for (var j = c; j < FZ.GameDefs.ALL_GENERAL - (FZ.GameDefs.DREAMPET_NUM_COL + 2); j = j + (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(j, j + (FZ.GameDefs.DREAMPET_NUM_COL + 2));
- return
- }
- }
- c = d;
- if (g <= FZ.GameDefs.DREAMPET_NUM_COL_HALF && f <= FZ.GameDefs.DREAMPET_NUM_LINE_HALF) {
- for (var j = d; j > 0; j--) {
- if (this.m_allPets[j - 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
- c = j;
- break
- }
- this.exchagePet(j, j - 1)
- }
- for (var j = c; j > FZ.GameDefs.DREAMPET_NUM_COL + 2; j = j - (FZ.GameDefs.DREAMPET_NUM_COL + 2)) {
- if (this.m_allPets[j].getState() === FZ.GameDefs.DREAMPET_REMOVE && this.m_allPets[j - (FZ.GameDefs.DREAMPET_NUM_COL + 2)].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
- c = j;
- break
- }
- this.exchagePet(j, j - (FZ.GameDefs.DREAMPET_NUM_COL + 2))
- }
- } else if (g <= FZ.GameDefs.DREAMPET_NUM_COL_HALF && f > FZ.GameDefs.DREAMPET_NUM_LINE_HALF) {
- for (var j = d; j > 0; j--) {
- if (this.m_allPets[j - 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
- c = j;
- break
- }
- this.exchagePet(j, j - 1)
- }
- for (var j = c; j < FZ.GameDefs.ALL_GENERAL - (FZ.GameDefs.DREAMPET_NUM_COL + 2); j = j + (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(j, j + (FZ.GameDefs.DREAMPET_NUM_COL + 2))
- } else if (g > FZ.GameDefs.DREAMPET_NUM_COL_HALF && f > FZ.GameDefs.DREAMPET_NUM_LINE_HALF) {
- for (var j = d; j < (f + 1) * (FZ.GameDefs.DREAMPET_NUM_COL + 2); j++) {
- if (this.m_allPets[j + 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
- c = j;
- break
- }
- this.exchagePet(j, j + 1)
- }
- for (var j = c; j < FZ.GameDefs.ALL_GENERAL - (FZ.GameDefs.DREAMPET_NUM_COL + 2); j = j + (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(j, j + (FZ.GameDefs.DREAMPET_NUM_COL + 2))
- } else if (g > FZ.GameDefs.DREAMPET_NUM_COL_HALF && f <= FZ.GameDefs.DREAMPET_NUM_LINE_HALF) {
- for (var j = d; j < (f + 1) * (FZ.GameDefs.DREAMPET_NUM_COL + 2); j++) {
- if (this.m_allPets[j + 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
- c = j;
- break
- }
- this.exchagePet(j, j + 1)
- }
- for (var j = c; j > FZ.GameDefs.DREAMPET_NUM_COL + 2; j = j - (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(j, j - (FZ.GameDefs.DREAMPET_NUM_COL + 2))
- }
- c = e;
- if (i <= FZ.GameDefs.DREAMPET_NUM_COL_HALF && h <= FZ.GameDefs.DREAMPET_NUM_LINE_HALF) {
- for (var j = e; j > 0; j--) {
- if (this.m_allPets[j - 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
- c = j;
- break
- }
- this.exchagePet(j, j - 1)
- }
- for (var j = c; j > FZ.GameDefs.DREAMPET_NUM_COL + 2; j = j - (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(j, j - (FZ.GameDefs.DREAMPET_NUM_COL + 2))
- } else if (i <= FZ.GameDefs.DREAMPET_NUM_COL_HALF && h > FZ.GameDefs.DREAMPET_NUM_LINE_HALF) {
- for (var j = e; j > 0; j--) {
- if (this.m_allPets[j - 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
- c = j;
- break
- }
- this.exchagePet(j, j - 1)
- }
- for (var j = c; j < FZ.GameDefs.ALL_GENERAL - (FZ.GameDefs.DREAMPET_NUM_COL + 2); j = j + (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(j, j + (FZ.GameDefs.DREAMPET_NUM_COL + 2))
- } else if (i > FZ.GameDefs.DREAMPET_NUM_COL_HALF && h > FZ.GameDefs.DREAMPET_NUM_LINE_HALF) {
- for (var j = e; j < (h + 1) * (FZ.GameDefs.DREAMPET_NUM_COL + 2); j++) {
- if (this.m_allPets[j + 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
- c = j;
- break
- }
- this.exchagePet(j, j + 1)
- }
- for (var j = c; j < FZ.GameDefs.ALL_GENERAL - (FZ.GameDefs.DREAMPET_NUM_COL + 2); j = j + (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(j, j + (FZ.GameDefs.DREAMPET_NUM_COL + 2))
- } else if (i > FZ.GameDefs.DREAMPET_NUM_COL_HALF && h <= FZ.GameDefs.DREAMPET_NUM_LINE_HALF) {
- for (var j = e; j < (h + 1) * (FZ.GameDefs.DREAMPET_NUM_COL + 2); j++) {
- if (this.m_allPets[j + 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
- c = j;
- break
- }
- this.exchagePet(j, j + 1)
- }
- for (var j = c; j > FZ.GameDefs.DREAMPET_NUM_COL + 2; j = j - (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(j, j - (FZ.GameDefs.DREAMPET_NUM_COL + 2))
- }
- }
- },
- exchagePet: function (a, b) {
- var c = this.m_allPets[a].getCol(),
- d = this.m_allPets[a].getLine(),
- e = this.m_allPets[b].getCol(),
- f = this.m_allPets[b].getLine(),
- g = null;
- g = this.m_allPets[a], this.m_allPets[a] = this.m_allPets[b], this.m_allPets[a].setCol(c), this.m_allPets[a].setLine(d), this.m_allPets[a].updatePos(), this.m_allPets[b] = g, this.m_allPets[b].setCol(e), this.m_allPets[b].setLine(f), this.m_allPets[b].updatePos(), this.m_allPets[a].setPetFocus(), this.m_allPets[b].setPetFocus()
- },
- getLeftPet: function () {
- return this.m_left_pet
- },
- getScore: function () {
- return this.m_score
- },
- setScore: function (a) {
- this.m_score = a
- },
- getBonusTime: function () {
- return this.m_bonus_time
- },
- setBonusTime: function (a) {
- this.m_bonus_time = a
- },
- onDrawPathLine: function () {
- FZ.GameBase.MainContext.strokeStyle = "#ff0", FZ.GameBase.MainContext.lineWidth = 3;
- var a = 0,
- b = [];
- for (var c = 0; c < this.m_PointPath.length - 1; ++c) b[1] = this.m_PointPath[c + 1][1], b[0] = this.m_PointPath[c + 1][0], FZ.GameBase.MainContext.setTransform(this.m_worldMatrix.m11, this.m_worldMatrix.m12, this.m_worldMatrix.m21, this.m_worldMatrix.m22, this.m_worldMatrix.dx, this.m_worldMatrix.dy), FZ.GameBase.MainContext.beginPath(), FZ.GameBase.MainContext.moveTo(FZ.GameDefs.DREAMPET_OFFSET_X + FZ.GameDefs.GRID_WIDTH * this.m_PointPath[c][0] + FZ.GameDefs.GRID_WIDTH_HALF, FZ.GameDefs.DREAMPET_OFFSET_Y + FZ.GameDefs.GRID_HEIGHT * this.m_PointPath[c][1] + FZ.GameDefs.GRID_HEIGHT_HALF), FZ.GameBase.MainContext.lineTo(FZ.GameDefs.DREAMPET_OFFSET_X + FZ.GameDefs.GRID_WIDTH * b[0] + FZ.GameDefs.GRID_WIDTH_HALF, FZ.GameDefs.DREAMPET_OFFSET_Y + FZ.GameDefs.GRID_HEIGHT * b[1] + FZ.GameDefs.GRID_HEIGHT_HALF), FZ.GameBase.MainContext.closePath(), FZ.GameBase.MainContext.stroke()
- },
- showPets: function () {
- var a = null;
- for (var b = 0; b < FZ.GameDefs.ALL_GENERAL; b++) a = this.m_allPets[b], a.m_div && (a.m_div.style.visibility = "visible")
- },
- hidePets: function () {
- var a = null;
- for (var b = 0; b < FZ.GameDefs.ALL_GENERAL; b++) a = this.m_allPets[b], a.m_div && (a.m_div.style.visibility = "hidden")
- },
- resumeLevel: function () {
- this.m_score = FZ.GameBase.SaveObject.m_cur_score, this.m_hintCount = FZ.GameBase.SaveObject.m_cur_hintCount, this.m_left_pet = FZ.GameBase.SaveObject.m_cur_left_pet, this.m_level = FZ.GameBase.SaveObject.m_cur_level;
- var a, b = null,
- c = null;
- c = [];
- var d = 0,
- e = 0,
- f = 0,
- g = FZ.GameDefs.DREAMPET_INIT;
- this.clearAllPets();
- for (a = 0; a < FZ.GameDefs.ALL_GENERAL; a++) g = FZ.GameBase.SaveObject.m_data[a].state, f = FZ.GameBase.SaveObject.m_data[a].style, d = Math.floor(a / (FZ.GameDefs.DREAMPET_NUM_COL + 2)), e = a % (FZ.GameDefs.DREAMPET_NUM_COL + 2), b = null, b = new FZ.Diamond(d, e, f, g), this.m_allPets.push(b), FZ.GameDefs.DREAMPET_REMOVE !== g && this.m_parent.appendChild(b.m_div), FZ.GameDefs.DREAMPET_FOCUS === g && (this.m_firstPet = b)
- },
- saveLevel: function () {
- FZ.GameBase.SaveObject.m_gamein = !0, FZ.GameBase.SaveObject.m_cur_score = this.m_score, FZ.GameBase.SaveObject.m_cur_hintCount = this.m_hintCount, FZ.GameBase.SaveObject.m_cur_left_pet = this.m_left_pet, FZ.GameBase.SaveObject.m_level_usedTime = FZ.Game.GameState.m_level_usedTime, FZ.TargetMobile !== FZ.TARGET_DEF.ANDRIOD && (FZ.GameBase.SaveObject.m_sound = FZ.Game.GameState.m_sound);
- var a, b = null,
- c = null;
- c = FZ.GameBase.SaveObject.m_data;
- for (a = 0; a < FZ.GameDefs.ALL_GENERAL; a++) c[a].style = this.m_allPets[a].m_style, c[a].state = this.m_allPets[a].m_state;
- FZ.GameBase.saveGame()
- },
- initAllPets: function (a) {
- var b = 0,
- c = 0,
- d = 0,
- e = FZ.GameDefs.DREAMPET_INIT,
- f = 0,
- g = null,
- h = null;
- h = h || [], this.m_bonus_time = 0, this.m_score = 0, this.m_hintCount = FZ.GameDefs.LEVEL_HINT_NUMBER[this.getLevel()], this.clearAllPets(), this.m_left_pet = FZ.GameDefs.ALL_PET_NUM;
- var i = 0,
- j = 0;
- i = FZ.Math.random(0, FZ.GameDefs.DIAMOND_TYPES - FZ.GameDefs.LEVEL_PET_KIND[FZ.GameBase.SaveObject.m_cur_level]), i < 0 && (i = 0), j = i + FZ.GameDefs.LEVEL_PET_KIND[FZ.GameBase.SaveObject.m_cur_level];
- for (f = 0; f < FZ.GameDefs.ALL_GENERAL_HALF; f++) {
- d = FZ.Math.random(i, j), e = FZ.GameDefs.DREAMPET_INIT, b = Math.floor(f / (FZ.GameDefs.DREAMPET_NUM_COL + 2)), c = f % (FZ.GameDefs.DREAMPET_NUM_COL + 2);
- if (b === 0 || b === FZ.GameDefs.DREAMPET_NUM_LINE + 1 || c === 0 || c === FZ.GameDefs.DREAMPET_NUM_COL + 1) e = FZ.GameDefs.DREAMPET_REMOVE, d = -1;
- g = null, g = new FZ.Diamond(b, c, d, e), this.m_allPets.push(g), FZ.GameDefs.DREAMPET_REMOVE !== e && this.m_parent.appendChild(g.m_div), h.push(g)
- }
- var k = null,
- l;
- for (f = FZ.GameDefs.ALL_GENERAL_HALF; f < FZ.GameDefs.ALL_GENERAL; f++) {
- l = Math.floor(FZ.Math.random(0, h.length)), e = FZ.GameDefs.DREAMPET_INIT, d = h[l].getStyle(), b = Math.floor(f / (FZ.GameDefs.DREAMPET_NUM_COL + 2)), c = f % (FZ.GameDefs.DREAMPET_NUM_COL + 2);
- if (-1 === d)
- if (b !== 0 && b !== FZ.GameDefs.DREAMPET_NUM_LINE + 1 && c !== 0 && c !== FZ.GameDefs.DREAMPET_NUM_COL + 1) {
- l = Math.floor(FZ.Math.random(0, h.length)), d = h[l].getStyle();
- while (-1 === d) l = Math.floor(FZ.Math.random(0, h.length)), d = h[l].getStyle()
- } else e = FZ.GameDefs.DREAMPET_REMOVE, d = -1;
- else if (b === 0 || b === FZ.GameDefs.DREAMPET_NUM_LINE + 1 || c === 0 || c === FZ.GameDefs.DREAMPET_NUM_COL + 1) {
- l = Math.floor(FZ.Math.random(0, h.length)), d = h[l].getStyle();
- while (-1 !== d) l = Math.floor(FZ.Math.random(0, h.length)), d = h[l].getStyle();
- e = FZ.GameDefs.DREAMPET_REMOVE
- }
- h.splice(l, 1), g = null, g = new FZ.Diamond(b, c, d, e), this.m_allPets.push(g), FZ.GameDefs.DREAMPET_REMOVE !== e && this.m_parent.appendChild(g.m_div)
- }
- this.m_leftNum = -1, this.m_dialog = !1
- },
- debugAllPetsType: function () {
- var a = 0;
- debug_data = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, -1, -1, 2, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, 1, 1, 1, -1, -1, 1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1];
- for (a = 0; a < FZ.GameDefs.ALL_GENERAL; a++) - 1 !== debug_data[a] && (this.m_allPets[a].m_module = debug_data[a], this.m_allPets[a].m_style = debug_data[a]), this.m_allPets[a].setModule(), -1 === debug_data[a] ? this.m_allPets[a].m_state = -1 : this.m_allPets[a].m_state = 0
- },
- getDiamondNumber: function (a) {
- var b = 0,
- c = 0,
- d = null;
- for (c = a; c < FZ.GameDefs.ALL_GENERAL; c += FZ.GameDefs.DIAMOND_COL_NUM) d = this.m_allPets[c], null !== d && b++;
- return b
- },
- getLeftDiamonds: function () {
- var a = null,
- b = 0,
- c = 0;
- for (b = 0; b < FZ.GameDefs.ALL_GENERAL; b++) {
- a = this.m_allPets[b];
- if (!a) continue;
- c++
- }
- return c
- },
- getLevel: function () {
- return this.m_level
- },
- setLevel: function (a) {
- this.m_level = a
- },
- getHintCount: function () {
- return this.m_hintCount
- },
- setHintCount: function (a) {
- this.m_hintCount = a;
- },
- mouseHandler: function (a) {
- //a.preventDefault();
- var b = !1,
- c = "",
- d = 0,
- e = 0;
- if ( !! this.m_reset_finished) {
- FZ.TARGET_DEF.MOBILE === FZ.TargetPort ? FZ.EVENT_DEF.T_START === a.type ? (c = FZ.EVENT_DEF.M_MOVE, d = a.touches[0].pageX - FZ.DivManager.getOffsetX(), e = a.touches[0].pageY - FZ.DivManager.getOffsetY(), this.m_last_x = d, this.m_last_y = e) : FZ.EVENT_DEF.T_MOVE === a.type ? (c = FZ.EVENT_DEF.M_MOVE, d = a.touches[0].pageX - FZ.DivManager.getOffsetX(), e = a.touches[0].pageY - FZ.DivManager.getOffsetY(), this.m_last_x = d, this.m_last_y = e) : FZ.EVENT_DEF.T_END === a.type && (c = FZ.EVENT_DEF.M_CLICK, d = this.m_last_x, e = this.m_last_y, this.m_last_x = 0, this.m_last_y = 0) : (d = a.pageX - FZ.DivManager.getOffsetX(), e = a.pageY - FZ.DivManager.getOffsetY(), c = a.type);
- if (FZ.EVENT_DEF.M_MOVE !== c && FZ.EVENT_DEF.M_CLICK === c) {
- b = this.setPetDisappear(d, e);
- if (b === !1) return;
- this.m_observer && this.m_observer.checkWin && this.m_observer.checkWin()
- }
- return !1
- }
- }
- }),
- function () {
- FZ.UIButton = FZ.newClass({
- SWITCH_ON: 0,
- SWITCH_OFF: 1,
- m_w: 0,
- m_h: 0,
- m_col: 1,
- m_div: null,
- m_img_list: null,
- m_call_mOver: null,
- m_call_mOut: null,
- m_call_mMove: null,
- m_call_mClick: null,
- m_call_tStart: null,
- m_call_tMove: null,
- m_call_tEnd: null,
- m_is_switch: !1,
- m_btn_state: 0,
- m_observer: null,
- m_enable: !0,
- init: function (a, b, c, d, e) {
- this.m_col = c, this.m_w = a, this.m_h = b, this.m_div = document.createElement("div"), this.m_div.style.position = "absolute", this.m_div.style.width = this.m_w + "px", this.m_div.style.height = this.m_h + "px", this.m_img_list = [], this.m_img_list.push(d), this.m_img_list.push(e), this.m_div.style.backgroundRepeat = "no-repeat", this.m_div.style.backgroundImage = "url(res/images/" + this.m_img_list[0] + ")", this.m_div.style.backgroundPosition = "0px 0px", this.m_enable = !0, this.m_is_switch = !1, this.setEnable(this.m_enable)
- },
- setSwitchButton: function (a, b) {
- this.m_is_switch = !0, this.m_btn_state = this.SWITCH_ON, this.m_img_list.push(a), this.m_img_list.push(b)
- },
- setSwitchState: function (a) {
- var b = 0;
- this.m_btn_state = a, this.SWITCH_OFF === this.m_btn_state && (b = 2), this.m_div.style.backgroundImage = "url(res/images/" + this.m_img_list[b + 0] + ")"
- },
- setEnable: function (a) {
- this.m_enable = a, this.m_enable ? this.addEvent() : this.removeEvent()
- },
- setPos: function (a, b) {
- this.m_div.style.left = a + "px", this.m_div.style.top = b + "px"
- },
- addEvent: function () {
- this.removeEvent(), FZ.TARGET_DEF.MOBILE === FZ.TargetPort ? (FZ.EventHandler(this, this.m_div, FZ.EVENT_DEF.T_START, this.mouseHandler), FZ.EventHandler(this, this.m_div, FZ.EVENT_DEF.T_MOVE, this.mouseHandler), FZ.EventHandler(this, this.m_div, FZ.EVENT_DEF.T_END, this.mouseHandler)) : (FZ.EventHandler(this, this.m_div, FZ.EVENT_DEF.M_OVER, this.mouseHandler), FZ.EventHandler(this, this.m_div, FZ.EVENT_DEF.M_MOVE, this.mouseHandler), FZ.EventHandler(this, this.m_div, FZ.EVENT_DEF.M_OUT, this.mouseHandler), FZ.EventHandler(this, this.m_div, FZ.EVENT_DEF.M_CLICK, this.mouseHandler))
- },
- removeEvent: function () {
- FZ.TARGET_DEF.MOBILE === FZ.TargetPort ? (FZ.EventRemove(this, this.m_div, FZ.EVENT_DEF.T_START, this.m_call_tStart), this.m_call_tStart = null, FZ.EventRemove(this, this.m_div, FZ.EVENT_DEF.T_MOVE, this.m_call_tMove), this.m_call_tMove = null, FZ.EventRemove(this, this.m_div, FZ.EVENT_DEF.T_END, this.m_call_tEnd), this.m_call_tEnd = null) : (FZ.EventRemove(this, this.m_div, FZ.EVENT_DEF.M_OVER, this.m_call_mOver), this.m_call_mOver = null, FZ.EventRemove(this, this.m_div, FZ.EVENT_DEF.M_OUT, this.m_call_mOut), this.m_call_mOut = null, FZ.EventRemove(this, this.m_div, FZ.EVENT_DEF.M_MOVE, this.m_call_mMove), this.m_call_mMove = null, FZ.EventRemove(this, this.m_div, FZ.EVENT_DEF.M_CLICK, this.m_call_mClick), this.m_call_mClick = null)
- },
- addMonitor: function (a) {
- this.m_observer = a
- },
- removeMonitor: function () {
- this.m_observer = null
- },
- mouseHandler: function (a) {
- var b = "",
- c = 0;
- a.stopPropagation(), null, this.m_is_switch && this.SWITCH_OFF === this.m_btn_state && (c = 2), FZ.TARGET_DEF.MOBILE === FZ.TargetPort ? (FZ.EVENT_DEF.T_START === a.type && (b = FZ.EVENT_DEF.M_OVER), FZ.EVENT_DEF.T_END === a.type && (b = FZ.EVENT_DEF.M_CLICK)) : b = a.type, FZ.EVENT_DEF.M_OVER === b ? FZ.Game.GameState.m_gamePause === !0 ? this === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_HOME_INDEX] ? this.m_div.style.backgroundImage = "url(res/images/BTN_MAIN_MENU_ICON_TOUCH.png)" : this === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_HINT_INDEX] ? this.m_div.style.backgroundImage = "url(res/images/BTN_HINT_GREY.png)" : this === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_PAUSE_INDEX] ? this.m_div.style.backgroundImage = "url(res/images/" + this.m_img_list[c + 1] + ")" : FZ.Game.GameState.BTN_SOUND_INDEX !== undefined && (this.SWITCH_OFF === this.m_btn_state && this === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX] && (this.m_div.style.backgroundImage = "url(res/images/BTN_SOUND_OFF_GREY.png)"), this.SWITCH_ON === this.m_btn_state && this === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX] && (this.m_div.style.backgroundImage = "url(res/images/BTN_SOUND_GREY.png)")) : this.m_div.style.backgroundImage = "url(res/images/" + this.m_img_list[c + 1] + ")" : FZ.EVENT_DEF.M_OUT === b ? FZ.Game.GameState.m_gamePause === !0 ? this === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_HOME_INDEX] ? this.m_div.style.backgroundImage = "url(res/images/BTN_MAIN_MENU_ICON.png)" : this === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_HINT_INDEX] ? this.m_div.style.backgroundImage = "url(res/images/BTN_HINT_GREY.png)" : this === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_PAUSE_INDEX] ? this.m_div.style.backgroundImage = "url(res/images/" + this.m_img_list[c + 0] + ")" : FZ.Game.GameState.BTN_SOUND_INDEX !== undefined && (this.SWITCH_OFF === this.m_btn_state && this === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX] && (this.m_div.style.backgroundImage = "url(res/images/BTN_SOUND_OFF_GREY.png)"), this.SWITCH_ON === this.m_btn_state && this === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX] && (this.m_div.style.backgroundImage = "url(res/images/BTN_SOUND_GREY.png)")) : this.m_div.style.backgroundImage = "url(res/images/" + this.m_img_list[c + 0] + ")" : FZ.EVENT_DEF.M_CLICK === b && (FZ.Game.GameState.m_gamePause === !0 ? this === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_HOME_INDEX] ? this.m_div.style.backgroundImage = "url(res/images/BTN_MAIN_MENU_ICON.png)" : this === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_HINT_INDEX] ? this.m_div.style.backgroundImage = "url(res/images/BTN_HINT_GREY.png)" : this === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_PAUSE_INDEX] ? this.m_div.style.backgroundImage = "url(res/images/" + this.m_img_list[c + 0] + ")" : FZ.Game.GameState.BTN_SOUND_INDEX !== undefined && (this.SWITCH_OFF === this.m_btn_state && this === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX] && (this.m_div.style.backgroundImage = "url(res/images/BTN_SOUND_OFF_GREY.png)"), this.SWITCH_ON === this.m_btn_state && this === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX] && (this.m_div.style.backgroundImage = "url(res/images/BTN_SOUND_GREY.png)")) : this.m_div.style.backgroundImage = "url(res/images/" + this.m_img_list[c + 0] + ")", null !== this.m_observer && this.m_observer.buttonClick && this.m_observer.buttonClick(this));
- return !1
- }
- })
- }(),
- function () {
- FZ.UIMenu = FZ.newClass({
- MENU_SHOW: 0,
- MENU_HIDE: 1,
- m_div: null,
- m_back_div: null,
- m_btn_list: null,
- m_back_w: 0,
- m_back_h: 0,
- m_observer: null,
- m_state: 0,
- m_show_x: 0,
- m_show_y: 0,
- m_hide_x: 0,
- m_hide_y: 0,
- m_btn_enable: null,
- init: function () {
- this.m_div = document.createElement("div"), this.m_div.style.position = "absolute", this.m_div.style.webkitTransition = "translate", this.m_btn_list = [], this.m_back_div = document.createElement("div"), this.setState(this.MENU_SHOW, 0)
- },
- setBackImage: function (a, b, c) {
- var d = null;
- undefined !== b && (this.m_back_w = b), undefined !== c && (this.m_back_h = c), this.m_div.style.width = this.m_back_w + "px", this.m_div.style.height = this.m_back_h + "px", this.m_back_div.style.width = this.m_back_w + "px", this.m_back_div.style.height = this.m_back_h + "px", this.m_back_div.style.position = "absolute", this.m_back_div.style.backgroundRepeat = "no-repeat", this.m_back_div.style.backgroundImage = "url(res/images/" + a + ")", this.m_back_div.style.backgroundPosition = "0px; 0px", this.m_div.appendChild(this.m_back_div)
- },
- setzIndex: function (a) {
- this.m_div.style.zIndex = a
- },
- setPos: function (a, b) {
- this.m_div.style.webkitTransitionDuration = "0.2s", this.m_div.style.webkitTransform = "translate(" + a + "px, " + b + "px)"
- },
- setShowPos: function (a, b) {
- this.m_show_x = a, this.m_show_y = b
- },
- setHidePos: function (a, b) {
- this.m_hide_x = a, this.m_hide_y = b
- },
- addMonitor: function (a) {
- this.m_observer = a
- },
- removeMonitor: function () {
- this.m_observer = null
- },
- setEnableBtn: function (a) {
- this.m_btn_enable = a, a.m_div.style.zIndex = 1
- },
- addButton: function (a) {
- this.m_div.appendChild(a.m_div), this.m_btn_list.push(a)
- },
- addEnableBtn: function () {
- switch (this.m_state) {
- case this.MENU_SHOW:
- this.m_btn_enable && this.m_btn_enable.setSwitchState(this.m_btn_enable.SWITCH_OFF);
- break;
- case this.MENU_HIDE:
- this.m_btn_enable && this.m_btn_enable.setSwitchState(this.m_btn_enable.SWITCH_ON);
- break;
- default:
- }
- },
- setState: function (a, b) {
- this.m_state = a;
- switch (this.m_state) {
- case this.MENU_SHOW:
- this.setPos(this.m_show_x, this.m_show_y);
- break;
- case this.MENU_HIDE:
- this.setPos(this.m_hide_x, this.m_hide_y);
- break;
- default:
- }
- this.addEnableBtn()
- },
- removeButton: function (a) {
- var b = -1,
- c = 0;
- for (c = 0; c < this.m_btn_list.length; c++)
- if (a === this.m_btn_list[c]) {
- b = c;
- break
- } - 1 !== b && (a.removeEvent(), a.removeMonitor(), this.m_btn_list.splice(b, 1))
- },
- addEvent: function () {
- var a = 0,
- b = null;
- for (a = 0; a < this.m_btn_list.length; a++) b = this.m_btn_list[a], b.addMonitor(this), b.setEnable(!0)
- },
- removeEvent: function (a) {
- var b = 0,
- c = null;
- for (b = 0; b < this.m_btn_list.length; b++) c = this.m_btn_list[b], c.removeMonitor(), c.setEnable(!1)
- },
- buttonClick: function (a) {
- null !== this.m_observer && this.m_observer.menuItemClick && this.m_observer.menuItemClick(a)
- }
- })
- }(), FZ.Game.LogoState = new(FZ.newClass({
- StateName: FZ.StateDefs.GAME_STATE_LOGO,
- CUR_UI_DEFS: ["splash"],
- m_test_timer: 0,
- preProcess: function () {
- this.m_main_div.style.webkitTransition = "opacity", this.m_main_div.style.backgroundColor = "#fff", this.m_main_div.style.width = FZ.GameDefs.SCREEN_W + "px", this.m_main_div.style.height = FZ.GameDefs.SCREEN_H + "px", this.m_main_div.style.webkitTransitionDuration = "0s", this.m_main_div.style.opacity = 0, FZ.DivManager.addChild(this.m_main_div), this.m_timer = setTimeout(FZ.Tools.bind(this, this.fade_in), 10)
- },
- postProcess: function () {
- FZ.DivManager.removeChild(this.m_main_div), clearTimeout(this.m_timer)
- },
- fade_in: function () {
- this.m_main_div.style.webkitTransitionDuration = "10ms", this.m_main_div.style.opacity = 1, this.m_timer = setTimeout(FZ.Tools.bind(this, this.fade_out), 10)
- },
- fade_out: function () {
- this.m_main_div.style.webkitTransitionDuration = "10ms", this.m_main_div.style.opacity = 0, this.m_timer = setTimeout(FZ.Tools.bind(this, this.fade_end), 10)
- },
- fade_end: function () {
- FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_LOADING)
- },
- AIUpdate: function (a) {}
- }, FZ.BaseState)), FZ.Game.LoadingState = new(FZ.newClass({
- StateName: FZ.StateDefs.GAME_STATE_LOADING,
- CUR_UI_DEFS: ["majong_BG", "LOADING_BG", "loading_empty", "loading_full"],
- m_test_timer: 0,
- m_bar_w: 0,
- m_bar_div: null,
- preProcess: function () {
- var a = null,
- b = this,
- c = 0,
- d = null;
- this.createUIs(this.CUR_UI_DEFS), d = FZ.getImgInfo(this.CUR_UI_DEFS[3]), this.m_bar_w = d.w, this.m_bar_div = this.m_ui_list[3], this.m_bar_div.style.overflow = "hidden", this.m_bar_div.style.display = "none";
- for (c = 0; c < FZ.IphoneUI.length; c++) d = FZ.IphoneUI[c], FZ.spriteManager.addResource(d.name, d.zOrder, "res/images/" + d.fileURL, d.x, d.y, d.cols);
- FZ.ResourceManager.addResource({
- Name: "BGMusic",
- Type: "Audio",
- URL: FZ.IphoneMusic[0]
- }), FZ.DivManager.addChild(this.m_main_div), this.resetTranslate(0), setTimeout(function () {
- b.fade_in.call(b, 2e3, 1)
- }, 10), this.m_timer = setTimeout(FZ.Tools.bind(this, this.AIUpdate), 100)
- },
- postProcess: function () {
- FZ.DivManager.removeChild(this.m_main_div), clearTimeout(this.m_timer)
- },
- AIUpdate: function (a) {
- var b = 0;
- this.m_timer = setTimeout(FZ.Tools.bind(this, this.AIUpdate), 200), 0 !== FZ.ResourceManager.__ResourceCount && (b = this.m_bar_w * FZ.ResourceManager.__ResourceLoaded / FZ.ResourceManager.__ResourceCount), this.m_bar_div.style.width = "" + b + "px", this.m_bar_div.style.display = "inline";
- if (FZ.ResourceManager.isResourceLoaded()) {
- var c = FZ.ResourceManager.ResourceLib.BGMusic.Resource;
- FZ.Music.set(c, !0), FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_MAINMEN)
- }
- }
- }, FZ.BaseState)), FZ.Game.MainmenuState = new(FZ.newClass({
- StateName: FZ.StateDefs.GAME_STATE_MAINMEN,
- CUR_UI_DEFS: ["majong_BG_MAINMENU", "MAIN_MENU_BG"],
- BTN_PLAY_INDEX: 0,
- CUR_BTN_ANDROID_DEFS: [
- ["BTN_GAME_START", "BTN_GAME_START_TOUCH"],
- ["BTN_GAME_CONTINUE", "BTN_GAME_CONTINUE_TOUCH"]
- ],
- CUR_BTN_DEFS: [
- ["BTN_GAME_START", "BTN_GAME_START_TOUCH"],
- ["BTN_GAME_CONTINUE", "BTN_GAME_CONTINUE_TOUCH"],
- ["BTN_MENU_SOUND", "BTN_MENU_SOUND_TOUCH"]
- ],
- SOUND_SWITCH_DEFS: ["BTN_MENU_SOUND_OFF", "BTN_MENU_SOUND_OFF_TOUCH"],
- BTN_NEW_GAME_INDEX: 0,
- BTN_SOUND_INDEX: 2,
- BTN_CONTINUE_INDEX: 1,
- m_load_ui: !1,
- m_next_state: "",
- preProcess: function () {
- var a = 0,
- b = null,
- c = null,
- d = null,
- e = null,
- f = this;
- //屏蔽音乐按钮
- this.m_load_ui || (this.createUIs(this.CUR_UI_DEFS), FZ.TargetMobile !== FZ.TARGET_DEF.ANDRIOD ? this.createBtns(this.CUR_BTN_DEFS, !0) : this.createBtns(this.CUR_BTN_ANDROID_DEFS, !0), FZ.TargetMobile !== FZ.TARGET_DEF.ANDRIOD && (c = FZ.getImgInfo(this.SOUND_SWITCH_DEFS[0]), cloneInfo = FZ.getImgInfo(this.SOUND_SWITCH_DEFS[1]), this.m_btn_list[this.BTN_SOUND_INDEX].setSwitchButton(c.fileURL, cloneInfo.fileURL)), FZ.DivManager.addChild(this.m_main_div), FZ.TargetMobile !== FZ.TARGET_DEF.ANDRIOD && (this.m_sound = FZ.GameBase.SaveObject.m_sound, FZ.Music.setMute(!this.m_sound)), this.m_load_ui = !0);
- //this.m_load_ui || (this.createUIs(this.CUR_UI_DEFS), FZ.TargetMobile == null ? this.createBtns(this.CUR_BTN_DEFS, !0) : this.createBtns(this.CUR_BTN_ANDROID_DEFS, !0), FZ.TargetMobile == null && (c = FZ.getImgInfo(this.SOUND_SWITCH_DEFS[0]), cloneInfo = FZ.getImgInfo(this.SOUND_SWITCH_DEFS[1]), this.m_btn_list[this.BTN_SOUND_INDEX].setSwitchButton(c.fileURL, cloneInfo.fileURL)), FZ.DivManager.addChild(this.m_main_div), FZ.TargetMobile == null && (this.m_sound = FZ.GameBase.SaveObject.m_sound, FZ.Music.setMute(!this.m_sound)), this.m_load_ui = !0);
-
- if (FZ.TargetMobile !== FZ.TARGET_DEF.ANDRIOD) {
- this.m_sound = FZ.GameBase.SaveObject.m_sound;
- var b = this.m_btn_list[this.BTN_SOUND_INDEX];
- this.m_sound === !0 ? b.setSwitchState(b.SWITCH_ON) : b.setSwitchState(b.SWITCH_OFF)
- }
-
- FZ.GameBase.SaveObject.m_cur_level === 0 ? (this.m_btn_list[this.BTN_PLAY_INDEX].setEnable(!0), this.m_btn_list[this.BTN_PLAY_INDEX].m_div.style.display = "inline", this.m_btn_list[this.BTN_CONTINUE_INDEX].setEnable(!1), this.m_btn_list[this.BTN_CONTINUE_INDEX].m_div.style.display = "none") : FZ.GameBase.SaveObject.pass ? (this.m_btn_list[this.BTN_PLAY_INDEX].setEnable(!0), this.m_btn_list[this.BTN_PLAY_INDEX].m_div.style.display = "inline", this.m_btn_list[this.BTN_CONTINUE_INDEX].setEnable(!1), this.m_btn_list[this.BTN_CONTINUE_INDEX].m_div.style.display = "none", FZ.GameBase.SaveObject.m_cur_level = 0, FZ.GameBase.SaveObject.pass = !1, FZ.GameBase.SaveObject.score = 0, FZ.GameBase.SaveObject.m_hint = FZ.GameDefs.LEVEL_HINT_NUMBER[1], FZ.GameBase.SaveObject.m_gamein = !1, FZ.GameBase.saveGame()) : (this.m_btn_list[this.BTN_PLAY_INDEX].setEnable(!0), this.m_btn_list[this.BTN_PLAY_INDEX].m_div.style.display = "inline", this.m_btn_list[this.BTN_CONTINUE_INDEX].setEnable(!0), this.m_btn_list[this.BTN_CONTINUE_INDEX].m_div.style.display = "inline"), this.m_main_div.style.display = "inline", this.resetTranslate(.5), setTimeout(function () {
- f.fade_in.call(f, 2e3, 1)
- }, 10)
- },
- postProcess: function () {
- this.m_next_state !== FZ.StateDefs.GAME_STATE_GAME_CLEAR && this.fade_out(2e3, 0, 0)
- },
- pause: function () {
- clearTimeout(this.m_timer)
- },
- resume: function () {
- arguments.length > 0 && (statename = arguments[0]);
- if (arguments.length > 1) {
- if (arguments[1] === "yes") {
- FZ.GameBase.SaveObject.m_cur_level = 0, FZ.GameBase.SaveObject.pass = !1, FZ.GameBase.SaveObject.score = 0, FZ.GameBase.SaveObject.m_hint = FZ.GameDefs.LEVEL_HINT_NUMBER[1], FZ.GameBase.SaveObject.m_gamein = !1, FZ.GameBase.saveGame(), FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_GAME_IN);
- return
- }
- this.m_next_state = FZ.StateDefs.GAME_STATE_MAINMEN
- }
- },
- buttonClick: function (a) {
- this.m_btn_list[this.BTN_PLAY_INDEX] === a ? FZ.GameBase.SaveObject.m_cur_level === 0 ? FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_GAME_IN) : (this.m_next_state = FZ.StateDefs.GAME_STATE_GAME_CLEAR, this.pause(), FZ.GameBase.pushState(this.StateName), FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_GAME_CLEAR)) : this.m_btn_list[this.BTN_SOUND_INDEX] === a ? (this.m_sound = !this.m_sound, FZ.Music.setMute(!this.m_sound), this.m_sound ? a.setSwitchState(a.SWITCH_ON) : a.setSwitchState(a.SWITCH_OFF), FZ.GameBase.SaveObject.m_sound = this.m_sound, FZ.GameBase.saveGame()) : this.m_btn_list[this.BTN_CONTINUE_INDEX] === a && FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_GAME_IN)
- }
- }, FZ.BaseState)), FZ.Game.ResetState = new(FZ.newClass({
- StateName: FZ.StateDefs.GAME_STATE_RESET,
- CUR_UI_DEFS: ["NEXT_LEVEL_BG", "TXT_ARE_YOU_SURE"],
- BTN_YES_INDEX: 0,
- BTN_NO_INDEX: 1,
- CUR_BTN_DEFS: [
- ["BTN_GAME_YES", "BTN_GAME_YES_TOUCH"],
- ["BTN_GAME_NO", "BTN_GAME_NO_TOUCH"]
- ],
- m_ui_list: null,
- m_btn_list: null,
- popState: !1,
- m_load_ui: !1,
- preProcess: function () {
- var a = null,
- b = null,
- c = null,
- d = 0,
- e = this;
- this.m_load_ui ? this.m_main_div.style.display = "inline" : (this.createUIs(this.CUR_UI_DEFS), this.createBtns(this.CUR_BTN_DEFS, !0), FZ.DivManager.addChild(this.m_main_div), this.m_load_ui = !0), this.popState = !1, setTimeout(function () {
- e.fade_in.call(e, 2e3, 1)
- }, 10)
- },
- postProcess: function () {
- this.m_main_div.style.display = "none"
- },
- buttonClick: function (a) {
- if (!this.popState) {
- var b = null;
- this.m_btn_list[this.BTN_YES_INDEX] === a ? (this.postProcess(), this.popState = !0, FZ.GameBase.popState(this.StateName, "yes")) : this.m_btn_list[this.BTN_NO_INDEX] === a && (this.postProcess(), this.popState = !0, FZ.GameBase.popState(this.StateName, "no"))
- }
- }
- }, FZ.BaseState)),
- function () {
- var a = !1,
- b = null;
- FZ.Game.GameState = new(FZ.newClass({
- StateName: FZ.StateDefs.GAME_STATE_GAME_IN,
- CUR_UI_DEFS: ["majong_BG_GAME", "game_in_BG", "TIME_EMPTY", "TIME__FULL", "NUM_LEVEL_0", "ARROW_UP_DOWN", "ARROW_LEFT_RIGHT", "ARROW_DOWN", "ARROW_RIGHT", "ARROW_LEFT", "ARROW_UP", "number_score_1", "number_score_2", "number_score_3", "number_score_4", "number_score_5"],
- UI_ARROW_START_INDEX: 5,
- UI_ARROW_KINDS: 6,
- UI_SCORE_START_INDEX: 11,
- UI_TIME_BAR_INDEX: 3,
- UI_LEVEL_NUM_INDEX: 4,
- BTN_HOME_INDEX: 0,
- BTN_HINT_INDEX: 1,
- BTN_PAUSE_INDEX: 2,
- BTN_START_INDEX: 3,
- BTN_SOUND_INDEX: 3,
- CUR_BTN_DEFS: [
- ["BTN_MAIN_MENU_ICON", "BTN_MAIN_MENU_ICON_TOUCH"],
- ["BTN_HINT", "BTN_HINT_TOUCH"],
- ["BTN_PAUSE", "BTN_PAUSE_TOUCH"],
- ["BTN_SOUND", "BTN_SOUND_TOUCH"]
- ],
- CUR_BTN_ANDROID_DEFS: [
- ["BTN_MAIN_MENU_ICON", "BTN_MAIN_MENU_ICON_TOUCH"],
- ["BTN_HINT", "BTN_HINT_TOUCH"],
- ["BTN_PAUSE", "BTN_PAUSE_TOUCH"]
- ],
- CUR_SWITCH_DEFS: ["BTN_START", "BTN_START_TOUCH"],
- SOUND_SWITCH_DEFS: ["BTN_SOUND_OFF", "BTN_SOUND_OFF_TOUCH"],
- m_isNoMatch: !1,
- m_label_list: null,
- m_levelStart: !1,
- m_diamondMgr: null,
- m_load_ui: !1,
- m_curLevel_div: null,
- m_next_state: "",
- m_slide_menu: null,
- m_hint_num_div: null,
- m_pause_div: null,
- m_str_nomatch_div: null,
- m_time_bar_div: null,
- m_time_bar_w: 0,
- m_call_tStart: null,
- m_call_mClick: null,
- m_call_time: null,
- m_level_usedTime: 0,
- levelStartTime: 0,
- levelCurrentTime: 0,
- levelPauseStartTime: 0,
- levelPauseEndTime: 0,
- levelPauseTime: 0,
- curLevelUsedTime: 0,
- m_gamePause: !1,
- pageHiddin: !1,
- STR_SCORE_RECT: [120, 28, 50, 20],
- STR_TIME_RECT: [120, 48, 50, 20],
- createStrDiv: function (a) {
- var b = document.createElement("div");
- b.style.position = "absolute", b.style.width = a[2] + "px", b.style.height = a[3] + "px", b.style.left = a[0] + "px", b.style.top = a[1] + "px", b.style.color = "#fff", b.style.fontSize = FZ.GameDefs.STATS_FONT_SIZE + "px", b.style.fontFamily = "Arial", b.style.lineHeight = a[3] + "px", b.style.textAlign = "left", this.m_main_div.appendChild(b);
- return b
- },
- pause: function () {
- clearTimeout(this.m_timer)
- },
- resume: function () {
- var a = null;
- arguments.length > 0 && (a = arguments[0]);
- if (null !== this.m_diamondMgr) {
- this.m_time_bar_div.style.display = "inline";
- if (FZ.StateDefs.GAME_STATE_OVER == a) {
- this.m_time_bar_div.style.width = this.m_time_bar_w + "px", this.m_btn_list[this.BTN_HINT_INDEX].setEnable(!0), this.m_diamondMgr.initAllPets(!0), this.m_diamondMgr.showPets(), this.levelStartTime = (new Date).getTime(), this.levelCurrentTime = this.levelStartTime, this.levelPauseStartTime = this.levelStartTime, this.levelPauseEndTime = this.levelStartTime, this.levelPauseTime = 0, this.curLevelUsedTime = 0, this.m_btn_list[this.BTN_HINT_INDEX].m_div.style.backgroundImage = "url(res/images/" + this.m_btn_list[this.BTN_HINT_INDEX].m_img_list[0] + ")", this.m_game_bg_div = this.m_ui_list[1], this.m_diamondMgr.setHintCount(FZ.GameBase.SaveObject.m_hint), this.m_diamondMgr.setLevel(FZ.GameBase.SaveObject.m_cur_level);
- var b = this.m_diamondMgr.getHintCount();
- this.m_hint_num_div[0].style.visibility = "visible", this.m_hint_num_div[1].style.visibility = "visible";
- if (b >= 10) {
- var c = Math.floor(b % 10);
- this.m_hint_num_div[0].style.backgroundImage = "url(res/images/NUM_LEVEL_" + c + ".png )", c = Math.floor(b / 10), this.m_hint_num_div[1].style.backgroundImage = "url(res/images/NUM_LEVEL_" + c + ".png )"
- } else b === 0 ? (this.m_hint_num_div[0].style.visibility = "hidden", this.m_hint_num_div[1].style.visibility = "hidden") : (this.m_hint_num_div[1].style.visibility = "hidden", this.m_hint_num_div[0].style.backgroundImage = "url(res/images/NUM_LEVEL_" + b + ".png )");
- var d = this.m_diamondMgr.getLevel(),
- e = null;
- e = FZ.getImgInfo("NUM_LEVEL_" + d), this.m_curLevel_div.style.backgroundImage = "url(res/images/" + e.fileURL + ")", this.m_diamondMgr.setParent(this.m_main_div)
- } else if (FZ.StateDefs.GAME_STATE_NEXT_LEVEL == a) {
- this.m_btn_list[this.BTN_HINT_INDEX].m_div.style.backgroundImage = "url(res/images/" + this.m_btn_list[this.BTN_HINT_INDEX].m_img_list[0] + ")", this.m_time_bar_div.style.width = this.m_time_bar_w + "px", this.m_btn_list[this.BTN_HINT_INDEX].setEnable(!0), this.m_diamondMgr.initAllPets(!0), this.m_diamondMgr.hidePets(), this.levelStartTime = (new Date).getTime(), this.levelCurrentTime = this.levelStartTime, this.levelPauseStartTime = this.levelStartTime, this.levelPauseEndTime = this.levelStartTime, this.levelPauseTime = 0, this.curLevelUsedTime = 0, this.m_hint_num_div[0].style.visibility = "visible", this.m_hint_num_div[1].style.visibility = "visible";
- var b = FZ.GameBase.SaveObject.m_hint;
- if (b >= 10) {
- var c = Math.floor(b % 10);
- this.m_hint_num_div[0].style.backgroundImage = "url(res/images/NUM_LEVEL_" + c + ".png )", c = Math.floor(b / 10), this.m_hint_num_div[1].style.backgroundImage = "url(res/images/NUM_LEVEL_" + c + ".png )"
- } else b === 0 ? (this.m_hint_num_div[0].style.visibility = "hidden", this.m_hint_num_div[1].style.visibility = "hidden") : (this.m_hint_num_div[1].style.visibility = "hidden", this.m_hint_num_div[0].style.backgroundImage = "url(res/images/NUM_LEVEL_" + b + ".png )");
- this.m_diamondMgr.setLevel(FZ.GameBase.SaveObject.m_cur_level), this.m_diamondMgr.setHintCount(FZ.GameBase.SaveObject.m_hint);
- var d = this.m_diamondMgr.getLevel();
- switch (d) {
- case 1:
- case 2:
- case 4:
- this.m_levelStart = !0, this.m_diamondMgr.showPets();
- for (var f = 0; f < this.UI_ARROW_KINDS; f++) this.m_ui_list[this.UI_ARROW_START_INDEX + f].style.display = "none";
- this.m_diamondMgr.setParent(this.m_main_div);
- break;
- case 3:
- this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX].style.display = "inline";
- break;
- case 5:
- this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX + 1].style.display = "inline";
- break;
- case 6:
- this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX + 2].style.display = "inline";
- break;
- case 7:
- this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX + 3].style.display = "inline";
- break;
- case 8:
- this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX + 4].style.display = "inline";
- break;
- case 9:
- this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX + 5].style.display = "inline";
- break;
- default:
- }
- var e = null;
- e = FZ.getImgInfo("NUM_LEVEL_" + d), this.m_curLevel_div.style.backgroundImage = "url(res/images/" + e.fileURL + ")", this.m_curLevel_div.style.display = "inline"
- } else if (FZ.StateDefs.GAME_STATE_RESET == a && arguments.length > 1) {
- if (arguments[1] === "yes") {
- this.m_next_state = FZ.StateDefs.GAME_STATE_MAINMEN, this.m_diamondMgr.saveLevel(), setTimeout(function () {
- FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_MAINMEN)
- }, 100);
- return
- }
- this.levelPauseEndTime = (new Date).getTime(), this.levelPauseTime += this.levelPauseEndTime - this.levelPauseStartTime, this.m_diamondMgr.setParent(this.m_main_div)
- }
- }
- this.m_status = FZ.stateStatus.NORMAL, this.m_timer = setTimeout(FZ.Tools.bind(this, this.checkOver), 0)
- },
- setText: function (a, b) {
- a.innerHTML = "" + b
- },
- preProcess: function (b) {
- j = this;
- var c = 0,
- d = null,
- e = null,
- f = null,
- g = null,
- h = null,
- i = FZ.GameBase.SaveObject.m_cur_level,
- j = this;
- if (i === undefined || 0 === i) FZ.GameBase.SaveObject.m_cur_level = 1, FZ.GameBase.saveGame();
- if (!this.m_load_ui) {
- this.m_pause_div = document.createElement("div"), this.m_pause_div.style.zIndex = 200, f = FZ.getImgInfo("PAUSE_BG"), FZ.GameBase.setCss(this.m_pause_div, f), this.m_main_div.appendChild(this.m_pause_div), this.m_pause_div.style.display = "none", this.m_str_nomatch_div = document.createElement("div"), this.m_str_nomatch_div.style.zIndex = 202, f = FZ.getImgInfo("NO_MORE_MATCHS"), FZ.GameBase.setCss(this.m_str_nomatch_div, f), this.m_main_div.appendChild(this.m_str_nomatch_div), this.m_str_nomatch_div.style.display = "none";
- var k = FZ.GameBase.SaveObject.m_hint;
- this.m_hint_num_div = [];
- var l = FZ.AG.SearchSpecialPath.setNumDiv(this.m_hint_num_div, k);
- while (l > 0) this.m_main_div.appendChild(this.m_hint_num_div[l - 1]), l--;
- this.createUIs(this.CUR_UI_DEFS);
- for (var c = 0; c < this.UI_ARROW_KINDS; c++) this.m_ui_list[this.UI_ARROW_START_INDEX + c].style.display = "none";
- FZ.TargetMobile !== FZ.TARGET_DEF.ANDRIOD ? this.createBtns(this.CUR_BTN_DEFS, !0) : this.createBtns(this.CUR_BTN_ANDROID_DEFS, !0), f = FZ.getImgInfo(this.CUR_SWITCH_DEFS[0]), g = FZ.getImgInfo(this.CUR_SWITCH_DEFS[1]), this.m_btn_list[this.BTN_PAUSE_INDEX].setSwitchButton(f.fileURL, g.fileURL), FZ.TargetMobile !== FZ.TARGET_DEF.ANDRIOD && (f = FZ.getImgInfo(this.SOUND_SWITCH_DEFS[0]), g = FZ.getImgInfo(this.SOUND_SWITCH_DEFS[1]), this.m_btn_list[this.BTN_SOUND_INDEX].setSwitchButton(f.fileURL, g.fileURL)), this.m_diamondMgr = new FZ.DiamondManager, this.m_diamondMgr.m_parent = this.m_main_div, this.m_diamondMgr.setBubble(!1), FZ.DivManager.addChild(this.m_main_div), this.m_load_ui = !0
- //FZ.TargetMobile == null ? this.createBtns(this.CUR_BTN_DEFS, !0) : this.createBtns(this.CUR_BTN_ANDROID_DEFS, !0), f = FZ.getImgInfo(this.CUR_SWITCH_DEFS[0]), g = FZ.getImgInfo(this.CUR_SWITCH_DEFS[1]), this.m_btn_list[this.BTN_PAUSE_INDEX].setSwitchButton(f.fileURL, g.fileURL), FZ.TargetMobile == null && (f = FZ.getImgInfo(this.SOUND_SWITCH_DEFS[0]), g = FZ.getImgInfo(this.SOUND_SWITCH_DEFS[1]), this.m_btn_list[this.BTN_SOUND_INDEX].setSwitchButton(f.fileURL, g.fileURL)), this.m_diamondMgr = new FZ.DiamondManager, this.m_diamondMgr.m_parent = this.m_main_div, this.m_diamondMgr.setBubble(!1), FZ.DivManager.addChild(this.m_main_div), this.m_load_ui = !0
- } else this.m_diamondMgr.setBubble(!1), this.m_main_div.style.display = "inline";
- this.m_curLevel_div = this.m_ui_list[this.UI_LEVEL_NUM_INDEX], this.m_time_bar_div = this.m_ui_list[this.UI_TIME_BAR_INDEX], f = FZ.getImgInfo(this.CUR_UI_DEFS[this.UI_TIME_BAR_INDEX]), this.m_time_bar_w = f.w, this.m_time_bar_div.style.width = this.m_time_bar_w + "px", this.m_diamondMgr.setObserver(this);
- if (FZ.StateDefs.GAME_STATE_MAINMEN === b || FZ.StateDefs.GAME_STATE_OVER === b || FZ.StateDefs.GAME_STATE_HELP === b) {
- if (FZ.GameBase.SaveObject.m_gamein === !0) {
- this.m_diamondMgr.resumeLevel();
- var m = FZ.GameBase.SaveObject.m_cur_hintCount
- } else {
- this.m_diamondMgr.initAllPets(!0);
- var m = FZ.GameBase.SaveObject.m_hint
- }
- this.m_diamondMgr.setHintCount(m), this.m_btn_list[this.BTN_HINT_INDEX].setEnable(!0), this.m_btn_list[this.BTN_HINT_INDEX].m_div.style.backgroundImage = "url(res/images/BTN_HINT.png )", this.m_hint_num_div[0].style.visibility = "visible", this.m_hint_num_div[1].style.visibility = "visible";
- if (m >= 10) {
- var n = Math.floor(m % 10);
- this.m_hint_num_div[0].style.backgroundImage = "url(res/images/NUM_LEVEL_" + n + ".png )", n = Math.floor(m / 10), this.m_hint_num_div[1].style.backgroundImage = "url(res/images/NUM_LEVEL_" + n + ".png )"
- } else m === 0 ? (this.m_btn_list[this.BTN_HINT_INDEX].m_div.style.backgroundImage = "url(res/images/BTN_HINT_GREY.png )", this.m_btn_list[this.BTN_HINT_INDEX].setEnable(!1), this.m_hint_num_div[0].style.visibility = "hidden", this.m_hint_num_div[1].style.visibility = "hidden") : (this.m_hint_num_div[1].style.visibility = "hidden", this.m_hint_num_div[0].style.backgroundImage = "url(res/images/NUM_LEVEL_" + m + ".png )");
- this.m_diamondMgr.hidePets()
- }
- f = FZ.getImgInfo("NUM_LEVEL_" + FZ.GameBase.SaveObject.m_cur_level), this.m_curLevel_div.style.backgroundImage = "url(res/images/" + f.fileURL + ")";
- if (FZ.GameBase.SaveObject.m_gamein === !0) {
- this.m_levelStart = !0, this.curLevelUsedTime = FZ.GameBase.SaveObject.m_level_usedTime, this.m_diamondMgr.showPets();
- for (var c = 0; c < this.UI_ARROW_KINDS; c++) this.m_ui_list[this.UI_ARROW_START_INDEX + c].style.display = "none";
- this.m_diamondMgr.setParent(this.m_main_div)
- } else {
- this.curLevelUsedTime = 0, this.m_diamondMgr.setLevel(FZ.GameBase.SaveObject.m_cur_level), i = this.m_diamondMgr.getLevel();
- switch (i) {
- case 1:
- case 2:
- case 4:
- this.m_levelStart = !0, this.m_diamondMgr.showPets();
- for (var c = 0; c < this.UI_ARROW_KINDS; c++) this.m_ui_list[this.UI_ARROW_START_INDEX + c].style.display = "none";
- this.m_diamondMgr.setParent(this.m_main_div);
- break;
- case 3:
- this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX].style.display = "inline";
- break;
- case 5:
- this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX + 1].style.display = "inline";
- break;
- case 6:
- this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX + 2].style.display = "inline";
- break;
- case 7:
- this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX + 3].style.display = "inline";
- break;
- case 8:
- this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX + 4].style.display = "inline";
- break;
- case 9:
- this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX + 5].style.display = "inline";
- break;
- default:
- }
- }
- this.levelStartTime = (new Date).getTime(), this.levelCurrentTime = this.levelStartTime, this.levelPauseStartTime = this.levelStartTime, this.levelPauseEndTime = this.levelStartTime, this.levelPauseTime = 0, this.resetTranslate(0), FZ.TargetMobile !== FZ.TARGET_DEF.ANDRIOD && (this.m_sound = FZ.GameBase.SaveObject.m_sound, this.m_sound === !0 ? this.m_btn_list[this.BTN_SOUND_INDEX].setSwitchState(this.m_btn_list[this.BTN_SOUND_INDEX].SWITCH_ON) : this.m_btn_list[this.BTN_SOUND_INDEX].setSwitchState(this.m_btn_list[this.BTN_SOUND_INDEX].SWITCH_OFF)), this.m_btn_list[this.BTN_HOME_INDEX].m_div.style.display = "none", this.m_diamondMgr.setBonusTime(0), a && document.addEventListener("keyup", FZ.Tools.bindWithEvent(this, this.debugLevel), !1), setTimeout(function () {
- //this.levelStartTime = (new Date).getTime(), this.levelCurrentTime = this.levelStartTime, this.levelPauseStartTime = this.levelStartTime, this.levelPauseEndTime = this.levelStartTime, this.levelPauseTime = 0, this.resetTranslate(0), FZ.TargetMobile == null && (this.m_sound = FZ.GameBase.SaveObject.m_sound, this.m_sound === !0 ? this.m_btn_list[this.BTN_SOUND_INDEX].setSwitchState(this.m_btn_list[this.BTN_SOUND_INDEX].SWITCH_ON) : this.m_btn_list[this.BTN_SOUND_INDEX].setSwitchState(this.m_btn_list[this.BTN_SOUND_INDEX].SWITCH_OFF)), this.m_btn_list[this.BTN_HOME_INDEX].m_div.style.display = "none", this.m_diamondMgr.setBonusTime(0), a && document.addEventListener("keyup", FZ.Tools.bindWithEvent(this, this.debugLevel), !1), setTimeout(function () {
- j.fade_in.call(j, 2e3, 1)
- }, 10), this.m_timer = setTimeout(FZ.Tools.bind(this, this.checkOver), 0), this.m_call_time = FZ.Tools.bind(this, this.checkOver)
- },
- postProcess: function () {
- this.m_diamondMgr.removeEvent(), this.m_next_state === FZ.StateDefs.GAME_STATE_OVER || this.m_next_state === FZ.StateDefs.GAME_STATE_RESET || this.m_next_state === FZ.StateDefs.GAME_STATE_NEXT_LEVEL || this.m_next_state === FZ.StateDefs.GAME_STATE_GAME_WIN ? this.m_main_div.style.display = "inline" : (this.m_main_div.style.display = "none", this.fade_out(2e3, 0, 0))
- },
- mouseHandler: function (a) {
- null, FZ.EventRemove(this, this.m_main_div, FZ.EVENT_DEF.T_START, this.m_call_tStart), FZ.EventRemove(this, this.m_main_div, FZ.EVENT_DEF.M_CLICK, this.m_call_mClick), this.m_levelStart = !0, this.m_diamondMgr.showPets();
- for (var b = 0; b < this.UI_ARROW_KINDS; b++) this.m_ui_list[this.UI_ARROW_START_INDEX + b].style.display = "none";
- this.levelStartTime = (new Date).getTime(), this.levelCurrentTime = this.levelStartTime, this.levelPauseStartTime = this.levelStartTime, this.levelPauseEndTime = this.levelStartTime, this.levelPauseTime = 0, this.m_levelLeftTime = 0, this.m_diamondMgr.setParent(this.m_main_div)
- },
- checkOver: function () {
- var a = this;
- if (undefined !== FZ.GameBase.CurrentState) {
- if (FZ.StateDefs.GAME_STATE_GAME_IN !== FZ.GameBase.CurrentState.StateName) {
- clearTimeout(this.m_timer);
- return
- }
- var b = 0,
- c = this.m_diamondMgr.getLevel();
- if (!this.m_levelStart) {
- var d = Math.floor((new Date).getTime() - this.levelCurrentTime) / 1e3,
- e = !1,
- f = FZ.AG.SearchSpecialPath.setScoreNum(FZ.GameBase.SaveObject.score + this.m_diamondMgr.getScore());
- for (var b = 0; b < f.length; b++) this.m_ui_list[this.UI_SCORE_START_INDEX + 5 - f.length + b].style.backgroundImage = "url(res/images/NUM_LEVEL_" + f[f.length - 1 - b] + ".png)";
- if (f.length < 5)
- for (var b = 0; b < 5 - f.length; b++) this.m_ui_list[this.UI_SCORE_START_INDEX + b].style.backgroundImage = "url(res/images/NUM_LEVEL_0.png)";
- switch (c) {
- case 3:
- this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX].style.display = "inline";
- break;
- case 5:
- this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX + 1].style.display = "inline";
- break;
- case 6:
- this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX + 2].style.display = "inline";
- break;
- case 7:
- this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX + 3].style.display = "inline";
- break;
- case 8:
- this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX + 4].style.display = "inline";
- break;
- case 9:
- this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX + 5].style.display = "inline";
- break;
- default:
- }
- FZ.TARGET_DEF.MOBILE === FZ.TargetPort ? null === this.m_call_tStart && FZ.EventHandler(this, this.m_main_div, FZ.EVENT_DEF.T_START, this.mouseHandler) : null === this.m_call_mClick && FZ.EventHandler(this, this.m_main_div, FZ.EVENT_DEF.M_CLICK, this.mouseHandler);
- if (d > 3) {
- this.m_levelStart = !0, this.m_diamondMgr.showPets();
- for (var b = 0; b < this.UI_ARROW_KINDS; b++) this.m_ui_list[this.UI_ARROW_START_INDEX + b].style.display = "none";
- this.levelStartTime = (new Date).getTime(), this.levelCurrentTime = this.levelStartTime, this.levelPauseStartTime = this.levelStartTime, this.levelPauseEndTime = this.levelStartTime, this.levelPauseTime = 0, this.m_levelLeftTime = 0, this.m_diamondMgr.setParent(this.m_main_div)
- }
- this.m_timer = setTimeout(a.m_call_time, 200), this.m_diamondMgr.setBubble(!0);
- return
- }
- if (this.m_isNoMatch === !0) {
- this.m_str_nomatch_div.style.display = "inline", (new Date).getTime() - this.levelCurrentTime > 2e3 && (this.m_diamondMgr.ResetPosition(), this.m_diamondMgr.searchHasMatch() || this.m_diamondMgr.ResetTwoPosition(), this.m_isNoMatch = !1, this.levelPauseTime += 2200, this.m_str_nomatch_div.style.display = "none"), this.m_timer = setTimeout(a.m_call_time, 200);
- return
- }
- if (this.m_gamePause || this.pageHiddin) {
- this.m_timer = setTimeout(FZ.Tools.bind(this, this.checkOver), 100);
- return
- }
- c = FZ.GameBase.SaveObject.m_cur_level;
- var d = Math.floor(((new Date).getTime() - this.levelPauseTime - this.levelStartTime) / 1e3 + this.curLevelUsedTime),
- g = this.m_time_bar_w / FZ.GameDefs.LEVEL_TIME[FZ.GameBase.SaveObject.m_cur_level];
- d -= this.m_diamondMgr.getBonusTime(), d >= FZ.GameDefs.LEVEL_TIME[FZ.GameBase.SaveObject.m_cur_level] ? d = FZ.GameDefs.LEVEL_TIME[FZ.GameBase.SaveObject.m_cur_level] : d < 0 && (d = 0);
- var h = (FZ.GameDefs.LEVEL_TIME[c] - d) * g;
- this.m_time_bar_div.style.width = h + "px", !(FZ.GameDefs.LEVEL_TIME[c] - d > 0);
- var f = FZ.AG.SearchSpecialPath.setScoreNum(FZ.GameBase.SaveObject.score + this.m_diamondMgr.getScore());
- for (var b = f.length - 1; b >= 0; b--) this.m_ui_list[this.UI_SCORE_START_INDEX + 5 - f.length + b].style.backgroundImage = "url(res/images/NUM_LEVEL_" + f[f.length - 1 - b] + ".png)";
- if (f.length < 5)
- for (var b = 0; b < 5 - f.length; b++) this.m_ui_list[this.UI_SCORE_START_INDEX + b].style.backgroundImage = "url(res/images/NUM_LEVEL_0.png)";
- this.m_level_usedTime = d;
- if (FZ.GameDefs.LEVEL_TIME[c] <= d) {
- this.m_timer = setTimeout(FZ.Tools.bind(this, this.setGameOver), 0), this.m_diamondMgr.setBubble(!0);
- return
- }
- this.m_timer = setTimeout(a.m_call_time, 1500), this.m_diamondMgr.saveLevel()
- }
- },
- checkWin: function () {
- var a = this.m_diamondMgr.getLevel(),
- b = ((new Date).getTime() - this.levelPauseTime - this.levelStartTime) / 1e3 + this.curLevelUsedTime;
- if (this.m_diamondMgr.getLeftPet() === 0) {
- var c = FZ.GameBase.SaveObject.score,
- d = this.m_diamondMgr.getScore() + (FZ.GameDefs.LEVEL_TIME[a] - this.m_level_usedTime) * 30,
- e = FZ.AG.SearchSpecialPath.setScoreNum(FZ.GameBase.SaveObject.score + d);
- for (var f = e.length - 1; f >= 0; f--) this.m_ui_list[this.UI_SCORE_START_INDEX + 5 - e.length + f].style.backgroundImage = "url(res/images/NUM_LEVEL_" + e[e.length - 1 - f] + ".png)";
- if (e.length < 5)
- for (var f = 0; f < 5 - e.length; f++) this.m_ui_list[this.UI_SCORE_START_INDEX + f].style.backgroundImage = "url(res/images/NUM_LEVEL_0.png)";
- if (a === FZ.GameDefs.MAX_LEVEL_RANK) {
- clearTimeout(this.m_timer), this.m_diamondMgr.setBubble(!1), this.m_next_state = FZ.StateDefs.GAME_STATE_GAME_WIN, this.pause(), FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_GAME_WIN, d + c, d), FZ.GameBase.SaveObject.pass = !0, FZ.GameBase.SaveObject.score += d, FZ.GameBase.SaveObject.m_hint = this.m_diamondMgr.getHintCount() + FZ.GameDefs.LEVEL_HINT_NUMBER[a], FZ.GameBase.saveGame();
- return
- }
- clearTimeout(this.m_timer), this.m_diamondMgr.setBubble(!1), this.m_next_state = FZ.StateDefs.GAME_STATE_NEXT_LEVEL, this.pause(), FZ.GameBase.pushState(this.StateName), FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_NEXT_LEVEL, d + c, d), FZ.GameBase.SaveObject.score += d, FZ.GameBase.SaveObject.m_cur_level = a + 1, FZ.GameBase.SaveObject.m_hint = this.m_diamondMgr.getHintCount() + FZ.GameDefs.LEVEL_HINT_NUMBER[a + 1], FZ.GameBase.saveGame()
- play68_submitScore(FZ.GameBase.SaveObject.score);Play68.setRankingScoreDesc(FZ.GameBase.SaveObject.score);
- }
- },
- checkNoMatch: function () {
- this.m_diamondMgr.searchHasMatch() || (this.m_isNoMatch = !0), this.m_isNoMatch && (this.levelCurrentTime = (new Date).getTime())
- },
- setGameOver: function () {
- this.m_diamondMgr.setBubble(!1), clearTimeout(this.m_timer), this.m_next_state = FZ.StateDefs.GAME_STATE_OVER, this.pause();
- var a = this.m_diamondMgr.getScore(),
- b = FZ.GameBase.SaveObject.score;
- FZ.GameBase.pushState(this.StateName), FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_OVER, a + b), FZ.GameBase.SaveObject.score = 0, FZ.GameBase.SaveObject.m_cur_level = 1, FZ.GameBase.SaveObject.m_hint = FZ.GameDefs.LEVEL_HINT_NUMBER[1], FZ.GameBase.SaveObject.m_gamein = !1, FZ.GameBase.SaveObject.m_cur_score = 0, FZ.GameBase.SaveObject.m_cur_hintCount = FZ.GameDefs.LEVEL_HINT_NUMBER[1], FZ.GameBase.SaveObject.m_cur_left_pet = FZ.GameDefs.ALL_PET_NUM, FZ.GameBase.SaveObject.m_level_usedTime = 0, FZ.GameBase.saveGame()
-
- play68_submitScore(FZ.GameBase.SaveObject.score);
- },
- setNextLevel: function (a, b) {
- clearTimeout(this.m_timer), this.m_diamondMgr.setBubble(!1), this.m_next_state = FZ.StateDefs.GAME_STATE_NEXT_LEVEL, this.pause(), FZ.GameBase.pushState(this.StateName), FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_NEXT_LEVEL, a, b)
- },
- setGameWin: function (a, b) {
- clearTimeout(this.m_timer), this.m_diamondMgr.setBubble(!1), this.m_next_state = FZ.StateDefs.GAME_STATE_GAME_WIN, this.pause(), FZ.GameBase.pushState(this.StateName), FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_GAME_WIN, a, b)
- },
- buttonClick: function (a) {
- if (undefined !== FZ.GameBase.CurrentState) {
- if (FZ.StateDefs.GAME_STATE_GAME_IN !== FZ.GameBase.CurrentState.StateName) return;
- if (this.m_isNoMatch === !0) return;
- if (this.m_btn_list[this.BTN_HOME_INDEX] === a) {
- this.m_gamePause = !this.m_gamePause, this.m_btn_list[this.BTN_HOME_INDEX].m_div.style.display = "none", this.m_btn_list[this.BTN_HINT_INDEX].m_div.style.display = "inline";
- var b = this.m_diamondMgr.getHintCount();
- b > 10 ? (this.m_hint_num_div[0].style.visibility = "visible", this.m_hint_num_div[1].style.visibility = "visible") : b === 0 ? (this.m_hint_num_div[0].style.visibility = "hidden", this.m_hint_num_div[1].style.visibility = "hidden") : (this.m_hint_num_div[0].style.visibility = "visible", this.m_hint_num_div[1].style.visibility = "hidden"), FZ.TargetMobile !== FZ.TARGET_DEF.ANDRIOD && (this.m_btn_list[this.BTN_SOUND_INDEX].m_div.style.display = "inline"), this.m_pause_div.style.display = "none", this.m_diamondMgr.m_reset_finished = !0, FZ.TargetMobile !== FZ.TARGET_DEF.ANDRIOD && (FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX].SWITCH_OFF === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX].m_btn_state && (FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX].m_div.style.backgroundImage = "url(res/images/BTN_SOUND_OFF.png)"), FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX].SWITCH_ON === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX].m_btn_state && (FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX].m_div.style.backgroundImage = "url(res/images/BTN_SOUND.png)")), this.m_btn_list[this.BTN_PAUSE_INDEX].setSwitchState(this.m_btn_list[this.BTN_PAUSE_INDEX].SWITCH_ON), this.levelPauseEndTime = (new Date).getTime(), this.levelPauseTime += this.levelPauseEndTime - this.levelPauseStartTime, this.m_next_state = FZ.StateDefs.GAME_STATE_RESET, this.m_diamondMgr.setBubble(!1), this.levelPauseStartTime = (new Date).getTime(), this.pause(), FZ.GameBase.pushState(this.StateName), FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_RESET)
- } else if (this.m_btn_list[this.BTN_HINT_INDEX] === a) {
- this.m_diamondMgr.setBubble(!1);
- if (this.m_gamePause) return;
- if (this.m_diamondMgr.getHintCount() > 0 && !1 !== this.m_diamondMgr.searchHint()) {
- var c = this.m_diamondMgr.getHintCount();
- this.m_hint_num_div[0].style.visibility = "visible", this.m_hint_num_div[1].style.visibility = "visible";
- if (c >= 10) {
- var d = Math.floor(c % 10);
- this.m_hint_num_div[0].style.backgroundImage = "url(res/images/NUM_LEVEL_" + d + ".png )";
- var d = Math.floor(c / 10);
- this.m_hint_num_div[1].style.backgroundImage = "url(res/images/NUM_LEVEL_" + d + ".png )"
- } else this.m_hint_num_div[1].style.visibility = "hidden", this.m_hint_num_div[0].style.backgroundImage = "url(res/images/NUM_LEVEL_" + c + ".png )"
- }
- this.m_diamondMgr.getHintCount() === 0 && (a.setEnable(!1), a.m_div.style.backgroundImage = "url(res/images/BTN_HINT_GREY.png )", this.m_hint_num_div[0].style.visibility = "hidden", this.m_hint_num_div[1].style.visibility = "hidden")
- } else if (this.m_btn_list[this.BTN_PAUSE_INDEX] === a) {
- this.m_gamePause = !this.m_gamePause;
- if (this.m_gamePause === !0) this.m_btn_list[this.BTN_HOME_INDEX].m_div.style.display = "inline", this.m_btn_list[this.BTN_HINT_INDEX].m_div.style.display = "none", this.m_hint_num_div[0].style.visibility = "hidden", this.m_hint_num_div[1].style.visibility = "hidden", FZ.TargetMobile !== FZ.TARGET_DEF.ANDRIOD && (this.m_btn_list[this.BTN_SOUND_INDEX].m_div.style.display = "none"), this.levelPauseStartTime = (new Date).getTime(), this.m_pause_div.style.display = "inline", a.setSwitchState(a.SWITCH_OFF), this.m_diamondMgr.m_reset_finished = !1, this.m_diamondMgr.setBubble(!1);
- else {
- this.m_btn_list[this.BTN_HOME_INDEX].m_div.style.display = "none", this.m_btn_list[this.BTN_HINT_INDEX].m_div.style.display = "inline";
- var b = this.m_diamondMgr.getHintCount();
- b > 10 ? (this.m_hint_num_div[0].style.visibility = "visible", this.m_hint_num_div[1].style.visibility = "visible") : b === 0 ? (this.m_hint_num_div[0].style.visibility = "hidden", this.m_hint_num_div[1].style.visibility = "hidden") : (this.m_hint_num_div[0].style.visibility = "visible", this.m_hint_num_div[1].style.visibility = "hidden"), FZ.TargetMobile !== FZ.TARGET_DEF.ANDRIOD && (this.m_btn_list[this.BTN_SOUND_INDEX].m_div.style.display = "inline"), this.m_pause_div.style.display = "none", this.m_diamondMgr.m_reset_finished = !0, this.m_diamondMgr.getHintCount() !== 0 && (FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_HINT_INDEX].m_div.style.backgroundImage = "url(res/images/BTN_HINT.png)"), FZ.Game.GameState.BTN_SOUND_INDEX !== undefined && (FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX].SWITCH_OFF === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX].m_btn_state && (FZ.Game.GameState
- .m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX].m_div.style.backgroundImage = "url(res/images/BTN_SOUND_OFF.png)"), FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX].SWITCH_ON === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX].m_btn_state && (FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX].m_div.style.backgroundImage = "url(res/images/BTN_SOUND.png)")), a.setSwitchState(a.SWITCH_ON), this.levelPauseEndTime = (new Date).getTime(), this.levelPauseTime += this.levelPauseEndTime - this.levelPauseStartTime
- }
- this.m_diamondMgr.saveLevel()
- } else if (this.m_btn_list[this.BTN_SOUND_INDEX] !== undefined && this.m_btn_list[this.BTN_SOUND_INDEX] === a) {
- if (this.m_gamePause) return;
- this.m_sound = !this.m_sound, this.m_sound ? (a.setSwitchState(a.SWITCH_ON), FZ.Music.setMute(!1)) : (a.setSwitchState(a.SWITCH_OFF), FZ.Music.setMute(!0)), FZ.GameBase.SaveObject.m_sound = this.m_sound, FZ.GameBase.saveGame()
- }
- }
- },
- debugLevel: function () {
- var a = this.m_diamondMgr.getLevel(),
- b = this.m_diamondMgr.getScore() + this.m_levelLeftTime * 20;
- a < 9 && (FZ.GameBase.SaveObject.m_cur_level = a + 1);
- if (a === 9) clearTimeout(this.m_timer), this.m_diamondMgr.setBubble(!1), this.m_next_state = FZ.StateDefs.GAME_STATE_GAME_WIN, this.pause(), FZ.GameBase.pushState(this.StateName), FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_GAME_WIN, this.m_levelLeftTime, b);
- else {
- clearTimeout(this.m_timer), this.m_diamondMgr.setBubble(!1), this.m_next_state = FZ.StateDefs.GAME_STATE_NEXT_LEVEL, this.pause(), FZ.GameBase.pushState(this.StateName), FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_NEXT_LEVEL, this.m_levelLeftTime, b);
- return
- }
- },
- pageHide: function (a) {
- FZ.Game.GameState.m_diamondMgr !== null && (FZ.Game.GameState.m_diamondMgr.m_reset_finished = !1, FZ.Game.GameState.m_diamondMgr.setBubble(!1), FZ.Game.GameState.levelPauseStartTime = (new Date).getTime(), FZ.Game.GameState.pageHiddin = !0)
- },
- pageShow: function (a) {
- FZ.Game.GameState.m_diamondMgr !== null && (FZ.Game.GameState.m_diamondMgr.m_reset_finished = !0, FZ.Game.GameState.levelPauseEndTime = (new Date).getTime(), FZ.Game.GameState.levelPauseTime += FZ.Game.GameState.levelPauseEndTime - FZ.Game.GameState.levelPauseStartTime, FZ.Game.GameState.pageHiddin = !1)
- }
- }, FZ.BaseState)), window.addEventListener("pagehide", FZ.Game.GameState.pageHide, !1), window.addEventListener("pageshow", FZ.Game.GameState.pageShow, !1)
- }(), FZ.Game.GameOverState = new(FZ.newClass({
- StateName: FZ.StateDefs.GAME_STATE_OVER,
- CUR_UI_DEFS: ["NEXT_LEVEL_BG", "TXT_GAME_OVER", "TXT_TOTAL_OVER_SCORE", "NUM_STAGE_OVER_TOTAL_1", "NUM_STAGE_OVER_TOTAL_2", "NUM_STAGE_OVER_TOTAL_3", "NUM_STAGE_OVER_TOTAL_4", "NUM_STAGE_OVER_TOTAL_5"],
- UI_SCORE_START_INDEX: 3,
- TOTAL_SCORE: 5,
- BTN_REPLAY_INDEX: 0,
- CUR_BTN_DEFS: [
- ["BTN_RETRY", "BTN_RETRY_TOUCH"]
- ],
- STR_RECT: [173, 280, 138, 36],
- m_load_ui: !1,
- popState: !1,
- preProcess: function (a, b, c) {
- var d = 0,
- e = null,
- f = null,
- g = null,
- h = null;
- this.m_load_ui ? this.m_main_div.style.display = "inline" : (this.createUIs(this.CUR_UI_DEFS), this.createBtns(this.CUR_BTN_DEFS, !0), FZ.DivManager.addChild(this.m_main_div), this.m_load_ui = !0);
- var i = FZ.AG.SearchSpecialPath.setScoreNum(c);
- for (var d = 0; d < i.length; d++) this.m_ui_list[this.UI_SCORE_START_INDEX + this.TOTAL_SCORE - i.length + d].style.backgroundImage = "url(res/images/NUM_LEVEL_" + i[i.length - 1 - d] + ".png)";
- if (i.length < this.TOTAL_SCORE)
- for (var d = 0; d < this.TOTAL_SCORE - i.length; d++) this.m_ui_list[this.UI_SCORE_START_INDEX + d].style.backgroundImage = "url(res/images/NUM_LEVEL_0.png)";
- this.popState = !1
- },
- postProcess: function () {
- this.m_main_div.style.display = "none"
- },
- createStrScoreDiv: function () {
- this.m_last_score_div = document.createElement("div"), this.m_last_score_div.style.position = "absolute", this.m_last_score_div.style.width = this.STR_RECT[2] + "px", this.m_last_score_div.style.height = this.STR_RECT[3] + "px", this.m_last_score_div.style.left = this.STR_RECT[0] + "px", this.m_last_score_div.style.top = this.STR_RECT[1] + "px", this.m_last_score_div.style.color = "#fff", this.m_last_score_div.style.fontSize = FZ.GameDefs.STATS_FONT_SIZE + "px", this.m_last_score_div.style.fontFamily = "Arial", this.m_last_score_div.style.lineHeight = this.STR_RECT[3] + "px", this.m_last_score_div.style.textAlign = "left", this.m_main_div.appendChild(this.m_last_score_div)
- },
- buttonClick: function (a) {
- if (!this.popState) {
- var b = null;
- this.m_btn_list[this.BTN_REPLAY_INDEX] === a && (this.postProcess(), this.popState = !0, FZ.GameBase.popState(this.StateName))
- }
- }
- }, FZ.BaseState)), FZ.Game.nextLevelState = new(FZ.newClass({
- StateName: FZ.StateDefs.GAME_STATE_NEXT_LEVEL,
- CUR_UI_DEFS: ["NEXT_LEVEL_BG", "TXT_LEVEL_CLEAR", "TXT_STAGE_SCORE", "TXT_TOTAL_SCORE", "NUM_STAGE_TOTAL_1", "NUM_STAGE_TOTAL_2", "NUM_STAGE_TOTAL_3", "NUM_STAGE_TOTAL_4", "NUM_STAGE_TOTAL_5", "NUM_STAGE_1", "NUM_STAGE_2", "NUM_STAGE_3", "NUM_STAGE_4"],
- UI_TOTAL_SCORE_START_INDEX: 4,
- UI_STAGE_SCORE_START_INDEX: 9,
- BTN_NEXT_LEVEL_INDEX: 0,
- TOTAL_SCORE: 5,
- STAGE_SCORE: 4,
- CUR_BTN_DEFS: [
- ["BTN_NEXT_LEVEL", "BTN_NEXT_LEVEL_TOUCH"]
- ],
- m_load_ui: !1,
- popState: !1,
- preProcess: function (a, b, c, d) {
- var e = 0,
- f = null,
- g = null,
- h = null,
- i = this,
- j = null;
- this.m_load_ui ? this.m_main_div.style.display = "inline" : (this.createUIs(this.CUR_UI_DEFS), this.createBtns(this.CUR_BTN_DEFS, !0), FZ.DivManager.addChild(this.m_main_div), this.m_load_ui = !0);
- var k = FZ.AG.SearchSpecialPath.setScoreNum(c);
- for (var e = 0; e < k.length; e++) this.m_ui_list[this.UI_TOTAL_SCORE_START_INDEX + this.TOTAL_SCORE - k.length + e].style.backgroundImage = "url(res/images/NUM_LEVEL_" + k[k.length - 1 - e] + ".png)";
- if (k.length < this.TOTAL_SCORE)
- for (var e = 0; e < this.TOTAL_SCORE - k.length; e++) this.m_ui_list[this.UI_TOTAL_SCORE_START_INDEX + e].style.backgroundImage = "url(res/images/NUM_LEVEL_0.png)";
- k = FZ.AG.SearchSpecialPath.setScoreNum(d);
- for (var e = 0; e < k.length; e++) this.m_ui_list[this.UI_STAGE_SCORE_START_INDEX + this.STAGE_SCORE - k.length + e].style.backgroundImage = "url(res/images/NUM_LEVEL_" + k[k.length - 1 - e] + ".png)";
- if (k.length < this.STAGE_SCORE)
- for (var e = 0; e < this.STAGE_SCORE - k.length; e++) this.m_ui_list[this.UI_STAGE_SCORE_START_INDEX + e].style.backgroundImage = "url(res/images/NUM_LEVEL_0.png)";
- this.popState = !1, setTimeout(function () {
- i.fade_in.call(i, 2e3, 1)
- }, 10), FZ.GameBase.SaveObject.m_gamein = !1, FZ.GameBase.saveGame()
- },
- createStrLeftTimeDiv: function () {
- this.m_last_left_time_div = document.createElement("div"), this.m_last_left_time_div.style.position = "absolute", this.m_last_left_time_div.style.width = this.STR_LEFT_TIME_RECT[2] + "px", this.m_last_left_time_div.style.height = this.STR_LEFT_TIME_RECT[3] + "px", this.m_last_left_time_div.style.left = this.STR_LEFT_TIME_RECT[0] + "px", this.m_last_left_time_div.style.top = this.STR_LEFT_TIME_RECT[1] + "px", this.m_last_left_time_div.style.color = "#fff", this.m_last_left_time_div.style.fontSize = FZ.GameDefs.STATS_FONT_SIZE + "px", this.m_last_left_time_div.style.fontFamily = "Arial", this.m_last_left_time_div.style.lineHeight = this.STR_LEFT_TIME_RECT[3] + "px", this.m_last_left_time_div.style.textAlign = "left", this.m_main_div.appendChild(this.m_last_left_time_div)
- },
- createStrScoreDiv: function () {
- this.m_last_score_div = document.createElement("div"), this.m_last_score_div.style.position = "absolute", this.m_last_score_div.style.width = this.STR_SCORE_RECT[2] + "px", this.m_last_score_div.style.height = this.STR_SCORE_RECT[3] + "px", this.m_last_score_div.style.left = this.STR_SCORE_RECT[0] + "px", this.m_last_score_div.style.top = this.STR_SCORE_RECT[1] + "px", this.m_last_score_div.style.color = "#fff", this.m_last_score_div.style.fontSize = FZ.GameDefs.STATS_FONT_SIZE + "px", this.m_last_score_div.style.fontFamily = "Arial", this.m_last_score_div.style.lineHeight = this.STR_SCORE_RECT[3] + "px", this.m_last_score_div.style.textAlign = "left", this.m_main_div.appendChild(this.m_last_score_div)
- },
- postProcess: function () {
- this.fade_out(2e3, 0, 0)
- },
- buttonClick: function (a) {
- if (!this.popState) {
- var b = null;
- this.m_btn_list[this.BTN_NEXT_LEVEL_INDEX] === a && (this.postProcess(), this.popState = !0, FZ.GameBase.popState(this.StateName))
- }
- }
- }, FZ.BaseState)), FZ.Game.winState = new(FZ.newClass({
- StateName: FZ.StateDefs.GAME_STATE_GAME_WIN,
- CUR_UI_DEFS: ["YOU_WIN_BG", "TXT_WIN_STAGE_SCORE", "TXT_WIN_TOTAL_SCORE", "NUM_STAGE_WIN_TOTAL_1", "NUM_STAGE_WIN_TOTAL_2", "NUM_STAGE_WIN_TOTAL_3", "NUM_STAGE_WIN_TOTAL_4", "NUM_STAGE_WIN_TOTAL_5", "NUM_STAGE_WIN_1", "NUM_STAGE_WIN_2", "NUM_STAGE_WIN_3", "NUM_STAGE_WIN_4"],
- UI_TOTAL_SCORE_START_INDEX: 3,
- UI_STAGE_SCORE_START_INDEX: 8,
- TOTAL_SCORE: 5,
- STAGE_SCORE: 4,
- BTN_MAIN_MENU_IDNEX: 0,
- CUR_BTN_DEFS: [
- ["BTN_MAIN_MENU", "BTN_MAIN_MENU_TOUCH"]
- ],
- STR_LEFT_TIME_RECT: [100, 215, 50, 36],
- STR_LEFT_TIME_BONUS_RECT: [203, 215, 30, 36],
- STR_SCORE_RECT: [160, 277, 138, 36],
- m_load_ui: !1,
- preProcess: function (a, b, c, d) {
- var e = 0,
- f = null,
- g = null,
- h = null,
- i = null,
- j = this;
- this.m_load_ui ? this.m_main_div.style.display = "inline" : (this.createUIs(this.CUR_UI_DEFS), this.createBtns(this.CUR_BTN_DEFS, !0), FZ.DivManager.addChild(this.m_main_div), this.m_load_ui = !0);
- var k = FZ.AG.SearchSpecialPath.setScoreNum(c);
- for (var e = 0; e < k.length; e++) this.m_ui_list[this.UI_TOTAL_SCORE_START_INDEX + this.TOTAL_SCORE - k.length + e].style.backgroundImage = "url(res/images/NUM_LEVEL_" + k[k.length - 1 - e] + ".png)";
- if (k.length < this.TOTAL_SCORE)
- for (var e = 0; e < this.TOTAL_SCORE - k.length; e++) this.m_ui_list[this.UI_TOTAL_SCORE_START_INDEX + e].style.backgroundImage = "url(res/images/NUM_LEVEL_0.png)";
- k = FZ.AG.SearchSpecialPath.setScoreNum(d);
- for (var e = 0; e < k.length; e++) this.m_ui_list[this.UI_STAGE_SCORE_START_INDEX + this.STAGE_SCORE - k.length + e].style.backgroundImage = "url(res/images/NUM_LEVEL_" + k[k.length - 1 - e] + ".png)";
- if (k.length < this.STAGE_SCORE)
- for (var e = 0; e < this.STAGE_SCORE - k.length; e++) this.m_ui_list[this.UI_STAGE_SCORE_START_INDEX + e].style.backgroundImage = "url(res/images/NUM_LEVEL_0.png)";
- setTimeout(function () {
- j.fade_in.call(j, 2e3, 1)
- }, 10), FZ.GameBase.SaveObject.m_gamein = !1, FZ.GameBase.saveGame()
- },
- createStrLeftTimeDiv: function () {
- this.m_last_left_time_div = document.createElement("div"), this.m_last_left_time_div.style.position = "absolute", this.m_last_left_time_div.style.width = this.STR_LEFT_TIME_RECT[2] + "px", this.m_last_left_time_div.style.height = this.STR_LEFT_TIME_RECT[3] + "px", this.m_last_left_time_div.style.left = this.STR_LEFT_TIME_RECT[0] + "px", this.m_last_left_time_div.style.top = this.STR_LEFT_TIME_RECT[1] + "px", this.m_last_left_time_div.style.color = "#fff", this.m_last_left_time_div.style.fontSize = FZ.GameDefs.STATS_FONT_SIZE + "px", this.m_last_left_time_div.style.fontFamily = "Arial", this.m_last_left_time_div.style.lineHeight = this.STR_LEFT_TIME_RECT[3] + "px", this.m_last_left_time_div.style.textAlign = "left", this.m_main_div.appendChild(this.m_last_left_time_div)
- },
- createStrScoreDiv: function () {
- this.m_last_score_div = document.createElement("div"), this.m_last_score_div.style.position = "absolute", this.m_last_score_div.style.width = this.STR_SCORE_RECT[2] + "px", this.m_last_score_div.style.height = this.STR_SCORE_RECT[3] + "px", this.m_last_score_div.style.left = this.STR_SCORE_RECT[0] + "px", this.m_last_score_div.style.top = this.STR_SCORE_RECT[1] + "px", this.m_last_score_div.style.color = "#fff", this.m_last_score_div.style.fontSize = FZ.GameDefs.STATS_FONT_SIZE + "px", this.m_last_score_div.style.fontFamily = "Arial", this.m_last_score_div.style.lineHeight = this.STR_SCORE_RECT[3] + "px", this.m_last_score_div.style.textAlign = "left", this.m_main_div.appendChild(this.m_last_score_div)
- },
- postProcess: function () {
- this.fade_out(2e3, 0, 0)
- },
- buttonClick: function (a) {
- this.m_btn_list[this.BTN_MAIN_MENU_IDNEX] === a && (FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_MAINMEN), FZ.Game.GameState.m_main_div.style.display = "none", FZ.Game.GameState.fade_out(2e3, 0, 0))
- }
- }, FZ.BaseState)), FZ.Game.ClearState = new(FZ.newClass({
- StateName: FZ.StateDefs.GAME_STATE_GAME_CLEAR,
- CUR_UI_DEFS: ["DIALOG_BG_CLEAR_GAME", "STR_SURE_CLEAR_GAME"],
- BTN_YES_INDEX: 0,
- BTN_NO_INDEX: 1,
- CUR_BTN_DEFS: [
- ["BTN_CLEAR_GAME_YES", "BTN_CLEAR_GAME_YES_TOUCH"],
- ["BTN_CLEAR_GAME_NO", "BTN_CLEAR_GAME_NO_TOUCH"]
- ],
- m_ui_list: null,
- m_btn_list: null,
- popState: !1,
- m_load_ui: !1,
- preProcess: function () {
- var a = null,
- b = null,
- c = null,
- d = 0,
- e = this;
- this.m_load_ui ? this.m_main_div.style.display = "inline" : (this.createUIs(this.CUR_UI_DEFS), this.createBtns(this.CUR_BTN_DEFS, !0), FZ.DivManager.addChild(this.m_main_div), this.m_load_ui = !0), this.popState = !1, setTimeout(function () {
- e.fade_in.call(e, 2e3, 1)
- }, 10)
- },
- postProcess: function () {
- this.m_main_div.style.display = "none"
- },
- buttonClick: function (a) {
- if (!this.popState) {
- var b = null;
- this.m_btn_list[this.BTN_YES_INDEX] === a ? (this.postProcess(), this.popState = !0, FZ.GameBase.popState(this.StateName, "yes")) : this.m_btn_list[this.BTN_NO_INDEX] === a && (this.postProcess(), this.popState = !0, FZ.GameBase.popState(this.StateName, "no"))
- }
- }
- }, FZ.BaseState)),
- function () {
- var a = !1,
- b = null,
- c = null,
- d = null;
- FZ.GameBase.MOBILE_IPAD = 10, FZ.GameBase.MOBILE_IPHONE = 20, FZ.GameBase.Width = 700, FZ.GameBase.Height = 500, FZ.GameBase.Name = "DreamPetLinkHtml5", FZ.TARGET_DEF = {}, FZ.TARGET_DEF.PC = "pc", FZ.TARGET_DEF.MOBILE = "mobile", FZ.TARGET_DEF.IPHONE = "iPhone", FZ.TARGET_DEF.IPAD = "iPad", FZ.TARGET_DEF.ANDRIOD = "Android", FZ.TargetPort = FZ.TARGET_DEF.PC, FZ.TargetMobile = FZ.TARGET_DEF.IPHONE, FZ.EVENT_DEF = {}, FZ.EVENT_DEF.M_OVER = "mouseover", FZ.EVENT_DEF.M_OUT = "mouseout", FZ.EVENT_DEF.M_MOVE = "mousemove", FZ.EVENT_DEF.M_CLICK = "click", FZ.EVENT_DEF.T_START = "touchstart", FZ.EVENT_DEF.T_MOVE = "touchmove", FZ.EVENT_DEF.T_END = "touchend", FZ.GameBase.setCss = function (a, b) {
- a.style.width = b.w + "px", a.style.height = b.h + "px", a.style.left = b.x + "px", a.style.top = b.y + "px", a.style.position = "absolute", a.style.backgroundRepeat = "no-repeat", a.style.backgroundImage = "url(res/images/" + b.fileURL + ")"
- }, FZ.PrintLog = function (a) {};
- var e = function () {
- var d = null;
- if (a) return !0;
- d = FZ.ResourceManager.ResourceLib.OrientationWarning;
- if (!d) return !1;
- b = FZ.getImgInfo("OrientationWarning"), c.style.backgroundRepeat = "no-repeat", c.style.backgroundImage = "url(res/images/" + b.fileURL + ")", c.style.backgroundPositionX = "50%", c.style.backgroundColor = "#fff", a = !0;
- return !0
- }, f = function () {
- 90 === window.orientation || -90 === window.orientation ? (d.style.display = "none", c.style.display = "inline", FZ.Game.GameState.pageHide()) : 0 === window.orientation && (d.style.display = "inline", c.style.display = "none", FZ.Game.GameState.pageShow());
- var a = 0,
- b = 0;
- FZ.TARGET_DEF.ANDRIOD === FZ.TargetMobile && (b = 1), setTimeout(function () {
- window.scrollTo(a, b)
- }, 10)
- }, g = function () {
- var a = 0,
- b = 0;
- FZ.TARGET_DEF.ANDRIOD === FZ.TargetMobile && (b = 1), setTimeout(function () {
- window.scrollTo(a, b)
- }, 1e3)
- }, h = function (a) {
- a.stopPropagation();
- return !1
- }, i = function () {
- var a = null,
- b = null;
- FZ.GameBase.loadGame();
- if (undefined === FZ.GameBase.SaveObject.m_cur_level) {
- FZ.GameBase.SaveObject.m_cur_level = 0, FZ.GameBase.SaveObject.pass = !1, FZ.GameBase.SaveObject.score = 0, FZ.GameBase.SaveObject.m_hint = FZ.GameDefs.LEVEL_HINT_NUMBER[1], FZ.GameBase.SaveObject.m_gamein = !1, FZ.GameBase.SaveObject.m_cur_score = 0, FZ.GameBase.SaveObject.m_cur_hintCount = FZ.GameDefs.LEVEL_HINT_NUMBER[1], FZ.GameBase.SaveObject.m_cur_left_pet = FZ.GameDefs.ALL_PET_NUM, FZ.GameBase.SaveObject.m_level_usedTime = 0, FZ.TargetMobile !== FZ.TARGET_DEF.ANDRIOD && (FZ.GameBase.SaveObject.m_sound = !0);
- var e = 0,
- i = null,
- j = null;
- j = [];
- for (e = 0; e < FZ.GameDefs.ALL_GENERAL; e++) i = {}, i.style = -1, i.state = FZ.GameDefs.DREAMPET_INIT, j.push(i);
- FZ.GameBase.SaveObject.m_data = j, FZ.GameBase.saveGame()
- }
- d = FZ.$("mainDiv"), c = FZ.$("orientationDiv"), FZ.GameBase.animDiv = FZ.$("animDiv"), c.style.display = "none", /(iPhone|iPad|iPod|Android)/i.test(window.navigator.appVersion) && (FZ.TargetPort = FZ.TARGET_DEF.MOBILE, FZ.TargetMobile = FZ.TARGET_DEF.IPHONE, -1 !== navigator.userAgent.indexOf("iPad") ? FZ.TargetMobile = FZ.TARGET_DEF.IPAD : -1 !== navigator.userAgent.indexOf("Android") && (FZ.TargetMobile = FZ.TARGET_DEF.ANDRIOD)), a = document.createElement("meta"), b = document.getElementsByTagName("head"), FZ.TARGET_DEF.IPAD === FZ.TargetMobile ? (a.setAttribute("name", "viewport"), a.setAttribute("content", "width=320; initial-scale=2.0; maximum-scale=2.0; user-scalable=no;"), b[0].appendChild(a)) : (a.setAttribute("name", "viewport"), a.setAttribute("content", "width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=no;"), b[0].appendChild(a)), window.scrollTo(0, 0), FZ.DivManager.init(), FZ.DivManager.setParent(d), FZ.DivManager.setSize(FZ.GameDefs.SCREEN_W, FZ.GameDefs.SCREEN_H), FZ.DivManager.setOffset(d.offsetLeft, d.offsetTop), FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_PRELOADING), FZ.TARGET_DEF.MOBILE === FZ.TargetPort && (window.onscroll = g, window.addEventListener("orientationchange", f, !1)), document.addEventListener("touchstart", h, !1), f(), FZ.PrintLog("test log")
- };
- FZ.GameBase.ArrayIndexof = function (a, b) {
- var c = 0;
- for (c = 0; c < a.length; c++)
- if (b === a[c]) return c;
- return -1
- }, window.addEventListener("load", i, !1), FZ.EventHandler = function (a, b, c, d) {
- if ( !! b) switch (c) {
- case FZ.EVENT_DEF.M_OVER:
- b.addEventListener(FZ.EVENT_DEF.M_OVER, a.m_call_mOver = function (b) {
- d.call(a, b)
- }, !1);
- break;
- case FZ.EVENT_DEF.M_OUT:
- b.addEventListener(FZ.EVENT_DEF.M_OUT, a.m_call_mOut = function (b) {
- d.call(a, b)
- }, !1);
- break;
- case FZ.EVENT_DEF.M_MOVE:
- b.addEventListener(FZ.EVENT_DEF.M_MOVE, a.m_call_mMove = function (b) {
- d.call(a, b)
- }, !1);
- break;
- case FZ.EVENT_DEF.M_CLICK:
- b.addEventListener(FZ.EVENT_DEF.M_CLICK, a.m_call_mClick = function (b) {
- d.call(a, b)
- }, !1);
- break;
- case FZ.EVENT_DEF.T_START:
- b.addEventListener(FZ.EVENT_DEF.T_START, a.m_call_tStart = function (b) {
- d.call(a, b)
- }, !1);
- break;
- case FZ.EVENT_DEF.T_MOVE:
- b.addEventListener(FZ.EVENT_DEF.T_MOVE, a.m_call_tMove = function (b) {
- d.call(a, b)
- }, !1);
- break;
- case FZ.EVENT_DEF.T_END:
- b.addEventListener(FZ.EVENT_DEF.T_END, a.m_call_tEnd = function (b) {
- d.call(a, b)
- }, !1);
- break;
- default:
- }
- }, FZ.EventRemove = function (a, b, c, d) {
- if ( !! b && !! d) switch (c) {
- case FZ.EVENT_DEF.M_OVER:
- b.removeEventListener(FZ.EVENT_DEF.M_OVER, d, !1), a.m_call_mOver = null;
- break;
- case FZ.EVENT_DEF.M_OUT:
- b.removeEventListener(FZ.EVENT_DEF.M_OUT, d, !1), a.m_call_mOut = null;
- break;
- case FZ.EVENT_DEF.M_MOVE:
- b.removeEventListener(FZ.EVENT_DEF.M_MOVE, d, !1), a.m_call_mMove = null;
- break;
- case FZ.EVENT_DEF.M_CLICK:
- b.removeEventListener(FZ.EVENT_DEF.M_CLICK, d, !1), a.m_call_mClick = null;
- break;
- case FZ.EVENT_DEF.T_START:
- b.removeEventListener(FZ.EVENT_DEF.T_START, d, !1), a.m_call_tStart = null;
- break;
- case FZ.EVENT_DEF.T_MOVE:
- b.removeEventListener(FZ.EVENT_DEF.T_MOVE, d, !1), a.m_call_tMove = null;
- break;
- case FZ.EVENT_DEF.T_END:
- b.removeEventListener(FZ.EVENT_DEF.T_END, d, !1), a.m_call_tEnd = null;
- break;
- default:
- }
- }
- }() //]]>
- </script>
- <script type="text/javascript">
- setTimeout(function(){var a=document,b=a.getElementsByTagName("head")[0],c=a.createElement("meta"),d=b.getElementsByTagName('meta'),e=d.length;while(e--){if(d[e].name=="viewport"){
- return true;}
- }
- c.name="viewport";
- var density = '';
- if(play68.Settings.get('currentGameInfo') && play68.Settings.get('currentGameInfo').targetdensity == 1){
- density = ", target-densityDpi=device-dpi";
- }c.content="width=device-width,maximum-scale=1.0, initial-scale=1.0, user-scalable=no"+density;b.appendChild(c);},25);
- function insertGameplay(){if(play68.Auth.getAuthState()=="AUTHENTICATED"){play68.Gameplay.insert({onsuccess:function(a){},onfailure:function(a){}})}play68._Gameplay.insert({gameInfo:play68.Settings.get("currentGameInfo")})};
- </script>
- <script type="text/javascript">
- (function() {
- window._gaPageType = window._gaPageType || 'homepage';
- window._ttIdle = 600000;
- window._unbounceIntervalTime = 300000;
- window._gaq = window._gaq || [];
- window.spilAjaxPageView = function(pageType) {
- window._gaPageType = pageType || 'homepage';
- sendPageviewToAllTrackers();
- }
- window.spilLocationEvent = function(category, action, label, value, location){ spilLocationEvent(category, action, label, value, location);}
-
- var gaTrackers = [];
-
- function readCookie(name) {
- var nameEQ = name + "=";
- var ca = document.cookie.split(';');
- var caLength = ca.length;
- for ( var i = caLength; i--;) {
- var c = ca[i];
- while (c.charAt(0) == ' ')
- c = c.substring(1, c.length);
- if (c.indexOf(nameEQ) == 0)
- return c.substring(nameEQ.length, c.length);
- }
- return null;
- }
-
- function contains(a, obj) {
- for (var i = 0; i < a.length; i++) {
- if (a[i] === obj) {
- return true;
- }
- }
- return false;
- }
-
- function spilTracker(name, ua, domain) {
-
- if (name != "") {
- name = name + ".";
- }
-
- if(!contains(gaTrackers,name))
- gaTrackers.push(name);
-
- _gaq.push(
- [name + '_setAccount', ua],
- [name + '_setAllowAnchor', true],
- [name + '_setAllowLinker', true],
- [name + '_setDomainName', domain],
- [name + '_setSiteSpeedSampleRate', 10]
- );
-
- var customVarCookie = readCookie('_spilGacv');
- if ('string' === typeof (customVarCookie)) {
- var customVarData = unescape(customVarCookie).split('|');
- }
-
- var Profile = (customVarData ? 'true' : 'false');
- var Username = (customVarData && 'Registered' !== customVarData[0] ? true : false);
-
- _gaq.push([name + '_setCustomVar', 1, "Registered", Profile, 1]);
- _gaq.push([name + '_setCustomVar', 2, "Login", Username, 1]);
-
- _gaq.push( [ name + '_setCustomVar', 5, "Page", window._gaPageType, 3]);
- if (window.location.pathname.substr(-4) != 'html' && window._gaPageType != 'homepage') {
- if (window._gaPageType.substring(0, 1) != 'http://game.play68.com/') {
- _gaq.push( [ name + '_trackPageview', '/' + window._gaPageType ]);
- } else {
- _gaq.push( [ name + '_trackPageview', window._gaPageType ]);
- }
- } else {
- _gaq.push( [ name + '_trackPageview']);
- }
-
- }
-
- function spilEvent(category, action, label, value) {
- var totalTrackers = gaTrackers.length;
- for ( var i = totalTrackers; i--;) {
- _gaq.push( [ gaTrackers[i] + '_trackEvent', category, action, label,
- value ]);
- }
- }
-
- function spilEcommerceTrans(ID, aff, total, tax, shipping)
- {
- for (var i = 0; i < gaTrackers.length; i++)
- {
- _gaq.push([gaTrackers[i] + '_addTrans', ID, aff, total, tax, shipping, '', '', '']);
- }
- }
- function spilEcommerceItem(ID, SKU, product, category, price, quantity)
- {
- for (var i = 0; i < gaTrackers.length; i++)
- {
- _gaq.push([gaTrackers[i] + '_addItem', ID, SKU, product, category, price, quantity]);
- }
- }
- function spilEcommerceTrackTrans()
- {
- for (var i = 0; i < gaTrackers.length; i++)
- {
- _gaq.push([gaTrackers[i] + '_trackTrans']);
- }
- }
-
- function spilLocationEvent(category, action, label, value, location) {
- var totalTrackers = gaTrackers.length;
- for ( var i = totalTrackers; i--;) {
- _gaq.push( [ gaTrackers[i] + '_trackEvent', category, action, label, value]);
- }
- setTimeout('document.location = "' + location + '"', 100);
- }
- function sendPageviewToAllTrackers() {
- spilTracker('', 'UA-18031455-1', '.gamesgames.com');
- spilTracker('aggregated', 'UA-8223336-1', '.gamesgames.com'); // aggregated account should match the domain name
- }
-
- sendPageviewToAllTrackers();
-
- (function() {
-
- })();
-
- //
- // new
- //
- var PageMonitor = (function() {
- var idleSince = (+new Date()),
- timeForNewPageView = 30*60*1000, /* 30 minutes */
- keepAliveCounter = 0,
- keepAliveTimerId = -1,
- keepAliveInterval = 60*1000,
- maximumKeepAlive = 3*60*1000;
-
- var notIdleAnymore = function() {
- newPageView();
- idleSince = (+new Date());
- keepAliveTimerId < 0 && active();
- }
-
- document.addEventListener('click', notIdleAnymore);
- document.addEventListener('touchstart', notIdleAnymore);
-
- var idle = function() {
- idleSince = (+new Date());
- keepAliveTimerId = -1;
- };
-
- var active = function() {
- keepAliveTimerId = setTimeout(keepAlive, keepAliveInterval);
- };
-
- var keepAlive = function() {
- spilEvent('unbounce', 'each [x] minutes', '' + keepAliveCounter);
- keepAliveCounter++;
- if(idleTime() < maximumKeepAlive)
- keepAliveTimerId = setTimeout(keepAlive, keepAliveInterval);
- else {
- idle();
- }
- };
-
- var newPageView = function() {
- if (idleTime() >= timeForNewPageView) {
- sendPageviewToAllTrackers();
- }
- };
-
- var idleTime = function() {
- return ((+new Date()) - idleSince);
- }
-
- active();
- })();
- })();
- </script>
-
- <div id="mainDiv" style="left: 50%; top: -20px; margin-left: -160px; z-index: 20; position: absolute; overflow: hidden; width: 320px; height: 480px; ">
- <div style="display: inline; z-index: 0; -webkit-transition: 2000ms; opacity: 1; -webkit-transform: translate(0px, 0px) rotate(0deg); ">
- <div style="width: 320px; height: 480px; left: 0px; top: 0px; position: absolute; background-image: url(res/images/majong_BG.png); background-repeat: no-repeat no-repeat; "></div>
- <div style="width: 318px; height: 426px; left: 0px; top: 0px; position: absolute; background-image: url(res/images/MAIN_MENU_AND_LOADING_BG.png); background-repeat: no-repeat no-repeat; "></div>
- <div style="position: absolute; width: 149px; height: 63px; background-image: url(res/images/BTN_START.png); left: 93px; top: 264px; display: none; background-position: 0px 0px; background-repeat: no-repeat no-repeat; "></div>
- <div style="position: absolute; width: 149px; height: 63px; background-image: url(res/images/BTN_CONTINUE.png); left: 95px; top: 330px; display: none; background-position: 0px 0px; background-repeat: no-repeat no-repeat; "></div>
- </div>
- </div>
- <div id="orientationDiv" style="background-image: url(res/images/OrientationWarning.png); position: absolute; width: 480px; height: 320px; display: none; background-position: 50% 50%; background-repeat: no-repeat no-repeat; "> </div>
- </body></html>
|