1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832 |
- import * as PIXI from "./pixi.min"
- import { TimelineLite, Sine, TweenMax , Back } from "./TweenMax.min"
- import {Howl, Howler} from './howler.min'
- var gamen = require("./gamen");
- (function () {
- var XORcipher = function () {
- return new XORcipher.fn.init();
- };
- XORcipher.fn = XORcipher.prototype =
- {
- constructor: XORcipher,
- init:function()
- {
- return this;
- },
- //암호화
- xorEncoder:function($str, $key)
- {
- var bytes = [];
- for (var i = 0; i < $str.length; ++i)
- {
- bytes.push($str.charCodeAt(i));
- }
- var result = [];
- for(var i = 0; i < bytes.length; i++)
- {
- result.push(bytes[i] ^ $key);
- }
- return result;
- },
- //복호화
- xorDecoder:function($byte, $key)
- {
- var bytes = [];
- for(var i = 0; i < $byte.length; i++)
- {
- bytes.push($byte[i] ^ $key);
- }
- var str = String.fromCharCode.apply(String, bytes);
- return str;
- }
- };
- window.XORcipher = XORcipher;
- }());
- XORcipher.fn.init.prototype = XORcipher.fn;
- var GD = {};
- var DataManager = {};
- var GamePadManager = {};
- /*Image server*/
- var IMG_SERVER = '';
- var GAME_IMG_PATH = 'https://pub.dwstatic.com/wxgame/momobakery/';
- var COMMON_IMG_PATH = 'https://pub.dwstatic.com/wxgame/momobakery/';
- /*JS Server*/
- var JS_SERVER = '';
- var GAME_JS_PATH = '';
- var COMMON_JS_PATH = 'js/common/';
- var JS_PATH = '';
- var CACHE_VER = 0.2;
- var RES_DIR_IMG = GAME_IMG_PATH + 'image/';
- var RES_DIR_JSON = RES_DIR_IMG + 'json/';
- var RES_DIR_PNG = RES_DIR_IMG + 'png/';
- var RES_DIR_SPINE = RES_DIR_IMG + 'spine/';
- var RES_DIR_SOUND = GAME_IMG_PATH + 'sound/';
- // source code version
- var IMG_VERSION = CACHE_VER;
- var SOUND_VERSION = CACHE_VER;
- !function(t) {
- function e(n) {
- if (i[n])
- return i[n].exports;
- var o = i[n] = {
- exports: {},
- id: n,
- loaded: !1
- };
- return t[n].call(o.exports, o, o.exports, e),
- o.loaded = !0,
- o.exports
- }
- var i = {};
- return e.m = t,
- e.c = i,
- e.p = "",
- e(0)
- }([function(t, e, i) {
- i(1),
- i(5),
- i(10),
- i(6),
- i(7),
- i(9),
- i(8),
- i(11),
- i(12),
- i(13),
- i(14),
- i(15),
- i(2),
- i(3),
- i(4)
- }
- , function(t, e) {}
- , function(t, e) {
- PIXI.Container.prototype.setTouchStartAction = function(t, e, i) {
- t.mousedown = t.touchstart = function(n) {
- n.stopPropagation(),
- GD.fullScreen(),
- GD.buttonAction(t),
- e && e.call(i, n)
- }
- .bind(i)
- }
- ,
- PIXI.Container.prototype.setTouchStart = function(t, e, i) {
- t.mousedown = t.touchstart = function(t) {
- t.stopPropagation(),
- GD.fullScreen(),
- e && e.call(i, t)
- }
- .bind(i)
- }
- ,
- PIXI.Container.prototype.setTouchEnd = function(t, e, i) {
- t.tap = function(t) {
- t.stopPropagation(),
- GD.fullScreen(),
- e && e.call(i, t)
- }
- .bind(i),
- GD.isMobile || (t.click = function(t) {
- t.stopPropagation(),
- e && e.call(i, t)
- }
- .bind(i))
- }
- ,
- PIXI.Container.prototype.setTouchMove = function(t, e, i) {
- t.mousemove = t.touchmove = function(t) {
- t.stopPropagation(),
- e && e.call(i, t)
- }
- .bind(i)
- }
- ,
- PIXI.Container.prototype.addGamePadEvent = function() {
- this.removeGamePadEvent()
- // $(GamePadManager).on("padButton", this.onGamePadEvent.bind(this)),
- // $(GamePadManager).on("padStickX", this.onGamePadStickXEvent.bind(this)),
- // $(GamePadManager).on("padStickY", this.onGamePadStickYEvent.bind(this))
- }
- ,
- PIXI.Container.prototype.removeGamePadEvent = function() {
- // $(GamePadManager).off()
- }
- ,
- PIXI.Container.prototype.onGamePadEvent = function(t, e) {}
- ,
- PIXI.Container.prototype.onGamePadStickXEvent = function(t, e) {}
- ,
- PIXI.Container.prototype.onGamePadStickYEvent = function(t, e) {}
- ,
- PIXI.Container.prototype.showLoading = function() {
- GD.loading = GD.LoadingView.getInstance(),
- GD.loading.init(),
- this.addChild(GD.loading)
- }
- ,
- PIXI.Container.prototype.hideLoading = function() {
- this.removeChild(GD.loading)
- }
- }
- , function(t, e) {
- GD.CommonIntro = function(t, e) {
- PIXI.Container.call(this),
- this.helpBtn = null,
- this.soundpBtn = null,
- this.startBtn = null,
- this.callBackFunc = null,
- this.callBackTarget = null,
- this.bg = this.setSpriteTexture(this.bg, "texture", e),
- this.addChild(this.bg),
- // this.copyText = this.setSpriteTexture(this.copyText, "texture", "copybar_" + t),
- // this.copyText.anchor.set(.5),
- // this.copyText.x = GD.width / 2,
- // this.copyText.y = GD.height - 20,
- // this.addChild(this.copyText),
- this.gamePadGuide = null,
- this.soundPopup = new GD.OptionPopup,
- this.soundPopup.on("SOUND_POPUP_CLOSE_EVENT", this.closeSoundPopup.bind(this)),
- gamen.loadend()
- }
- ,
- GD.CommonIntro.constructor = GD.CommonIntro,
- GD.CommonIntro.prototype = Object.create(PIXI.Container.prototype),
- GD.CommonIntro.prototype.init = function() {
- GamePadManager.isConnected && GD.isShowPadGuide && (this.gamePadGuide || (this.gamePadGuide = new GD.GamePadGuide),
- this.showGamePadGuide(),
- this.addGamePadEvent()),
- GD.isShowPadGuide = !1,
- this.setInteractive(!0)
- }
- ,
- GD.CommonIntro.prototype.showGamePadGuide = function() {
- this.gamePadGuide.init(),
- this.addChild(this.gamePadGuide)
- }
- ,
- GD.CommonIntro.prototype.hideGamePadGuide = function() {
- this.removeChild(this.gamePadGuide)
- }
- ,
- GD.CommonIntro.prototype.initHelp = function(t, e, i) {
- this.helpBtn = this.setSpriteTexture(this.helpBtn, "texture", t),
- this.helpBtn.anchor.set(.5),
- this.helpBtn.x = e,
- this.helpBtn.y = i,
- this.helpBtn.scale.set(1),
- this.addChild(this.helpBtn),
- this.setTouchStartAction(this.helpBtn),
- this.setTouchEnd(this.helpBtn, this.showHelp, this)
- }
- ,
- GD.CommonIntro.prototype.initSound = function(t, e, i) {
- this.soundpBtn = this.setSpriteTexture(this.soundpBtn, "texture", t),
- this.soundpBtn.anchor.set(.5),
- this.soundpBtn.x = e,
- this.soundpBtn.y = i,
- this.soundpBtn.scale.set(1),
- this.addChild(this.soundpBtn),
- this.setTouchStartAction(this.soundpBtn),
- this.setTouchEnd(this.soundpBtn, this.showSoundPopup, this)
- }
- ,
- GD.CommonIntro.prototype.initStart = function(t, e, i, n, o) {
- this.startBtn = this.setSpriteTexture(this.startBtn, "texture", t),
- this.startBtn.anchor.set(.5),
- this.startBtn.x = e,
- this.startBtn.y = i,
- this.callBackFunc = n,
- this.callBackTarget = o,
- this.startBtn.scale.set(1),
- this.addChild(this.startBtn),
- this.setTouchStartAction(this.startBtn),
- this.setTouchEnd(this.startBtn, this.sendStartData, this)
- }
- ,
- GD.CommonIntro.prototype.onGamePadEvent = function(t, e) {
- switch (e) {
- case "button-1":
- this.hideGamePadGuide(),
- this.sendStartData();
- break;
- case "button-2":
- this.hideGamePadGuide(),
- this.showHelp();
- break;
- case "button-3":
- this.hideGamePadGuide(),
- this.showSoundPopup();
- break;
- case "button-4":
- this.hideGamePadGuide()
- }
- }
- ,
- GD.CommonIntro.prototype.showHelp = function() {
- this.setInteractive(!1),
- GD.tutorial.initPage(0, "help_start"),
- GD.tutorial.once("TUTORIAL_CLOSE_EVENT", this.hideHelp.bind(this)),
- this.addChild(GD.tutorial)
- }
- ,
- GD.CommonIntro.prototype.hideHelp = function() {
- this.sendStartData()
- }
- ,
- GD.CommonIntro.prototype.showSoundPopup = function() {
- this.setInteractive(!1),
- this.soundPopup.show(0),
- this.addChild(this.soundPopup)
- }
- ,
- GD.CommonIntro.prototype.closeSoundPopup = function() {
- this.removeChild(this.soundPopup),
- this.setInteractive(!0)
- }
- ,
- GD.CommonIntro.prototype.sendStartData = function() {
- this.showLoading(),
- DataManager.start(this.startDataComplete, this)
- }
- ,
- GD.CommonIntro.prototype.startDataComplete = function() {
- this.hideLoading(),
- GD.tutorial && this.removeChild(GD.tutorial),
- this.callBackFunc.call(this.callBackTarget)
- }
- ,
- GD.CommonIntro.prototype.setInteractive = function(t) {
- this.helpBtn.interactive = t,
- this.soundpBtn.interactive = t,
- this.startBtn.interactive = t,
- GamePadManager.isConnected && (t ? this.addGamePadEvent() : this.removeGamePadEvent())
- }
- ,
- GD.CommonIntro.getInstance = function(t, e) {
- return GD.commonIntro || (GD.commonIntro = new GD.CommonIntro(t,e)),
- GD.commonIntro
- }
- }
- , function(t, e) {
- GD.CommonOption = function(t) {
- PIXI.Container.call(this),
- this.scorePopup = new GD.ScorePopup,
- this.scorePopup.on("SCORE_POPUP_CLOSE_EVENT", this.closeScorePopup.bind(this)),
- this.optionPopup = new GD.OptionPopup,
- this.optionPopup.on("SOUND_POPUP_CLOSE_EVENT", this.closeOptionPopup.bind(this)),
- this.optionPopup.on("TUTORIAL_OPEN_EVENT", this.showTutorial.bind(this)),
- this.optBtn = this.setSpriteTexture(this.optBtn, "texture", "btn_option_" + t),
- this.optBtn.anchor.set(.5),
- this.optBtn.x = GD.width - 40,
- this.optBtn.y = 110,
- this.setTouchStartAction(this.optBtn),
- this.setTouchEnd(this.optBtn, function() {
- this.setInteractive(!1),
- this.optionPopup.show(1),
- this.addChild(this.optionPopup),
- this.emit("OPTION_OPEN_EVENT")
- }
- .bind(this)),
- this.achievement = new GD.Achievement
- }
- ,
- GD.CommonOption.constructor = GD.CommonOption,
- GD.CommonOption.prototype = Object.create(PIXI.Container.prototype),
- GD.CommonOption.prototype.init = function() {
- this.removeAll(),
- this.addChild(this.optBtn),
- this.addChild(this.achievement),
- this.setInteractive(!0)
- }
- ,
- GD.CommonOption.prototype.setAchievement = function(t) {
- this.achievement.show(t)
- }
- ,
- GD.CommonOption.prototype.setInteractive = function(t) {
- this.optBtn.interactive = t
- }
- ,
- GD.CommonOption.prototype.closeOptionPopup = function() {
- this.removeChild(this.optionPopup),
- this.setInteractive(!0),
- this.emit("OPTION_CLOSE_EVENT")
- }
- ,
- GD.CommonOption.prototype.showTutorial = function() {
- GD.tutorial.initPage(0, "help_close"),
- GD.tutorial.on("TUTORIAL_CLOSE_EVENT", this.hideHelp.bind(this)),
- this.addChild(GD.tutorial)
- }
- ,
- GD.CommonOption.prototype.hideHelp = function() {
- this.removeChild(GD.tutorial),
- this.optionPopup.setInteractive(!0)
- }
- ,
- GD.CommonOption.prototype.closeScorePopup = function() {
- this.gameRestart()
- }
- ,
- GD.CommonOption.prototype.finish = function(t) {
- gamen.score_view_status ? (this.scorePopup.show(t),
- this.addChild(this.scorePopup)) : (GD.exitFullScreen(),
- DataManager.finish(t))
- }
- ,
- GD.CommonOption.prototype.gameRestart = function() {
- this.emit("GAME_RESTART")
- }
- ,
- GD.CommonOption.prototype.removeAll = function() {
- this.removeChildren()
- }
- ,
- GD.CommonOption.getInstance = function(t) {
- return GD.commonOption || (GD.commonOption = new GD.CommonOption(t)),
- GD.commonOption
- }
- }
- , function(t, e) {
- GD = {
- loader: null,
- stats: null,
- width: 504,
- height: 861,
- leng: "ko",
- isMobile: !1,
- isDebug: !1,
- isShowLog: !1,
- isLogin: !1,
- unique: null,
- pk: null,
- sKey: null,
- oKey: null,
- startTime: null,
- medal: [],
- soundType: 1,
- isAllSound: !0,
- isBgmSound: !0,
- isEffectSound: !0,
- isShowPadGuide: !0,
- orientationType: null,
- orientationGuide: null,
- sound: {},
- darkBg: null,
- stage: null,
- commonIntro: null,
- commonOption: null,
- tutorial: null,
- loading: null
- },
- GD.init = function(t, e, i, n, backgroundColor) {
- var {pixelRatio, windowWidth, windowHeight} = wx.getSystemInfoSync()
- // var gWidth = windowWidth * pixelRatio
- // var gHeight = windowHeight * pixelRatio
- var gWidth = 720;
- var gHeight = 1232;
- GD.width = gWidth
- GD.height = gHeight
- GD.leng = gamen.game_language
-
- var app = GD.app = new PIXI.Application({
- width: gWidth,
- height: gHeight,
- forceCanvas:true,
- backgroundColor: backgroundColor,
- clearBeforeRender: false,
- resolution: 2,
- view: canvas
- })
-
- var xRatio = windowWidth * pixelRatio / gWidth;
- var yRatio = windowHeight * pixelRatio / gHeight;
- console.log(xRatio, yRatio);
- app.renderer.plugins.interaction.mapPositionToPoint = (point, x, y) => {
- point.x = x * pixelRatio / xRatio
- point.y = y * pixelRatio / yRatio
- }
-
- // requestAnimationFrame(this.update)
- this.renderer = app.renderer
- this.stage = app.stage
- // this.resize()
- this.setSpriteTexture()
- this.resourceLoad()
-
- // if (GD.width = t,
- // GD.height = e,
- // GD.leng = gamen.game_language,
- // this.renderer = PIXI.autoDetectRenderer(t, e, {
- // backgroundColor: backgroundColor,
- // resolution: 2,
- // clearBeforeRender: !1
- // }),
- // // $("#gamecontainer")[0] ? ($("#gameCanvas") && $("#gameCanvas").remove(),
- // // $("#gamecontainer").append(this.renderer.view)) : document.body.appendChild(this.renderer.view),
- // GD.Util.mobileCheck() && (GD.isMobile = !0),
- // GD.Util.mobileCheck()) {
- // var s = navigator.userAgent.toLowerCase();
- // -1 != s.indexOf("android 4.") ? -1 == s.indexOf("chrome") && -1 == s.indexOf("mobile safari") || (GD.soundType = 1) : GD.soundType = 1
- // } else
- // GD.soundType = 1;
- // requestAnimationFrame(this.update),
- // this.root = new PIXI.Container,
- // this.stage = new PIXI.Container,
- // this.root.addChild(this.stage),
- // GD.isDebug && (GD.stats = new Stats,
- // document.body.appendChild(GD.stats.domElement),
- // GD.stats.domElement.style.position = "absolute",
- // GD.stats.domElement.style.top = "0px"),
- // this.resize(),
- // this.setSpriteTexture(),
- // this.resourceLoad()
- }
- ,
- GD.resourceLoad = function() {
- var t = COMMON_IMG_PATH + "image/json/";
- GD.loader = PIXI.loader,
- GD.loader.add(t + "human_common.json"),
- GD.loader.add(t + "human_popup_" + this.leng + ".json")
- }
- ,
- GD.showProgress = function() {
- GD.progress = new GD.Progress,
- GD.progress.show(),
- this.stage.addChild(GD.progress)
- }
- ,
- GD.hideProgress = function() {
- GD.progress.hide(),
- this.stage.removeChild(GD.progress)
- }
- ,
- GD.resize = function() {
- if (GD.renderer) {
- var t = GD.width / GD.height
- , e = window.innerWidth
- , i = window.innerHeight
- , n = e / i;
- // if ($("#gamecontainer")[0]) {
- if(0) {
- var o = document.getElementById("gamecontainer");
- o.style.color = "#FF0000",
- n > t ? (e = i * t,
- o.style.width = e + "px",
- o.style.height = i + "px",
- GD.renderer.view.style.width = e + "px",
- GD.renderer.view.style.height = i + "px") : (i = e / t,
- o.style.width = e + "px",
- o.style.height = i + "px",
- GD.renderer.view.style.width = e + "px",
- GD.renderer.view.style.height = i + "px")
- } else
- n > t ? e = i * t : i = e / t,
- this.renderer.view.style.width = e + "px",
- this.renderer.view.style.height = i + "px"
- }
- gamen.score_view_status || this.setOrientationGuide()
- }
- ,
- GD.render = function() {
- GD.renderer.render(GD.root)
- }
- ,
- GD.update = function() {
- GD.isDebug && GD.stats.begin(),
- requestAnimationFrame(GD.update),
- GD.render(),
- GD.isDebug && GD.stats.end()
- }
- ,
- GD.buttonAction = function(t, e, i) {
- e || (e = 1.2),
- i || (i = 1),
- t.scale.set(e),
- TweenMax.to(t.scale, .2, {
- x: i,
- y: i
- })
- }
- ,
- GD.setSpriteTexture = function() {
- PIXI.Container.prototype.setSpriteTexture = function(t, e, i) {
- return "sprite" == e ? t ? t.texture = GD.loader.resources[i].texture : t = new PIXI.Sprite(GD.loader.resources[i].texture) : t ? t.texture = PIXI.Texture.fromFrame(i + ".png") : t = new PIXI.Sprite.fromFrame(i + ".png"),
- t
- }
- }
- ,
- GD.getDarkBg = function() {
- return GD.darkBg || (GD.darkBg = new PIXI.Graphics,
- GD.darkBg.beginFill(0, .8),
- GD.darkBg.drawRect(0, 0, GD.width, GD.height),
- GD.darkBg.endFill()),
- GD.darkBg
- }
- ,
- GD.log = function(t) {
- GD.isShowLog ? (GD.logStr = t + "\n" + GD.logStr,
- GD.logText || (GD.logText = new PIXI.Text("",{
- font: "14px Arial",
- fill: "#F7EDCA",
- stroke: "#000",
- strokeThickness: 4,
- wordWrapWidth: GD.width - 60,
- wordWrap: !0
- }),
- GD.logText.x = 30,
- GD.logText.y = 30),
- GD.logText.parent || GD.root.addChild(GD.logText),
- GD.logText.text = GD.logStr) : console.log(t)
- }
- ,
- GD.fullScreen = function() {
- if (GD.isMobile) {
- var t = navigator.platform.match(/iPhone|iPod|iPad/);
- if (!t) {
- var e = GD.renderer.view;
- e.requestFullscreen ? e.requestFullscreen() : e.webkitRequestFullScreen ? e.webkitRequestFullScreen() : e.mozRequestFullScreen()
- }
- }
- }
- ,
- GD.exitFullScreen = function() {
- if (GD.isMobile) {
- var t = navigator.platform.match(/iPhone|iPod|iPad/);
- if (!t) {
- var e = GD.renderer.view;
- e.exitFullscreen ? e.exitFullscreen() : e.mozCancelFullScreen ? e.mozCancelFullScreen() : e.webkitExitFullscreen && e.webkitExitFullscreen()
- }
- }
- }
- ,
- GD.setOrientationGuide = function() {
- var t = document.getElementById("rank_layout");
- if (t && "none" != t.style.display && com)
- return GD.renderer.view.style.display = "none",
- void GD.showOrientation(!1);
- var e = window.innerWidth / window.innerHeight
- , i = GD.width / GD.height;
- i > 1 ? GD.orientationType = "phone rotate_x" : GD.orientationType = "phone rotate_y",
- e > 1 && 1 > i || 1 > e && i > 1 ? GD.showOrientation(!0) : GD.showOrientation(!1)
- }
- ,
- GD.showOrientation = function(t) {
- // for (var e = ["Z300C", "TF701T", "TF700T", "TF103C", "TF101-1B251A", "TA2506 10BK", "SM-T805", "SM-T800", "SM-T677", "SM-T670", "SM-P900", "SMP-605", "SMP-600", "SMART-TV", "SmartTV", "SM-905", "SHW-M480W", "SHW-M380", "SHV-E230", "SGP771", "SGP311", "QM0101", "Q109", "MZ68", "MZ601", "MX1080", "MID 1065-8", "MID 1042-8", "ME102A", "LGV940", "LGV700N", "GT-P5110", "FZ-A1", "AT105", "A10-70", "10QS", "10ES"], i = e.length; i--; )
- // if (navigator.userAgent.match(e[i]))
- // return;
- // var n, o, s, r, a, h;
- // if (GD.isMobile) {
- // var l = document.getElementsByClassName("xy_wrap").length;
- // if (t) {
- // if (n = GD.orientationGuide,
- // null == n) {
- // if (n = document.createElement("div"),
- // n.style.backgroundColor = "#ff7e17",
- // n.style.position = "absolute",
- // n.style.left = 0,
- // n.style.top = 0,
- // n.style.right = 0,
- // n.style.bottom = 0,
- // n.style.margin = "auto",
- // n.setAttribute("class", "xy_wrap"),
- // GD.orientationGuide = n,
- // o = document.createElement("div"),
- // o.setAttribute("class", "xy_info"),
- // s = document.createElement("div"),
- // s.setAttribute("class", GD.orientationType),
- // r = document.createElement("span"),
- // r.setAttribute("class", "yes"),
- // a = document.createElement("span"),
- // a.setAttribute("class", "no"),
- // n.appendChild(o),
- // o.appendChild(s),
- // o.appendChild(r),
- // o.appendChild(a),
- // h = document.createElement("p"),
- // h.style.left = "0px",
- // h.style.right = "0px",
- // h.style.padding = "15px",
- // h.style.lineHeight = "130%",
- // h.style.color = "#FFFFFF",
- // h.style.position = "absolute",
- // "en" == GD.lang)
- // h.style.fontSize = "18px",
- // h.innerHTML = "Please rotate your device.";
- // else {
- // var u;
- // switch (GD.lang) {
- // case "jp":
- // u = "お使いの 携?電話を 回?させて 下ください。";
- // break;
- // case "en":
- // u = "ROTATE YOUR PHONE";
- // break;
- // case "cn":
- // u = "如果?幕不能旋?,?打?自?旋?功能。";
- // break;
- // default:
- // u = window.innerWidth > 480 ? "화면 전환이 되지 않는다면, 자동회전 기능을 켜 주세요." : "화면 전환이 되지 않는다면,<br>자동회전 기능을 켜 주세요."
- // }
- // h.innerHTML = u
- // }
- // o.appendChild(h)
- // }
- // 0 == l && (document.body.appendChild(n),
- // GD.orientationChange(!0),
- // GD.renderer.view.style.visibility = "hidden")
- // } else
- // l > 0 && (document.body.removeChild(GD.orientationGuide),
- // GD.orientationChange(!1),
- // GD.renderer.view.style.visibility = "visible")
- // }
- }
- ,
- GD.orientationChange = function(t) {
- t ? GD.soundMute() : GD.isAllSound && GD.soundUnMute()
- }
- ,
- GD.loadSound = function(t, e) {
- var index = 0,
- options = [],
- n = t.length;
- for (let o = 0, s = n; s--;) {
- let i = t[s];
- options[s] = {
- key: i,
- value: {
- src: [RES_DIR_SOUND + i + ".mp3?ver=" + SOUND_VERSION, RES_DIR_SOUND + i + ".ogg?ver=" + SOUND_VERSION, RES_DIR_SOUND + i + ".wav?ver=" + SOUND_VERSION],
- onload: function () {
- o++;
- if (index < n) {
- index++;
- let option = options[index - 1]
- GD.sound[option.key] = new Howl(option.value)
- index == n && e();
- }
- },
- onloaderror: function (msg) {
- console.error("error:", msg);
- o++;
- if (index < n) {
- index++;
- let option = options[index - 1]
- GD.sound[option.key] = new Howl(option.value)
- index == n && e();
- }
- }
- }
- }
- }
- while (index <= 4) {
- let option = options[index]
- GD.sound[option.key] = new Howl(option.value);
- index++;
- }
- }
- ,
- GD.bgmPlay = function(t) {
- var e = GD.sound.sound_bgm;
- e._loop = !0,
- t ? e._volume = t : e._volume = .3,
- GD.isBgmSound && e.play()
- }
- ,
- GD.bgmStop = function() {
- GD.sound.sound_bgm.stop()
- }
- ,
- GD.soundPlay = function(t, e, i) {
- var n = GD.sound[t];
- e || (e = 1),
- e ? n._volume = e : n._volume = 1,
- i ? n._loop = i : n._loop = !1,
- GD.isEffectSound && n.play()
- }
- ,
- GD.soundStop = function(t) {
- GD.isEffectSound && GD.sound[t].stop()
- }
- ,
- GD.soundAllStop = function() {
- for (var t in GD.sound)
- GD.sound[t].stop()
- }
- ,
- GD.soundMute = function() {
- Howler.mute(!0)
- }
- ,
- GD.soundUnMute = function() {
- GD.isAllSound && Howler.mute(!1)
- }
- ,
- window.onresize = function(t) {
- GD.resize()
- }
- }
- , function(t, e) {
- DataManager = {},
- DataManager.unique = null,
- DataManager.pk = null,
- DataManager.Skey = null,
- DataManager.Okey = null,
- DataManager.callFunc = null,
- DataManager.target = null,
- DataManager.playInterval = null,
- DataManager.start = function(t, e) {
- DataManager.callFunc = t,
- DataManager.target = e,
- gamen.start(DataManager.startDataComplete)
- }
- ,
- DataManager.startDataComplete = function(t, e, i, n, o) {
- if (GD.isLogin = t,
- GD.isLogin && (GD.sKey = gamen.spkey(n),
- GD.oKey = gamen.opkey(o),
- GD.unique = XORcipher().xorDecoder(e, GD.sKey),
- GD.pk = i,
- GD.startTime = Date.now(),
- GD.medal = [],
- null != gamen.achievement))
- for (var s = gamen.achievement.length, r = 0; s > r; ++r) {
- var a = XORcipher().xorDecoder(gamen.achievement[r], GD.sKey)
- , h = [];
- h = a.split("_gamen_"),
- GD.medal[r] = [parseInt(h[0]), !1, parseInt(h[1]), h[2], h[3], parseInt(h[5]), h[4]]
- }
- DataManager.callFunc.call(DataManager.target),
- DataManager.playInterval = setInterval(DataManager.promisePlay, .1)
- }
- ,
- DataManager.point = function(t, e) {
- if (GD.log(t + " : " + e),
- DataManager.otherPoint(t, e),
- GD.isLogin) {
- t = XORcipher().xorEncoder(t, GD.sKey),
- e = XORcipher().xorEncoder(e.toString(), GD.sKey);
- var i = Date.now() - GD.startTime
- , n = XORcipher().xorEncoder(i.toString(), GD.sKey);
- gamen.point(t, e, n)
- }
- }
- ,
- DataManager.otherPoint = function(t, e) {
- if (GD.isLogin) {
- t = XORcipher().xorEncoder(t, GD.oKey),
- e = XORcipher().xorEncoder(e.toString(), GD.oKey);
- var i = Date.now() - GD.startTime
- , n = XORcipher().xorEncoder(i.toString(), GD.oKey);
- gamen.otherpoint(t, e, n)
- }
- }
- ,
- DataManager.promisePlay = function() {
- var t = Date.now() - GD.startTime
- , e = XORcipher().xorEncoder(t.toString(), GD.oKey);
- gamen.promiseplay(e)
- }
- ,
- DataManager.finish = function(t) {
- if (DataManager.playInterval && clearInterval(DataManager.playInterval),
- GD.isLogin) {
- if (GD.medal.length > 0) {
- var e = []
- , i = GD.medal.length;
- gamen.new_achievement = [];
- for (var n = 0; i > n; ++n)
- e[n] = GD.medal[n][0] + "_gamen_" + GD.medal[n][2] + "_gamen_" + GD.medal[n][3] + "_gamen_" + GD.medal[n][4] + "_gamen_" + parseInt(GD.medal[n][5]),
- gamen.new_achievement[n] = XORcipher().xorEncoder(e[n], GD.sKey)
- }
- GD.log("finish : " + t);
- var o = XORcipher().xorEncoder(t.toString(), GD.sKey)
- , s = GD.commonOption.gameRestart.bind(GD.commonOption)
- , r = XORcipher().xorEncoder(GD.unique, GD.sKey)
- , a = XORcipher().xorEncoder(GD.startTime.toString(), GD.sKey)
- , h = Date.now()
- , l = XORcipher().xorEncoder(h.toString(), this.sKey);
- gamen.finish(GD.pk, o, s, r, a, l)
- } else
- gamen.finish(t, GD.commonOption.gameRestart.bind(GD.commonOption))
- }
- ,
- DataManager.addMedal = function(t, e) {
- if (GD.isLogin && GD.medal.length > 0)
- for (var i = null, n = 0; n < GD.medal.length; ++n)
- if (t == GD.medal[n][0]) {
- i = n,
- 0 == GD.medal[i][1] && (null == e && (e = 1),
- GD.medal[i][5] += e,
- GD.medal[i][2] <= GD.medal[i][5] && (GD.medal[i][1] = !0,
- GD.commonOption.setAchievement(i + 1)));
- break
- }
- }
- }
- , function(t, e) {
- GamePadManager = {
- isConnected: !1,
- init: function() {
- gamepadSupport.init()
- },
- showNotSupported: function() {},
- updateGamePads: function(t) {
- if (this.isConnected = !1,
- t)
- for (var e in t) {
- var i = t[e];
- i && (this.isConnected = !0)
- }
- },
- updateButton: function(t, e, i) {
- // t.pressed && $(this).trigger("padButton", i)
- },
- updateAxis: function(t, e, i, n, o) {
- // "stick-1" == n && ("stick-1-axis-x" == i ? $(this).trigger("padStickX", t) : "stick-1-axis-y" == i && $(this).trigger("padStickY", t))
- }
- }
- }
- , function(t, e) {
- GD.OptionPopup = function() {
- PIXI.Container.call(this),
- this.darkBg = GD.getDarkBg(),
- this.bg = null,
- this.type = null,
- this.allBtn = this.setSpriteTexture(this.allBtn, "texture", "option_on_0"),
- this.allBtn.anchor.set(.5),
- this.allBtn.x = 110,
- this.setTouchEnd(this.allBtn, function() {
- GD.isAllSound = !GD.isAllSound,
- this.setAllSoundBtn(),
- this.setBgmBtn(!1),
- this.setEffectBtn()
- }, this),
- this.bgmBtn = this.setSpriteTexture(this.bgmBtn, "texture", "option_on_0"),
- this.bgmBtn.anchor.set(.5),
- this.bgmBtn.x = this.allBtn.x,
- this.setTouchEnd(this.bgmBtn, function() {
- GD.isAllSound && (GD.isBgmSound = !GD.isBgmSound,
- this.setBgmBtn(!0))
- }, this),
- this.effectBtn = this.setSpriteTexture(this.effectBtn, "texture", "option_on_0"),
- this.effectBtn.anchor.set(.5),
- this.effectBtn.x = this.allBtn.x,
- this.setTouchEnd(this.effectBtn, function() {
- GD.isAllSound && (GD.isEffectSound = !GD.isEffectSound,
- this.setEffectBtn())
- }, this),
- this.closeBtn = this.setSpriteTexture(this.closeBtn, "texture", "option_close_btn"),
- this.closeBtn.anchor.set(.5),
- this.closeBtn.x = 200,
- this.setTouchStartAction(this.closeBtn, function() {
- this.emit("SOUND_POPUP_CLOSE_EVENT")
- }, this),
- this.tutorialBtn = this.setSpriteTexture(this.tutorialBtn, "texture", "option_help_btn"),
- this.tutorialBtn.anchor.set(.5),
- this.setTouchStartAction(this.tutorialBtn),
- this.setTouchEnd(this.tutorialBtn, function() {
- this.setInteractive(!1),
- this.emit("TUTORIAL_OPEN_EVENT")
- }, this)
- }
- ,
- GD.OptionPopup.constructor = GD.OptionPopup,
- GD.OptionPopup.prototype = Object.create(PIXI.Container.prototype),
- GD.OptionPopup.prototype.show = function(t) {
- this.removeChild(),
- this.type = t;
- var e = "option_box_0";
- 0 == this.type ? (1 == GD.soundType ? (this.closeBtn.y = -185,
- this.allBtn.y = -62) : (e = "option_box1_0",
- this.closeBtn.y = -92,
- this.allBtn.y = 25,
- this.allBtn.y = 30),
- this.bgmBtn.y = 70,
- this.effectBtn.y = 165) : (e = "option_box_1",
- 1 == GD.soundType ? (this.closeBtn.y = -247,
- this.allBtn.y = -124,
- this.tutorialBtn.y = 230) : (e = "option_box1_1",
- this.closeBtn.y = -148,
- this.allBtn.y = -27,
- this.tutorialBtn.y = 130),
- this.bgmBtn.y = 20,
- this.effectBtn.y = 115),
- this.addChild(this.darkBg),
- this.bg = this.setSpriteTexture(this.bg, "texture", e),
- this.bg.anchor.set(.5),
- this.bg.x = GD.width / 2,
- this.bg.y = GD.height / 2,
- this.addChild(this.bg),
- this.bg.addChild(this.closeBtn),
- this.bg.addChild(this.allBtn),
- 1 == GD.soundType && (this.bg.addChild(this.bgmBtn),
- this.bg.addChild(this.effectBtn)),
- 1 == this.type && this.bg.addChild(this.tutorialBtn),
- this.setAllSoundBtn(),
- this.setBgmBtn(!1),
- this.setEffectBtn(),
- this.bg.scale.set(.1),
- TweenMax.to(this.bg.scale, .15, {
- x: 1,
- y: 1,
- ease: Back.easeOut,
- onComplete: this.showComplete.bind(this)
- })
- }
- ,
- GD.OptionPopup.prototype.showComplete = function() {
- this.setInteractive(!0)
- }
- ,
- GD.OptionPopup.prototype.hide = function() {
- this.removeChild()
- }
- ,
- GD.OptionPopup.prototype.setAllSoundBtn = function() {
- GD.isAllSound ? (this.allBtn = this.setSpriteTexture(this.allBtn, "texture", "option_on_0"),
- GD.soundUnMute()) : (this.allBtn = this.setSpriteTexture(this.allBtn, "texture", "option_off_0"),
- GD.soundMute())
- }
- ,
- GD.OptionPopup.prototype.setBgmBtn = function(t) {
- GD.isAllSound ? (GD.isBgmSound ? this.bgmBtn = this.setSpriteTexture(this.bgmBtn, "texture", "option_on_0") : this.bgmBtn = this.setSpriteTexture(this.bgmBtn, "texture", "option_off_0"),
- t && 1 == this.type && (GD.isBgmSound ? GD.bgmPlay() : GD.bgmStop())) : GD.isBgmSound ? this.bgmBtn = this.setSpriteTexture(this.bgmBtn, "texture", "option_on_1") : this.bgmBtn = this.setSpriteTexture(this.bgmBtn, "texture", "option_off_1")
- }
- ,
- GD.OptionPopup.prototype.setEffectBtn = function() {
- GD.isAllSound ? GD.isEffectSound ? this.effectBtn = this.setSpriteTexture(this.effectBtn, "texture", "option_on_0") : this.effectBtn = this.setSpriteTexture(this.effectBtn, "texture", "option_off_0") : GD.isEffectSound ? this.effectBtn = this.setSpriteTexture(this.effectBtn, "texture", "option_on_1") : this.effectBtn = this.setSpriteTexture(this.effectBtn, "texture", "option_off_1")
- }
- ,
- GD.OptionPopup.prototype.setInteractive = function(t) {
- this.allBtn.interactive = t,
- this.bgmBtn.interactive = t,
- this.effectBtn.interactive = t,
- this.tutorialBtn.interactive = t,
- this.closeBtn.interactive = t
- }
- ,
- GD.OptionPopup.prototype.removeChild = function() {
- this.removeChildren(),
- this.bg && this.bg.removeChildren(),
- this.setInteractive(!1)
- }
- }
- , function(t, e) {
- GD.ScorePopup = function() {
- PIXI.Container.call(this),
- this.darkBg = GD.getDarkBg(),
- this.bg = this.setSpriteTexture(this.allBtn, "texture", "gameOver_box"),
- this.bg.anchor.set(.5),
- this.bg.x = GD.width / 2,
- this.bg.y = GD.height / 2,
- this.closeBtn = this.setSpriteTexture(this.closeBtn, "texture", "option_close_btn"),
- this.closeBtn.anchor.set(.5),
- this.closeBtn.x = 267,
- this.closeBtn.y = -88,
- this.setTouchStartAction(this.closeBtn, function() {
- this.emit("SCORE_POPUP_CLOSE_EVENT")
- }, this),
- this.bg.addChild(this.closeBtn),
- this.pointTxt = new gc.NumberText("gameOver_num_","center",-12),
- this.pointTxt.y = 8,
- this.bg.addChild(this.pointTxt)
- }
- ,
- GD.ScorePopup.constructor = GD.ScorePopup,
- GD.ScorePopup.prototype = Object.create(PIXI.Container.prototype),
- GD.ScorePopup.prototype.show = function(t) {
- this.removeChild(),
- this.pointTxt.setValue(t),
- this.addChild(this.darkBg),
- this.addChild(this.bg),
- this.bg.scale.set(.1),
- TweenMax.to(this.bg.scale, .15, {
- x: 1,
- y: 1,
- ease: Back.easeOut,
- onComplete: this.showComplete.bind(this)
- })
- }
- ,
- GD.ScorePopup.prototype.showComplete = function() {
- this.setInteractive(!0)
- }
- ,
- GD.ScorePopup.prototype.setInteractive = function(t) {
- this.closeBtn.interactive = t
- }
- ,
- GD.ScorePopup.prototype.removeChild = function() {
- this.setInteractive(!1),
- this.removeChildren()
- }
- }
- , function(t, e) {
- GD.Util = {
- zeroStr: function(t, e) {
- for (var i = t.toString(), n = e - i.length; n--; )
- i = "0" + i;
- return i
- },
- randomNumber: function(t, e) {
- var i = 10 * e || 1;
- return Math.floor(Math.random() * t * i / i)
- },
- hitTest: function(t, e) {
- return e.x >= t.x && e.x <= t.x + t.width && e.y >= t.y && e.y <= t.y + t.height
- },
- uniqueArray: function(t) {
- for (var e = [], i = 0, n = t.length; n > i; i++)
- -1 === e.indexOf(t[i]) && "" !== t[i] && e.push(t[i]);
- return e
- },
- comma: function(t) {
- return t = String(t),
- t.replace(/(\d)(?=(?:\d{3})+(?!\d))/g, "$1,")
- },
- shuffle: function(t) {
- var e, i, n;
- for (n = t.length; n; n--)
- e = Math.floor(Math.random() * n),
- i = t[n - 1],
- t[n - 1] = t[e],
- t[e] = i
- },
- grep: function(t, e) {
- return jQuery.grep(t, function(t) {
- return t != e
- })
- },
- getParam: function(t) {
- var e = window.location.search.match(new RegExp("(?:[?&]" + t + "=)([^&]+)"));
- return e ? e[1] : null
- },
- mobileCheck: function() {
- return !!(navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/Windows Phone/i))
- },
- radiansToDegrees: function(t) {
- return t * Math.PI / 180
- },
- degreesToradians: function(t) {
- return 180 * t / Math.PI
- }
- }
- }
- , function(t, e) {
- GD.Achievement = function() {
- PIXI.Container.call(this),
- this.icons = [],
- this.idx = 0
- }
- ,
- GD.Achievement.constructor = GD.Achievement,
- GD.Achievement.prototype = Object.create(PIXI.Container.prototype),
- GD.Achievement.prototype.show = function(t, e) {
- var i = this.setSpriteTexture(null, "texture", "medal_box");
- i.anchor.set(.5),
- i.scale.set(.3),
- i.idx = this.idx,
- i.x = GD.width + 50,
- e ? i.y = e : i.y = 140,
- this.icons.length > 0 && (i.y += 100 * this.icons.length),
- GD.log("game_medal_" + t);
- var n = this.setSpriteTexture(null, "sprite", "game_medal_" + t);
- n.anchor.set(.5),
- n.y = -30,
- i.addChild(n),
- this.addChild(i),
- this.icons.push(i),
- setTimeout(function() {
- TweenMax.to(i, .5, {
- x: GD.width - 50,
- ease: Back.easeOut,
- onComplete: this.iconHide.bind(this),
- onCompleteParams: [i]
- })
- }
- .bind(this), 3),
- this.idx++
- }
- ,
- GD.Achievement.prototype.iconHide = function(t) {
- TweenMax.to(t, .5, {
- x: GD.width + 50,
- delay: 2,
- ease: Back.easeIn,
- onComplete: function() {
- for (var e, i = this.icons.length; i--; )
- if (e = this.icons[i],
- e.idx == t.idx) {
- this.icons.splice(i, 1),
- this.removeChild(e);
- break
- }
- }
- .bind(this)
- })
- }
- ,
- GD.Achievement.prototype.removeAll = function() {
- this.removeChildren()
- }
- }
- , function(t, e) {
- GD.GamePadGuide = function() {
- PIXI.Container.call(this),
- this.guide = this.setSpriteTexture(this.guide, "sprite", "gamePadGuide"),
- this.setTouchEnd(this.guide, function() {
- this.setInteractive(!1),
- this.removeChild(this.guide),
- this.emit("GAME_PAD_GUIDE_CLOSE_EVENT")
- }
- .bind(this))
- }
- ,
- GD.GamePadGuide.constructor = GD.GamePadGuide,
- GD.GamePadGuide.prototype = Object.create(PIXI.Container.prototype),
- GD.GamePadGuide.prototype.init = function() {
- this.removeChild(),
- this.addChild(this.guide),
- this.setInteractive(!0)
- }
- ,
- GD.GamePadGuide.prototype.setInteractive = function(t) {
- this.guide.interactive = t
- }
- ,
- GD.GamePadGuide.prototype.removeChild = function() {
- this.removeChildren()
- }
- }
- , function(t, e) {
- GD.LoadingView = function() {
- PIXI.Container.call(this),
- this.darkBg = GD.getDarkBg(),
- this.img = this.setSpriteTexture(null, "texture", "loadingCircle"),
- this.img.scale.set(.8),
- this.img.anchor.set(.5),
- this.img.x = GD.width / 2,
- this.img.y = GD.height / 2,
- this.addChild(this.img)
- }
- ,
- GD.LoadingView.constructor = GD.LoadingView,
- GD.LoadingView.prototype = Object.create(PIXI.Container.prototype),
- GD.LoadingView.prototype.init = function() {
- this.removeAll(),
- this.addChild(this.darkBg),
- this.addChild(this.img)
- }
- ,
- GD.LoadingView.prototype.removeAll = function() {
- this.removeChildren()
- }
- ,
- GD.LoadingView.prototype.updateTransform = function() {
- PIXI.Container.prototype.updateTransform.call(this),
- this.img.rotation += .1
- }
- ,
- GD.LoadingView.getInstance = function() {
- return GD.loading || (GD.loading = new GD.LoadingView),
- GD.loading
- }
- }
- , function(t, e) {
- GD.Progress = function() {
- this.bg = null,
- this.logo = null,
- this.logoTxt = null,
- // this.tween = null,
- PIXI.Container.call(this)
- }
- ,
- GD.Progress.constructor = GD.Progress,
- GD.Progress.prototype = Object.create(PIXI.Container.prototype),
- GD.Progress.prototype.show = function() {
- if (this.bg || (this.bg = new PIXI.Graphics,
- this.bg.beginFill(16777215, 1),
- this.bg.drawRect(0, 0, GD.width, GD.height),
- this.bg.end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wRoHQyaq0FW8ZAoRHi3G7ulTth9BlHFw2KVFRd4/+9GqjMppXE9OLc75IcDw2OhqUlIyLbA7+cPWHkUDo9eSO3oVWXgFixWHBEBoJgrEfZ9fAaPSK/c+5FfUA7gZEen47jaOOwJa+98tMPHCrVz9qiYB+tMoqkpPCJB0FrLdsdOcYhctQGGUOil1jtWR+uMYdBGh44gsvYqK/+kHrR3RWa93oKqWIbBLXBrguGctD5tBwZtDOexOP0WkWazz+I8ZiiXiQohVm2AId3mq9DZ11xjMcUcVvlvpnyv1O105l8R6iV0FUnVCNinvkqeAFqCIoLXR87VKiK27aj8/cz5mwAzJKzZus4WNBGviDgWdUz5Ve7C/XJqxt0EMKSpIriLm41MizNDbEwVvUzDbt4rK3nT1QwYhqHjmNusQMt5H5E7iK6pJHdVO2BImLfCFuHn+7ZQXi+yMde5Xbg7vlU+VTtgrhdHqPdl7sVKREcJxnWS3MO+wNixYEolFY1gqhPdJ2EPQswS432Ux1BH7y8cBxogpj7qfQDsd5DDB2a48eLSV6gM8vIe4e0zv4HS/wUYAJEhl2U0gO8nAAAAAElFTkSuQmCC"
- this.logo = new PIXI.Sprite.fromImage(logo)
- }
- this.logo.x = GD.width / 2,
- this.logo.y = GD.height / 2,
- this.logo.anchor.set(.5),
- this.logo.scale.set(.1),
- this.logo.rotation = 20,
- this.addChild(this.logo),
- this.tween ? this.tween.kill() : this.tween = new TimelineLite,
- this.tween.to(this.logo, 1, {
- rotation: 0,
- ease: Sine.easeOut
- }),
- this.tween.call(this.showLocoText.bind(this)),
- TweenMax.to(this.logo.scale, 1, {
- x: 1,
- y: 1
- })
- }
- ,
- GD.Progress.prototype.showLocoText = function() {
- if (!this.logoTxt) {
- var logoTxt = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAO8AAABgCAYAAAD1liW0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHB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psCTy4zSS11c35elxcJY8yCrvLhaQ0F/DC0/nGMPnfEoHr4rANLbnyHPl7+MCg0OmBVfAb5P5rJP9rAbPURxjk1gV3sPkAqFvUCoylrfdaZFn80Ns2zAsDXBk7dJc4+NWhYi9uHJ+xLbddj6+k9W7nWxuyPZxH24436JsAGU+gHInR/Tn/Krist7APWkLKQ00n1s0dfAcrgNyI4869x7n8zZunAdKaaDGI0rHrLRlVLniVELLOIMO9miqC8pXcEVaY/Gsqdxj6wawP+bCWmz5LSAElgLeZagRbOXW9BayG68OIu8fNWr9cwFkN5mGiusuo9zF275pgWmR8lg4euku7AOYoHzTYWS3KL/UgA/mVDLz7O7nutWP9LOUPuB6O43MJlKsZsJPT2MmqTGsfHTh1qYv21B1ubIhU2eyeoIW6XjKXYB+Dx28WiLIGTWM730ce/92sArzB1ZX/KlxV1P1WDKevcjCuXMtZ3wHSd3ayGr5PFa1t8TMtxGKCqz7bqho8rAUxoNfsngePM/D2cZux43pLu4xXuB8q1QIewFfcyI3zJWKb8C3/WSP+yIym2eNiSbyCqyZFD5VVq0juzm/TDsXPGcwk9n3wG9nzWMJE3FFjDI8met4HylPMS/+Q64jT7Dv53ODe2HutBxR5K+KeRWEUyl35GEqRU8SIuaNX5ffDSOvinoF9LLVNcygfJ+xl2rODoZ1KDhkTm1AoepL5vL03wIMANN/MUNK60tEAAAAAElFTkSuQmCC"
- this.logoTxt = new PIXI.Sprite.fromImage(logoTxt),
- this.logoTxt.anchor.set(.5),
- this.logoTxt.scale.set(1),
- this.logoTxt.y = GD.height / 2
- }
- this.logoTxt.x = GD.width / 2 + 65,
- this.logoTxt.alpha = 0,
- this.addChild(this.logoTxt),
- TweenMax.to(this.logo, .4, {
- x: GD.width / 2 - 110,
- ease: Sine.easeOut
- }),
- TweenMax.to(this.logoTxt, .4, {
- x: GD.width / 2 + 90,
- alpha: 1,
- ease: Sine.easeOut
- }),
- TweenMax.delayedCall(2, this.replay.bind(this))
- }
- ,
- GD.Progress.prototype.replay = function() {
- this.hide(),
- this.show()
- }
- ,
- GD.Progress.prototype.hide = function() {
- TweenMax.killAll(),
- // this.tween.clear(),
- this.removeChildren()
- }
- ,
- GD.Progress.prototype.updateTransform = function() {
- PIXI.Container.prototype.updateTransform.call(this)
- }
- }
- , function(t, e) {
- GD.Tutorial = function() {
- PIXI.Container.call(this),
- this.type = 1,
- this.tutorialImg = null,
- this.nowPage = 0,
- this.totalPage = 0,
- this.contents = [],
- this.container = new PIXI.Container,
- this.img = this.setSpriteTexture(this.img, "texture", "temp"),
- this.prevBtn = this.setSpriteTexture(this.prevBtn, "texture", "temp"),
- this.prevBtn.anchor.set(.5),
- this.prevBtn.x = 30,
- this.prevBtn.y = GD.height / 2,
- this.setTouchStartAction(this.prevBtn, function() {
- this.nowPage > 0 && this.initPage(this.nowPage - 1)
- }, this),
- this.addChild(this.prevBtn),
- this.nextBtn = this.setSpriteTexture(this.nextBtn, "texture", "temp"),
- this.nextBtn.anchor.set(.5),
- this.nextBtn.x = GD.width - 30,
- this.nextBtn.y = GD.height / 2,
- this.setTouchStartAction(this.nextBtn, function() {
- this.nowPage + 1 < this.totalPage && this.initPage(this.nowPage + 1)
- }, this),
- this.addChild(this.nextBtn),
- this.closeBtn = this.setSpriteTexture(this.closeBtn, "texture", "temp"),
- this.closeBtn.anchor.set(.5),
- this.closeBtn.x = GD.width / 2,
- this.closeBtn.y = GD.height - 105,
- this.setTouchStartAction(this.closeBtn),
- this.setTouchEnd(this.closeBtn, function() {
- this.emit("TUTORIAL_CLOSE_EVENT")
- }, this),
- this.addChild(this.closeBtn)
- }
- ,
- GD.Tutorial.constructor = GD.Tutorial,
- GD.Tutorial.prototype = Object.create(PIXI.Container.prototype),
- GD.Tutorial.prototype.init = function(t, e) {
- this.removeChild(),
- this.type = 1,
- this.tutorialImg = e,
- this.nowPage = 0,
- this.totalPage = t,
- this.addChild(this.img),
- this.addChild(this.closeBtn),
- this.initPageButton(),
- this.setTutorialImg(),
- this.setInteractive(!0),
- this.setButtons()
- }
- ,
- GD.Tutorial.prototype.initContent = function(t, e) {
- this.removeChild(),
- this.type = 2,
- this.nowPage = 0,
- this.totalPage = t,
- this.contents = e,
- this.addChild(this.container),
- this.addChild(this.closeBtn),
- this.container.addChild(this.contents[0]),
- this.setContent(),
- this.initPageButton(),
- this.setInteractive(!0),
- this.setButtons()
- }
- ,
- GD.Tutorial.prototype.initPage = function(t, e) {
- this.nowPage = t,
- e && (this.closeBtn = this.setSpriteTexture(this.closeBtn, "texture", e)),
- 1 == this.type ? this.setTutorialImg() : this.setContent(),
- this.setButtons()
- }
- ,
- GD.Tutorial.prototype.initPageButton = function() {
- this.totalPage > 0 && (this.prevBtn = this.setSpriteTexture(this.prevBtn, "texture", "help_prev"),
- this.nextBtn = this.setSpriteTexture(this.nextBtn, "texture", "help_next"),
- this.prevBtn.scale.set(1),
- this.nextBtn.scale.set(1),
- this.addChild(this.prevBtn),
- this.addChild(this.nextBtn))
- }
- ,
- GD.Tutorial.prototype.setPrevButtonPos = function(t, e) {
- this.prevBtn.x = t,
- this.prevBtn.y = e
- }
- ,
- GD.Tutorial.prototype.setNextButtonPos = function(t, e) {
- this.nextBtn.x = t,
- this.nextBtn.y = e
- }
- ,
- GD.Tutorial.prototype.setCloseButtonPos = function(t, e) {
- this.closeBtn.x = t,
- this.closeBtn.y = e
- }
- ,
- GD.Tutorial.prototype.setTutorialImg = function() {
- this.img = this.setSpriteTexture(this.img, "texture", this.tutorialImg + (this.nowPage + 1))
- }
- ,
- GD.Tutorial.prototype.setContent = function() {
- this.container.removeChildren();
- var t = this.contents[this.nowPage];
- t.init && t.init(),
- this.container.addChild(t)
- }
- ,
- GD.Tutorial.prototype.setButtons = function() {
- this.totalPage > 0 && (0 == this.nowPage ? (this.prevBtn.alpha = .3,
- this.nextBtn.alpha = 1,
- this.prevBtn.interactive = !1,
- this.nextBtn.interactive = !0) : this.nowPage + 1 == this.totalPage ? (this.prevBtn.alpha = 1,
- this.nextBtn.alpha = .3,
- this.prevBtn.interactive = !0,
- this.nextBtn.interactive = !1) : (this.prevBtn.alpha = 1,
- this.nextBtn.alpha = 1,
- this.prevBtn.interactive = !0,
- this.nextBtn.interactive = !0))
- }
- ,
- GD.Tutorial.prototype.setInteractive = function(t) {
- this.prevBtn.interactive = t,
- this.nextBtn.interactive = t,
- this.closeBtn.interactive = t
- }
- ,
- GD.Tutorial.prototype.removeChild = function() {
- this.setInteractive(!1),
- this.container.removeChildren(),
- this.removeChildren()
- }
- ,
- GD.Tutorial.getInstance = function() {
- return GD.tutorial || (GD.tutorial = new GD.Tutorial),
- GD.tutorial
- }
- }
- ]);
- module.exports.GD = GD;
- var {pixelRatio, windowWidth, windowHeight} = wx.getSystemInfoSync()
- var gWidth = windowWidth * pixelRatio
- var gHeight = windowHeight * pixelRatio
- var gc = {
- loader:null,
- stats:null,
- width:gWidth,
- height:gHeight,
- stage:null,
- intro:null,
- tutorial:null,
- game:null
- };
- gc.MovieClip = function(fileName, start, end, speed, repeat) {
- PIXI.extras.AnimatedSprite.call(this, this.getRepeatTexture(fileName, start, end, repeat));
- this.animationSpeed = speed;
- this.play();
- };
- gc.MovieClip.constructor = gc.MovieClip;
- gc.MovieClip.prototype = Object.create(PIXI.extras.AnimatedSprite.prototype);
- gc.MovieClip.prototype.setAnimation = function(fileName, start, end, speed, repeat){
- this.textures = this.getRepeatTexture(fileName, start, end, repeat);
- this.animationSpeed = speed;
- };
- gc.MovieClip.prototype.getRepeatTexture = function(fileName, start, end, repeat){
- var textures = [];
- var i = repeat || 1;
- while(i--){
- textures = textures.concat(this.getTexture(fileName, start, end));
- }
- return textures;
- };
- gc.MovieClip.prototype.getTexture = function(fileName, start, end){
- start = start || 1;
- var textures = [],
- i = end - start + 1,
- j = start;
- while(i--) {
- if(j < 10){textures.push(PIXI.Texture.fromFrame(fileName + '0' + j + '.png'));}
- else {textures.push(PIXI.Texture.fromFrame(fileName + j + '.png'));}
- j++;
- }
- return textures;
- };
- gc.MovieClip.prototype.updateTransform = function() {
- PIXI.extras.AnimatedSprite.prototype.updateTransform.call(this);
- };
- gc.NumberText = function(fileName, align, space, iconName, iconAlign, strLen) {
- this.CENTER = 'center';
- this.RIGHT = 'right';
- this.value = 0;
- this.isChange = false;
- this.list = [];
- this.tmpList = [];
- this.fileName = fileName;
- this.align = align;
- this.space = space;
- this.iconName = iconName;
- this.iconAlign = iconAlign;
- this.strLen = strLen;
- this.icon = null;
- PIXI.Container.call(this);
- this.container = new PIXI.Container();
- this.addChild(this.container);
- this.setValue(0);
- };
- gc.NumberText.constructor = gc.NumberText;
- gc.NumberText.prototype = Object.create(PIXI.Container.prototype);
- gc.NumberText.prototype.setValue = function(value){
- this.value = value;
- this.isChange = true;
- };
- gc.NumberText.prototype.getNumberSprite = function(num){
- var sprite, name = this.fileName + num + '.png';
- if(this.tmpList.length > 0){
- sprite = this.tmpList.shift();
- sprite.texture = PIXI.Texture.fromFrame(name);
- }else{
- sprite = PIXI.Sprite.fromFrame(name);
- }
- return sprite;
- };
- gc.NumberText.prototype.removeAll = function(){
- var txt, i = this.list.length;
- while(i--){
- txt = this.list.shift();
- this.tmpList.push(txt);
- }
- if(this.container) this.container.removeChildren();
- };
- gc.NumberText.prototype.updateTransform = function() {
- if(this.isChange){
- this.removeAll();
- var numStr = this.value.toString();
- if(this.strLen) numStr = Util.zeroStr(this.value, this.strLen);
- var index = 0, txt,
- space = 0,
- i = numStr.length;
- if(this.iconName){
- if(!this.icon) this.icon = PIXI.Sprite.fromFrame(this.iconName + '.png');
- this.container.addChild(this.icon);
- if(this.iconAlign == 'left'){
- space += this.icon.width + this.space;
- }
- }
- while(i--){
- txt = this.getNumberSprite(parseInt(numStr.substr(index, 1))+1);
- txt.x = space;
- space += txt.width + this.space;
- index++;
- this.container.addChild(txt);
- this.list[i] = txt;
- }
- if(this.iconAlign == 'right'){
- this.icon.x = space;
- space += this.icon.width + this.space;
- }
- if(this.align == this.CENTER){
- this.container.x = -space/2;
- }else if(this.align == this.RIGHT){
- this.container.x = -space;
- }
- this.isChange = false;
- }
- PIXI.Container.prototype.updateTransform.call(this);
- };
- gc.GameScene = function(){
- PIXI.Container.call(this);
- this.lastEventTime = undefined; //Time the click occurred
- //120
- this.cookieMatrixPos = [[75,550], [170,550], [265,550], [360,550], [455,550], [550,550], [645,550],
- [75,645], [170,645], [265,645], [360,645], [455,645], [550,645], [645,645],
- [75,740], [170,740], [265,740], [360,740], [455,740], [550,740], [645,740],
- [75,835], [170,835], [265,835], [360,835], [455,835], [550,835], [645,835],
- [75,935], [170,935], [265,935], [360,935], [455,935], [550,935], [645,935],
- [75,1030], [170,1030], [265,1030], [360,1030], [455,1030], [550,1030], [645,1030],
- [75,1125], [170,1125], [265,1125], [360,1125], [455,1125], [550,1125], [645,1125]];
- this.cookieNumMatrix = [];
- this.cookieMatrix = [];
- this.itemEffectMc = [];
- this.bombAnerge = 0;
- this.bombfull = 50;
- this.fixArr1 = [];
- this.fixArr2 = [];
- this.readytxt = true;
- this.starttxt = false;
- this.playGame = false;
- this.addPoint = 0;
- this.itemIndex = undefined;
- this.itemIndex1 = undefined;
- this.itemIndex2 = undefined;
- this.itemIndexes = [];
- this.canClick = false;
- this.hint = [];
- this.giveHint = false;
- this.bundle = [];
- this.prestageMode = 'normal';
- this.stageMode = 'normal';
- this.chance = 60;
- this.useItem = false;
- this.remembers = [];//Store cookies like items
- this.combo = 0;
- this.restComboTime = 0;
- this.lastTime = undefined;
- this.totalCombo = 0; //Combo 3 times or more .. Medal 1, Combo 100 times or more .. Medal 4
- this.champagneCombo = 0; //Champagne 10 times .. Medals 2
- this.bombCombo = 0; //Bomb item 10 times .. Medals 3
- this.getMedal1 = false;
- this.getMedal2 = false;
- this.getMedal3 = false;
- this.getMedal4 = false;
- this.callfevercnt = 0;
- this.lastEnd = false; //To prevent timeup if last fang
- this.bumpscale = 0.01;
- this.pauseMode = false;
- this.pauseTime = 0;
- this.exceptSound = false; //During mode change = To inform the fiver sound only once when using the item
- };
- gc.GameScene.constructor = gc.GameScene;
- gc.GameScene.prototype = Object.create(PIXI.Container.prototype);
- gc.GameScene.prototype.init = function() {
- this.readytxt = true;
- this.starttxt = false;
- this.declareObjects();
- this.setBG();
- this.readyGame();
- this.fever = setInterval(this.setFever.bind(this), 33.333);
- this.test = true;
- this.explode();
- this.stageMode = 'fever';
- this.actFever(); //Make a one-time call to resolve the bug in the first peer
- //Return to default mode
- this.stageMode = 'normal';
- this.normalMode();
- };
- //Create Object
- gc.GameScene.prototype.declareObjects = function () {
- this.bomb = new PIXI.Sprite.fromFrame('bomb_0001.png');
- this.bombgauge = new PIXI.Sprite.fromFrame('bomb_gauge_bar_0001.png');
- this.chanceImg= new gc.NumberText('score_num_', 'center', -4);
- this.readyBG = new PIXI.Sprite(GD.loader.resources['ready_bg'].texture);
- this.readyImg = new PIXI.Sprite.fromFrame('ready_0001.png');
- this.startImg = new PIXI.Sprite.fromFrame('start_0001.png');
- this.gameoverImg = new PIXI.Sprite.fromFrame('gameover.png');
- for(var i=0; i<this.cookieMatrixPos.length; i++) {
- this.cookieMatrix[i] = new PIXI.Sprite.fromFrame('cookie_0001.png');
- this.itemEffectMc[i] = new gc.MovieClip('item_effect_00', 1, 14, 0.2);
- }
- this.gameBG = new PIXI.Sprite(GD.loader.resources['game_bg'].texture);
- this.gameTable = new PIXI.Sprite(GD.loader.resources['game_table'].texture);
- this.shadow = new PIXI.Sprite(GD.loader.resources['shadow_bg'].texture);
- this.fevereffect1 = new gc.MovieClip('fever_effect_1_00', 1, 23, 0.3, true);
- this.fevereffect2 = new gc.MovieClip('fever_effect_2_00', 1, 29, 0.3, true);
- this.normalmomo = new gc.MovieClip('momo_normal_00', 1, 50, 0.3);
- this.fevermomo = new gc.MovieClip('momo_fever_00', 1, 43, 0.3);
- this.normalshushu = new gc.MovieClip('shushu_normal_00', 1, 12, 0.3);
- this.fevershushu = new gc.MovieClip('shushu_fever_00', 1, 17, 0.3);
- this.timeup = new PIXI.Sprite.fromFrame('momotime_0001.png');
- this.scoreTxt= new gc.NumberText('score_num_', 'center', -4);
- this.crossEffect1 = new PIXI.Sprite.fromFrame('line_clear_effect.png');
- this.crossEffect2 = new PIXI.Sprite.fromFrame('line_clear_effect.png');
- this.superfeverText = new PIXI.Sprite.fromFrame('super_fever_0001.png');
- this.feverText = new PIXI.Sprite.fromFrame('fever_0001.png');
- };
- //Game settings
- gc.GameScene.prototype.readyGame = function() {
- if(this.readytxt) {
- GD.soundPlay('sound_ready');
- this.readyBG.anchor.set(0.5);
- this.readyBG.position.x = GD.width / 2;
- this.readyBG.position.y = GD.height / 2;
- this.addChild(this.readyBG);
- this.readyImg.anchor.set(0.5);
- this.readyImg.position = this.readyBG.position;
- this.readyImg.scale.x = 0;
- this.readyImg.scale.y = 0;
- TweenMax.to(this.readyImg.scale, 0.8, {x:1, y:1});
- this.addChild(this.readyImg);
- this.readytxt = false;
- this.starttxt = true;
- setTimeout(this.startGame.bind(this), 1000);
- }
- };
- gc.GameScene.prototype.startGame = function() {
- if(this.starttxt){
- GD.soundPlay('sound_start');
- this.readyImg.visible = false;
- this.startImg.anchor.set(0.5);
- this.startImg.position = this.readyImg.position;
- this.startImg.scale.x = 0;
- this.startImg.scale.y = 0;
- TweenMax.to(this.startImg.scale, 0.5, {x:1.2, y:1.2});
- this.addChild(this.startImg);
- setTimeout(this.playStart.bind(this),600);
- }
- };
- gc.GameScene.prototype.setItemEffect = function () {
- for(var i=0; i<this.cookieMatrix.length; i++) this.cookieMatrix[i].removeChild(this.itemEffectMc[i]);
- for(var i=0; i<this.cookieMatrixPos.length; i++){
- this.itemEffectMc[i].anchor.set(0.5);
- this.itemEffectMc[i].stop();
- this.itemEffectMc[i].alpha = 0;
- this.cookieMatrix[i].addChild(this.itemEffectMc[i]);
- }
- };
- gc.GameScene.prototype.playStart = function(){
- this.removeChild(this.readyImg);
- this.removeChild(this.startImg);
- this.readyBG.visible = false;
- this.setCookies();
- };
- gc.GameScene.prototype.setBG = function() {
- this.gameTable.position.y = 470;
- this.addChild(this.gameBG);
- this.setFeverEffect2();
- this.setMomo();
- this.setShushu();
- this.gameBG.addChild(this.gameTable);
- this.setBomb();
- this.setChance();
- this.makeShadow();
- this.setScore();
- this.setFeverEffect1();
- };
- gc.GameScene.prototype.makeShadow = function () {
- this.shadowContainer.addChild(this.shadow);
- this.shadow.alpha = 0;
- };
- gc.GameScene.prototype.setFeverEffect1 = function() {
- this.fevereffect1.anchor.set(0.5);
- this.fevereffect1.position.x = gc.width/2;
- this.fevereffect1.position.y = 600;
- this.addChild(this.fevereffect1);
- this.fevereffect1.alpha = 0;
- };
- gc.GameScene.prototype.setFeverEffect2 = function() {
- this.fevereffect2.anchor.set(0.5);
- this.fevereffect2.position.x = gc.width/2;
- this.fevereffect2.position.y = 288.5;
- this.gameBG.addChild(this.fevereffect2);
- this.fevereffect2.alpha = 0;
- };
- gc.GameScene.prototype.setMomo = function() {
- this.normalmomo.position.x = gc.width / 2;
- this.normalmomo.position.y = 220;
- this.gameBG.addChild(this.normalmomo);
- this.fevermomo.position.x = this.normalmomo.x;
- this.fevermomo.position.y = this.normalmomo.y;
- this.fevermomo.alpha = 0;
- this.fevermomo.stop();
- this.gameBG.addChild(this.fevermomo);
- };
- gc.GameScene.prototype.setShushu = function() {
- this.normalshushu.position.x = gc.width / 4;
- this.normalshushu.position.y = 300;
- this.gameBG.addChild(this.normalshushu);
- this.fevershushu.position.x = this.normalshushu.x;
- this.fevershushu.position.y = this.normalshushu.y;
- this.fevershushu.alpha = 0;
- this.fevershushu.stop();
- this.gameBG.addChild(this.fevershushu);
- };
- gc.GameScene.prototype.normalMode = function () {
- console.log('normal');
- this.fevermomo.alpha = 0;
- this.fevermomo.stop();
- this.normalmomo.alpha = 1;
- this.normalmomo.play();
- this.fevershushu.alpha = 0;
- this.fevershushu.stop();
- this.normalshushu.alpha = 1;
- this.normalshushu.play();
- };
- gc.GameScene.prototype.otherMode = function () {
- console.log('other');
- this.normalmomo.alpha = 0;
- this.normalmomo.stop();
- this.fevermomo.alpha = 1;
- this.fevermomo.play();
- this.normalshushu.alpha = 0;
- this.normalshushu.stop();
- this.fevershushu.alpha = 1;
- this.fevershushu.play();
- };
- gc.GameScene.prototype.setChance = function () {
- if(this.explodeContainer == undefined) {
- this.explodeContainer = new PIXI.Container();
- this.explodeContainer.position = this.gameBG.position;
- this.explodeContainer.width = this.gameBG.width;
- this.explodeContainer.height = this.gameBG.height;
- this.addChild(this.explodeContainer);
- }
- this.shadowContainer = new PIXI.Container();
- this.addChild(this.shadowContainer);
- if(this.explodeContainer2 == undefined) {
- this.explodeContainer2 = new PIXI.Container();
- this.explodeContainer2.position = this.gameBG.position;
- this.explodeContainer2.width = this.gameBG.width;
- this.explodeContainer2.height = this.gameBG.height;
- this.addChild(this.explodeContainer2);
- }
- this.chanceImg.x = 55;
- this.chanceImg.y = 45;
- this.chanceImg.scale.x = 0.8;
- this.chanceImg.scale.y = 0.8;
- this.rangeChance();
- };
- //남은 기회 표시
- gc.GameScene.prototype.rangeChance = function () {
- this.chanceImg.setValue(this.chance);
- };
- //라스트팡(남은 아이템 클리어)=======================================================================================
- gc.GameScene.prototype.lastPang = function () {
- this.lastEnd = true;
- this.itemOver = false;
- this.scanIndex = undefined;
- this.useItem = false;
- var count = 0;
- for(var i=0; i<this.cookieNumMatrix.length; i++){
- if(this.cookieNumMatrix[i] > 6){
- this.scanIndex = i;
- this.useItem = true;
- if (this.cookieNumMatrix[i] == 10) {this.actBomb(i);}
- else if (this.cookieNumMatrix[i] == 9) {this.actEqual(i);}
- else if (this.cookieNumMatrix[i] == 8) {
- this.crossIndex = i;
- this.actCross(i);
- }
- break;
- } else {count++;}
- }
- if(count == this.cookieNumMatrix.length) {
- this.itemOver = true;
- this.checkMatching3();
- }
- };
- //게임오버===========================================================================================================
- gc.GameScene.prototype.setGameOver = function(){
- this.canClick = false;
- this.playGame = false;
- this.checkLeftItem();
- if(this.lastEnd) {
- this.timeup.anchor.set(0.5);
- this.timeup.position.x = this.gameBG.width / 2;
- this.timeup.position.y = GD.height/2+50;
- this.timeup.scale.x = 0;
- this.timeup.scale.y = 0;
- this.addChild(this.timeup);
- GD.soundPlay('sound_momotime');
- this.canClick = false;
- this.removeChild(this.hintMc1);
- this.removeChild(this.hintMc2);
- if (this.real1 != undefined) {this.real1.alpha = 1;}
- if (this.real2 != undefined) {this.real2.alpha = 1;}
- this.reachmax = false;
- this.incdgree = 0.15;
- this.stageMode = 'momotime';
- this.playGame = false;
- this.otherMode();
- this.actfeverEffect();
- this.momotime = setInterval(this.showMomoTime.bind(this), 33.333);
- }
- else {//아이템이 없으면 모모타임 이미지, 소리 없이 끝내기
- this.lastPang();
- }
- };
- gc.GameScene.prototype.checkLeftItem = function () {
- this.lastEnd = false;
- for(var i=0; i<this.cookieNumMatrix.length; i++){
- if(this.cookieNumMatrix[i]>7) {
- this.lastEnd = true;
- }
- }
- };
- gc.GameScene.prototype.showMomoTime = function () {
- if(this.reachmax && this.timeup.scale.x <= 1) {
- this.incdgree = 0;
- setTimeout(this.delay.bind(this), 1000);
- clearInterval(this.momotime);
- }
- if(this.timeup.scale.x >= 1.3){
- this.incdgree *= -1;
- this.reachmax = true;
- }
- this.timeup.scale.x += this.incdgree;
- this.timeup.scale.y += this.incdgree;
- };
- gc.GameScene.prototype.delay = function () {
- this.dropmomotime = setInterval(this.dropMomoTime.bind(this),33.333);
- };
- gc.GameScene.prototype.dropMomoTime = function () {
- this.timeup.scale.y = 1.2;
- this.timeup.position.y += 70;
- if(this.timeup.position.y >= gc.height+this.timeup.height){
- this.removeChild(this.timeup);
- //모모타임이 되고 나서 제일 첫 lastpang
- this.lastPang();
- clearInterval(this.dropmomotime);
- }
- };
- gc.GameScene.prototype.setScore = function(){
- this.scoreTxt.x = 355;
- this.scoreTxt.y = 45;
- this.scoreTxt.scale.x = 0.8;
- this.scoreTxt.scale.y = 0.8;
- this.score = 0;
- this.scoreTxt.setValue(this.score);
- this.shadowContainer.addChild(this.chanceImg);
- this.shadowContainer.addChild(this.scoreTxt);
- };
- gc.GameScene.prototype.setBomb = function() {
- this.bomb.anchor.set(0.5);
- this.bomb.x = 69;
- this.bomb.y = 211;
- //this.bomb.alpha = 0;
- this.bombgauge.anchor.x = 0.5;
- this.bombgauge.anchor.y = 1;
- this.bombgauge.position.x = 69;
- this.bombgauge.position.y = 448;
- this.addChild(this.bombgauge);
- this.addChild(this.bomb);
- };
- gc.GameScene.prototype.setCookies = function() {
- for(var i=0; i<this.cookieMatrixPos.length; i++){
- if(this.cookieNumMatrix[i] < 7 || this.cookieNumMatrix[i] == undefined) {
- this.cookieNumMatrix[i] = parseInt(Math.random() * 6 + 1);
- }
- }
- if(this.checkMatching1()){
- this.setCookies();
- }else{ //맞는게 없을 때
- for(var i=0; i<this.cookieNumMatrix.length; i++) {
- this.drawCookie(this.cookieNumMatrix[i], i);
- }
- this.giveHint = false;
- if(this.playGame) this.findHint();
- }
- };
- gc.GameScene.prototype.drawCookie = function (cookieNum, index) {
- switch (cookieNum) {
- case 1:
- this.cookieMatrix[index].texture = PIXI.Texture.fromFrame('cookie_0001.png');
- break;
- case 2:
- this.cookieMatrix[index].texture = PIXI.Texture.fromFrame('cookie_0002.png');
- break;
- case 3:
- this.cookieMatrix[index].texture = PIXI.Texture.fromFrame('cookie_0003.png');
- break;
- case 4:
- this.cookieMatrix[index].texture = PIXI.Texture.fromFrame('cookie_0004.png');
- break;
- case 5:
- this.cookieMatrix[index].texture = PIXI.Texture.fromFrame('cookie_0005.png');
- break;
- case 6:
- this.cookieMatrix[index].texture = PIXI.Texture.fromFrame('cookie_0006.png');
- break;
- default :
- this.cookieMatrix[index].texture = this.cookieMatrix[index].texture;
- }
- this.cookieMatrix[index].anchor.set(0.5);
- this.cookieMatrix[index].scale.x = 0.85;
- this.cookieMatrix[index].scale.y = 0.85;
- this.cookieMatrix[index].position.x = this.cookieMatrixPos[index][0];
- this.cookieMatrix[index].position.y = this.cookieMatrixPos[index][1];
- if(this.cookieNumMatrix[index] < 7) TweenMax.from(this.cookieMatrix[index], 0.1, {y:this.cookieMatrixPos[index][1]-30});
- this.cookieMatrix[index].flag = 1;
- if(this.cookieNumMatrix[index] != 9) this.cookieMatrix[index].remember = 0; //Equal아이템이 나왔을 때 없앨 번호 기억을 위함
- this.cookieMatrix[index].buttonMode = true;
- this.cookieMatrix[index].interactive = true;
- if(!gc.IS_MOBILE)
- {
- this.cookieMatrix[index].mousedown = this.cookieMatrix[index].touchstart = (function(e){
- e.stopPropagation();
- this.getTouchStartPosition(index);
- }).bind(this);
- this.cookieMatrix[index].mouseupoutside = this.cookieMatrix[index].touchendoutside = (function(e){
- e.stopPropagation();
- this.getTouchEndPosition(index);
- }).bind(this);
- }
- else
- {
- this.cookieMatrix[index].touchstart = (function(e){
- e.stopPropagation();
- if(gc.IS_MOBILE) {
- this.previousX = e.data.getLocalPosition(this.parent).x;
- this.previousY = e.data.getLocalPosition(this.parent).y;
- }
- this.getTouchStartPosition(index);
- }).bind(this);
- this.cookieMatrix[index].touchendoutside = (function(e){
- e.stopPropagation();
- if(gc.IS_MOBILE) {
- this.currentX = e.data.getLocalPosition(this.parent).x;
- this.currentY = e.data.getLocalPosition(this.parent).y;
- }
- this.getTouchEndPosition(index);
- }).bind(this);
- }
- this.gameBG.addChild(this.cookieMatrix[index]);
- if(index == 48){
- this.playGame = true;
- this.canClick = true;
- if(this.lastEventTime == undefined) this.lastEventTime = Date.now();
- if(this.sethint == undefined) this.sethint = setInterval(this.setHint.bind(this), 33.333);
- if(this.bum == undefined) this.bum = setInterval(this.bump.bind(this), 33.333);
- this.setItemEffect();
- this.setFeverText();
- //맞출 블럭이 없어 새로 그려졌을 때 아이템 강조 이펙트 작동을 위함
- this.stopItemAccentEffect();
- this.playItemAccentEffect();
- }
- };
- //힌트==========================================================================================
- gc.GameScene.prototype.setHint = function () {
- var now = Date.now();
- if(!this.pauseMode) {
- if(this.pauseTime != 0){
- this.lastEventTime += Math.abs(now - this.pauseTime);
- this.pauseTime = 0;
- }
- if (Math.abs(this.lastEventTime - now) / 1000 >= 5) {
- if (!this.giveHint && this.playGame) this.showHint();
- }
- }else{
- if(this.pauseTime == 0) this.pauseTime = now;
- }
- };
- gc.GameScene.prototype.findHint = function () {
- var temp = undefined;
- var index = undefined;
- var check1 = undefined;
- var check2 = undefined;
- this.hint = [];
- //오른쪽 맨 끝 열은 체크안해도 됨
- for(var i=0; i<6; i++){
- for(var j=0; j<7; j++){
- index = i + j*7;
- temp = this.cookieNumMatrix[index];
- this.cookieNumMatrix[index] = this.cookieNumMatrix[index+1];
- this.cookieNumMatrix[index+1] = temp;
- check1 = this.checkMatching1();
- this.cookieNumMatrix[index+1] = this.cookieNumMatrix[index];
- this.cookieNumMatrix[index] = temp;
- if(check1) this.hint.push([index, index+1]);
- }
- }
- //맨 아래 행은 체크 안해도 됨
- for(var i=0; i<7; i++){
- for(var j=0; j<6; j++){
- index = i+ j*7;
- temp = this.cookieNumMatrix[index];
- this.cookieNumMatrix[index] = this.cookieNumMatrix[index+7];
- this.cookieNumMatrix[index+7] = temp;
- check2 = this.checkMatching1();
- this.cookieNumMatrix[index+7] = this.cookieNumMatrix[index];
- this.cookieNumMatrix[index] = temp;
- if(check2) this.hint.push([index, index+7]);
- }
- }
- //맞춰지는 블럭 없을 때 다시 그리기
- if(this.hint.length == 0){
- for(var i=0; i<this.cookieMatrix.length; i++){
- if(this.cookieNumMatrix[i]<7) this.gameBG.removeChild(this.cookieMatrix[i]);
- }
- this.setCookies();
- }
- };
- gc.GameScene.prototype.showHint = function(){
- this.giveHint = true;
- var texturename1, texturename2;
- var randHint = parseInt(Math.random() * this.hint.length);
- var texturenum1 = this.cookieNumMatrix[this.hint[randHint][0]];
- var texturenum2 = this.cookieNumMatrix[this.hint[randHint][1]];
- if(this.cookieNumMatrix[this.hint[randHint][0]] < 7) texturename1 = 'cookie_' + texturenum1 + '_00';
- if(this.cookieNumMatrix[this.hint[randHint][1]] < 7) texturename2 = 'cookie_' + texturenum2 + '_00';
- this.removeChild(this.hintMc1);
- this.removeChild(this.hintMc2);
- if(this.real1 != undefined) this.real1.alpha = 1;
- if(this.real2 != undefined) this.real2.alpha = 1;
- if(this.cookieNumMatrix[this.hint[randHint][0]] < 7) {
- this.hintMc1 = new gc.MovieClip(texturename1, 1, 8, 0.2);
- this.hintMc1.anchor.set(0.5);
- this.hintMc1.scale.x = 0.85;
- this.hintMc1.scale.y = 0.85;
- this.hintMc1.position.x = this.cookieMatrixPos[this.hint[randHint][0]][0];
- this.hintMc1.position.y = this.cookieMatrixPos[this.hint[randHint][0]][1]-12;
- this.addChild(this.hintMc1);
- this.real1 = this.cookieMatrix[this.hint[randHint][0]];
- this.real1.alpha = 0;
- }
- if(this.cookieNumMatrix[this.hint[randHint][1]] < 7) {
- this.hintMc2 = new gc.MovieClip(texturename2, 1, 8, 0.2);
- this.hintMc2.anchor.set(0.5);
- this.hintMc2.scale.x = 0.85;
- this.hintMc2.scale.y = 0.85;
- this.hintMc2.position.x = this.cookieMatrixPos[this.hint[randHint][1]][0];
- this.hintMc2.position.y = this.cookieMatrixPos[this.hint[randHint][1]][1]-12;
- this.addChild(this.hintMc2);
- this.real2 = this.cookieMatrix[this.hint[randHint][1]];
- this.real2.alpha = 0;
- }
- };
- //선택한 마우스 포인트 저장
- gc.GameScene.prototype.getTouchStartPosition = function(index) {
- if(!gc.IS_MOBILE){
- var e = window.event;
- this.previousX = e.clientX;
- this.previousY = e.clientY;
- }
- if(this.canClick && this.playGame) this.scanCookieNum(index);
- };
- //끝난 마우스 포인트 저장, 스와핑 방향 검사
- gc.GameScene.prototype.getTouchEndPosition = function(index) {
- if(!gc.IS_MOBILE){
- var e = window.event;
- this.currentX = e.clientX;
- this.currentY = e.clientY;
- }
- if(this.canClick && this.playGame) this.swap(index);
- };
- //클릭한 쿠키의 인덱스가 아이템인 겨우 아이템 작동
- gc.GameScene.prototype.scanCookieNum = function (index) {
- if(this.cookieNumMatrix[index]>6) {
- this.scanIndex = index;
- if(this.chance>0) {
- this.chance--;
- this.rangeChance();
- }
- this.useItem = true;
- this.lastEventTime = Date.now();
- this.giveHint = false;
- this.removeChild(this.hintMc1);
- this.removeChild(this.hintMc2);
- if(this.real1 != undefined) this.real1.alpha = 1;
- if(this.real2 != undefined) this.real2.alpha = 1;
- if (this.cookieNumMatrix[index] == 10) {
- if (this.canClick) this.actBomb(index);
- } else if (this.cookieNumMatrix[index] == 9) {
- if (this.canClick) this.actEqual(index);
- } else if (this.cookieNumMatrix[index] == 8) {
- this.crossIndex = index;
- if (this.canClick) this.actCross(index);
- }
- this.combo++;
- this.totalCombo++;
- if(this.combo>=15) {this.stageMode = 'superfever';}
- else if(this.combo>=5){
- this.stageMode = 'fever';
- this.callfevercnt = 0;
- } else{this.stageMode = 'normal';}
- this.lastTime = Date.now();
- this.restComboTime = 3;
- this.canClick = false;
- }else this.useItem = false;
- };
- //스와핑==================================================================================
- gc.GameScene.prototype.swap = function(clickIndex){
- var gapX = this.currentX - this.previousX;
- var gapY = this.currentY - this.previousY;
- //힌트 movieclip삭제
- this.removeChild(this.hintMc1);
- this.removeChild(this.hintMc2);
- //힌트애니메이션동안 안보였던 원래 텍스쳐 보이게 하기
- if(this.real1 != undefined) this.real1.alpha = 1;
- if(this.real2 != undefined) this.real2.alpha = 1;
- //왼쪽 쿠키랑 바꾸기
- if((gapX<0) && (Math.abs(gapX)>Math.abs(gapY))){
- if(clickIndex%7 != 0){
- this.lastEventTime = Date.now();
- this.canClick = false;
- this.swapLeft(clickIndex);
- return;
- }
- }
- //오른쪽
- if((gapX>0) && (Math.abs(gapX)>Math.abs(gapY))){
- if((clickIndex%7) != 6 || (clickIndex==0)){
- this.lastEventTime = Date.now();
- this.canClick = false;
- this.swapRight(clickIndex);
- return;
- }
- }
- //위쪽
- if((gapY<0) && (Math.abs(gapX)<Math.abs(gapY))){
- if(clickIndex > 6){
- this.lastEventTime = Date.now();
- this.canClick = false;
- this.swapUp(clickIndex);
- return;
- }
- }
- //아래쪽
- if((gapY>0) && (Math.abs(gapX)<Math.abs(gapY))){
- if(clickIndex < 42){
- this.lastEventTime = Date.now();
- this.canClick = false;
- this.swapDown(clickIndex);
- }
- }
- };
- gc.GameScene.prototype.swapLeft = function (selectIndex) {
- var tempTexture1, tempTexture2;
- var tempRemember;
- //텍스쳐 저장
- tempTexture1 = this.cookieMatrix[selectIndex].texture;
- tempTexture2 = this.cookieMatrix[selectIndex-1].texture;
- //매칭 확인을 위해 쿠키 번호 바꾸기
- var tempNum = this.cookieNumMatrix[selectIndex];
- this.cookieNumMatrix[selectIndex] = this.cookieNumMatrix[selectIndex-1];
- this.cookieNumMatrix[selectIndex-1] = tempNum;
- //매칭 확인
- this.checkMatching2(selectIndex);
- this.fixArr1 = this.memories;
- this.itemIndex1 = this.itemIndex;
- this.checkMatching2(selectIndex-1);
- this.fixArr2 = this.memories;
- this.itemIndex2 = this.itemIndex;
- //맞는게 없을 때
- if((this.fixArr1.length == 0) && (this.fixArr2.length == 0)){
- //쿠키 번호 복구
- tempNum = this.cookieNumMatrix[selectIndex];
- this.cookieNumMatrix[selectIndex] = this.cookieNumMatrix[selectIndex-1];
- this.cookieNumMatrix[selectIndex-1] = tempNum;
- this.cookieMatrix[selectIndex].texture = tempTexture2;
- this.cookieMatrix[selectIndex-1].texture = tempTexture1;
- TweenMax.from(this.cookieMatrix[selectIndex], 0.1, {x:this.cookieMatrixPos[selectIndex-1][0], onComplete: (function () {
- this.cookieMatrix[selectIndex].texture = tempTexture1;
- TweenMax.from(this.cookieMatrix[selectIndex], 0.1, {x:this.cookieMatrixPos[selectIndex-1][0]});
- }.bind(this))});
- TweenMax.from(this.cookieMatrix[selectIndex-1], 0.1, {x:this.cookieMatrixPos[selectIndex][0], onComplete:(function () {
- this.cookieMatrix[selectIndex-1].texture = tempTexture2;
- TweenMax.from(this.cookieMatrix[selectIndex-1], 0.1, {x:this.cookieMatrixPos[selectIndex][0], onComplete:(function(){
- this.canClick = true;
- }.bind(this))});
- }.bind(this))});
- this.lastEventTime = Date.now();
- this.giveHint = false;
- } else {//맞춰졌을 때
- this.chance--;
- if(this.fixArr1.length != 0) {
- this.combo++;
- this.totalCombo++;
- }
- if(this.fixArr2.length != 0) {
- this.combo++;
- this.totalCombo++;
- }
- if(this.combo>=15) {this.stageMode = 'superfever';}
- else if(this.combo>=5){
- this.stageMode = 'fever';
- this.callfevercnt = 0;
- } else{this.stageMode = 'normal';}
- this.lastTime = Date.now();
- this.restComboTime = 3;
- this.rangeChance();
- //스와핑 효과 보이기
- this.cookieMatrix[selectIndex].texture = tempTexture2;
- this.cookieMatrix[selectIndex - 1].texture = tempTexture1;
- TweenMax.from(this.cookieMatrix[selectIndex], 0.1, {x: this.cookieMatrixPos[selectIndex - 1][0], onComplete:(function () {
- for(var i=0; i<this.fixArr1.length; i++) this.cookieMatrix[this.fixArr1[i]].alpha = 0;
- }.bind(this))});
- TweenMax.from(this.cookieMatrix[selectIndex - 1], 0.1, {x: this.cookieMatrixPos[selectIndex][0], onComplete:(function () {
- for(var i=0; i<this.fixArr2.length; i++) this.cookieMatrix[this.fixArr2[i]].alpha = 0;
- }.bind(this))});
- //remember값 교환
- tempRemember = this.cookieMatrix[selectIndex].remember;
- this.cookieMatrix[selectIndex].remember = this.cookieMatrix[selectIndex-1].remember;
- this.cookieMatrix[selectIndex-1].remember = tempRemember;
- //경우에 상관없이 explode() 실행.. 객체 의미 없음
- TweenMax.from(this.cookieMatrix[selectIndex], 0.1, {onComplete:(function () {
- this.explode();
- }.bind(this))});
- }
- };
- gc.GameScene.prototype.swapRight = function (selectIndex) {
- var tempTexture1, tempTexture2;
- var tempRemember;
- //텍스쳐 저장
- tempTexture1 = this.cookieMatrix[selectIndex].texture;
- tempTexture2 = this.cookieMatrix[selectIndex+1].texture;
- //매칭 확인을 위해 쿠키 번호 바꾸기
- var tempNum = this.cookieNumMatrix[selectIndex];
- this.cookieNumMatrix[selectIndex] = this.cookieNumMatrix[selectIndex+1];
- this.cookieNumMatrix[selectIndex+1] = tempNum;
- //매칭 확인
- this.checkMatching2(selectIndex);
- this.fixArr1 = this.memories;
- this.itemIndex1 = this.itemIndex;
- this.checkMatching2(selectIndex+1);
- this.fixArr2 = this.memories;
- this.itemIndex2 = this.itemIndex;
- //맞는게 없을 때
- if((this.fixArr1.length == 0) && (this.fixArr2.length == 0)) {
- //쿠키 번호 복구
- tempNum = this.cookieNumMatrix[selectIndex];
- this.cookieNumMatrix[selectIndex] = this.cookieNumMatrix[selectIndex + 1];
- this.cookieNumMatrix[selectIndex + 1] = tempNum;
- this.cookieMatrix[selectIndex].texture = tempTexture2;
- this.cookieMatrix[selectIndex+1].texture = tempTexture1;
- TweenMax.from(this.cookieMatrix[selectIndex], 0.1, {x:this.cookieMatrixPos[selectIndex+1][0], onComplete: (function () {
- this.cookieMatrix[selectIndex].texture = tempTexture1;
- TweenMax.from(this.cookieMatrix[selectIndex], 0.1, {x:this.cookieMatrixPos[selectIndex+1][0]});
- }.bind(this))});
- TweenMax.from(this.cookieMatrix[selectIndex+1], 0.1, {x:this.cookieMatrixPos[selectIndex][0], onComplete:(function () {
- this.cookieMatrix[selectIndex+1].texture = tempTexture2;
- TweenMax.from(this.cookieMatrix[selectIndex+1], 0.1, {x:this.cookieMatrixPos[selectIndex][0], onComplete:(function(){
- this.canClick = true;
- }.bind(this))});
- }.bind(this))});
- this.lastEventTime = Date.now();
- this.giveHint = false;
- } else{//맞춰졌을 때
- this.chance--;
- if(this.fixArr1.length != 0) {
- this.combo++;
- this.totalCombo++;
- }
- if(this.fixArr2.length != 0) {
- this.combo++;
- this.totalCombo++;
- }
- if(this.combo>=15) {this.stageMode = 'superfever';}
- else if(this.combo>=5){
- this.stageMode = 'fever';
- this.callfevercnt = 0;
- } else{this.stageMode = 'normal';}
- this.lastTime = Date.now();
- this.restComboTime = 3;
- this.rangeChance();
- this.cookieMatrix[selectIndex].texture = tempTexture2;
- this.cookieMatrix[selectIndex + 1].texture = tempTexture1;
- TweenMax.from(this.cookieMatrix[selectIndex], 0.1, {x: this.cookieMatrixPos[selectIndex + 1][0], onComplete:(function () {
- for(var i=0; i<this.fixArr1.length; i++) this.cookieMatrix[this.fixArr1[i]].alpha = 0;
- }.bind(this))});
- TweenMax.from(this.cookieMatrix[selectIndex + 1], 0.1, {x: this.cookieMatrixPos[selectIndex][0], onComplete:(function () {
- for(var i=0; i<this.fixArr2.length; i++) this.cookieMatrix[this.fixArr2[i]].alpha = 0;
- }.bind(this))});
- //remember값 교환
- tempRemember = this.cookieMatrix[selectIndex].remember;
- this.cookieMatrix[selectIndex].remember = this.cookieMatrix[selectIndex+1].remember;
- this.cookieMatrix[selectIndex+1].remember = tempRemember;
- //경우에 상관없이 explode() 실행.. 객체 의미 없음
- TweenMax.from(this.cookieMatrix[selectIndex], 0.1, {onComplete:(function () {
- this.explode();
- }.bind(this))});
- }
- };
- gc.GameScene.prototype.swapUp = function (selectIndex) {
- var tempTexture1, tempTexture2;
- var tempRemember;
- //텍스쳐 저장
- tempTexture1 = this.cookieMatrix[selectIndex].texture;
- tempTexture2 = this.cookieMatrix[selectIndex-7].texture;
- //매칭 확인을 위해 쿠키 번호 바꾸기
- var tempNum = this.cookieNumMatrix[selectIndex];
- this.cookieNumMatrix[selectIndex] = this.cookieNumMatrix[selectIndex-7];
- this.cookieNumMatrix[selectIndex-7] = tempNum;
- //매칭 확인
- this.checkMatching2(selectIndex);
- this.fixArr1 = this.memories;
- this.itemIndex1 = this.itemIndex;
- this.checkMatching2(selectIndex-7);
- this.fixArr2 = this.memories;
- this.itemIndex2 = this.itemIndex;
- //맞는게 없을 때
- if((this.fixArr1.length == 0) && (this.fixArr2.length == 0)) {
- //쿠키 번호 복구
- tempNum = this.cookieNumMatrix[selectIndex];
- this.cookieNumMatrix[selectIndex] = this.cookieNumMatrix[selectIndex - 7];
- this.cookieNumMatrix[selectIndex - 7] = tempNum;
- this.cookieMatrix[selectIndex].texture = tempTexture2;
- this.cookieMatrix[selectIndex-7].texture = tempTexture1;
- TweenMax.from(this.cookieMatrix[selectIndex], 0.1, {y:this.cookieMatrixPos[selectIndex-7][1], onComplete: (function () {
- this.cookieMatrix[selectIndex].texture = tempTexture1;
- TweenMax.from(this.cookieMatrix[selectIndex], 0.1, {y:this.cookieMatrixPos[selectIndex-7][1]});
- }.bind(this))});
- TweenMax.from(this.cookieMatrix[selectIndex-7], 0.1, {y:this.cookieMatrixPos[selectIndex][1], onComplete:(function () {
- this.cookieMatrix[selectIndex-7].texture = tempTexture2;
- TweenMax.from(this.cookieMatrix[selectIndex-7], 0.1, {y:this.cookieMatrixPos[selectIndex][1], onComplete:(function(){
- this.canClick = true;
- }.bind(this))});
- }.bind(this))});
- this.lastEventTime = Date.now();
- this.giveHint = false;
- } else{//맞춰졌을 때
- this.chance--;
- if(this.fixArr1.length != 0) {
- this.combo++;
- this.totalCombo++;
- }
- if(this.fixArr2.length != 0) {
- this.combo++;
- this.totalCombo++;
- }
- if(this.combo>=15) {this.stageMode = 'superfever';}
- else if(this.combo>=5){
- this.stageMode = 'fever';
- this.callfevercnt = 0;
- } else{this.stageMode = 'normal';}
- this.lastTime = Date.now();
- this.restComboTime = 3;
- this.rangeChance();
- this.cookieMatrix[selectIndex].texture = tempTexture2;
- this.cookieMatrix[selectIndex-7].texture = tempTexture1;
- TweenMax.from(this.cookieMatrix[selectIndex], 0.1, {y:this.cookieMatrixPos[selectIndex-7][1], onComplete:(function () {
- for(var i=0; i<this.fixArr1.length; i++) this.cookieMatrix[this.fixArr1[i]].alpha = 0;
- }.bind(this))});
- TweenMax.from(this.cookieMatrix[selectIndex-7], 0.1, {y:this.cookieMatrixPos[selectIndex][1], onComplete:(function () {
- for(var i=0; i<this.fixArr2.length; i++) this.cookieMatrix[this.fixArr2[i]].alpha = 0;
- }.bind(this))});
- //remember값 교환
- tempRemember = this.cookieMatrix[selectIndex].remember;
- this.cookieMatrix[selectIndex].remember = this.cookieMatrix[selectIndex-7].remember;
- this.cookieMatrix[selectIndex-7].remember = tempRemember;
- //경우에 상관없이 explode() 실행.. 객체 의미 없음
- TweenMax.from(this.cookieMatrix[selectIndex], 0.1, {onComplete:(function () {
- this.explode();
- }.bind(this))});
- }
- };
- gc.GameScene.prototype.swapDown = function (selectIndex) {
- var tempTexture1, tempTexture2;
- var tempRemember;
- //텍스쳐 저장
- tempTexture1 = this.cookieMatrix[selectIndex].texture;
- tempTexture2 = this.cookieMatrix[selectIndex+7].texture;
- //매칭 확인을 위해 쿠키 번호 바꾸기
- var tempNum = this.cookieNumMatrix[selectIndex];
- this.cookieNumMatrix[selectIndex] = this.cookieNumMatrix[selectIndex+7];
- this.cookieNumMatrix[selectIndex+7] = tempNum;
- //매칭 확인
- this.checkMatching2(selectIndex);
- this.fixArr1 = this.memories;
- this.itemIndex1 = this.itemIndex;
- this.checkMatching2(selectIndex+7);
- this.fixArr2 = this.memories;
- this.itemIndex2 = this.itemIndex;
- //맞는게 없을 때
- if((this.fixArr1.length == 0) && (this.fixArr2.length == 0)) {
- //쿠키 번호 복구
- tempNum = this.cookieNumMatrix[selectIndex];
- this.cookieNumMatrix[selectIndex] = this.cookieNumMatrix[selectIndex + 7];
- this.cookieNumMatrix[selectIndex + 7] = tempNum;
- this.cookieMatrix[selectIndex].texture = tempTexture2;
- this.cookieMatrix[selectIndex+7].texture = tempTexture1;
- TweenMax.from(this.cookieMatrix[selectIndex], 0.1, {y:this.cookieMatrixPos[selectIndex+7][1], onComplete: (function () {
- this.cookieMatrix[selectIndex].texture = tempTexture1;
- TweenMax.from(this.cookieMatrix[selectIndex], 0.1, {y:this.cookieMatrixPos[selectIndex+7][1]});
- }.bind(this))});
- TweenMax.from(this.cookieMatrix[selectIndex+7], 0.1, {y:this.cookieMatrixPos[selectIndex][1], onComplete:(function () {
- this.cookieMatrix[selectIndex+7].texture = tempTexture2;
- TweenMax.from(this.cookieMatrix[selectIndex+7], 0.1, {y:this.cookieMatrixPos[selectIndex][1], onComplete:(function(){
- this.canClick = true;
- }.bind(this))});
- }.bind(this))});
- this.lastEventTime = Date.now();
- this.giveHint = false;
- } else{//맞춰졌을 때
- this.chance--;
- if(this.fixArr1.length != 0) {
- this.combo++;
- this.totalCombo++;
- }
- if(this.fixArr2.length != 0) {
- this.combo++;
- this.totalCombo++;
- }
- if(this.combo>=15) {this.stageMode = 'superfever';}
- else if(this.combo>=5){
- this.stageMode = 'fever';
- this.callfevercnt = 0;
- } else{this.stageMode = 'normal';}
- this.lastTime = Date.now();
- this.restComboTime = 3;
- this.rangeChance();
- this.cookieMatrix[selectIndex].texture = tempTexture2;
- this.cookieMatrix[selectIndex + 7].texture = tempTexture1;
- TweenMax.from(this.cookieMatrix[selectIndex], 0.1, {y: this.cookieMatrixPos[selectIndex + 7][1], onComplete:(function () {
- for(var i=0; i<this.fixArr1.length; i++) this.cookieMatrix[this.fixArr1[i]].alpha = 0;
- }.bind(this))});
- TweenMax.from(this.cookieMatrix[selectIndex + 7], 0.1, {y: this.cookieMatrixPos[selectIndex][1], onComplete:(function () {
- for(var i=0; i<this.fixArr2.length; i++) this.cookieMatrix[this.fixArr2[i]].alpha = 0;
- }.bind(this))});
- //remember값 교환
- tempRemember = this.cookieMatrix[selectIndex].remember;
- this.cookieMatrix[selectIndex].remember = this.cookieMatrix[selectIndex+7].remember;
- this.cookieMatrix[selectIndex+7].remember = tempRemember;
- //경우에 상관없이 explode() 실행.. 객체 의미 없음
- TweenMax.from(this.cookieMatrix[selectIndex], 0.1, {onComplete:(function () {
- this.explode();
- }.bind(this))});
- }
- };
- //폭발==============================================================================================
- //더이상 터질게 없을 때
- gc.GameScene.prototype.explode = function () {
- var makeBomb = false;
- var explodeEqual = false;
- var explodeBomb = false;
- this.explodetime = 0.3;
- //= 아이템 체크
- if(this.scanIndex != undefined) {
- if (this.cookieNumMatrix[this.scanIndex] == 9) {explodeEqual = true;}
- if (this.cookieNumMatrix[this.scanIndex] == 10) {explodeBomb = true;}
- }
- //크로스 아이템 이펙트
- if(this.crossIndex != undefined){
- this.crossEffect1.anchor.set(0.5);
- this.crossEffect1.position.x = this.cookieMatrixPos[this.crossIndex][0];
- this.crossEffect1.position.y = this.cookieMatrixPos[21][1];
- this.crossEffect1.height = 720;
- this.crossEffect2.anchor.set(0.5);
- this.crossEffect2.position.x = this.cookieMatrixPos[3][0];
- this.crossEffect2.position.y = this.cookieMatrixPos[this.crossIndex][1];
- this.crossEffect2.height = 720;
- this.crossEffect2.transform.rotation = Math.PI/2;
- var crossMc = new gc.MovieClip('eraser_effect_00', 1, 7, 0.3);
- crossMc.anchor.set(0.5);
- crossMc.position.x = this.cookieMatrixPos[this.crossIndex][0];
- crossMc.position.y = this.cookieMatrixPos[this.crossIndex][1];
- crossMc.loop = false;
- this.explodeContainer.addChild(this.crossEffect1);
- this.explodeContainer.addChild(this.crossEffect2);
- this.explodeContainer.addChild(crossMc);
- crossMc.onComplete = function () {
- gc.game.explodeContainer.removeChild(crossMc);
- };
- TweenMax.to(this.crossEffect1.scale, this.explodetime, {x:1, y:0.6, alpha:1});
- TweenMax.to(this.crossEffect2.scale, this.explodetime, {x:1, y:0.6, alpha:1});
- }
- if(explodeBomb){
- var bombMc = new gc.MovieClip('bomb_effect_00', 1, 9, 0.3);
- bombMc.anchor.set(0.5);
- bombMc.position.x = this.cookieMatrixPos[this.scanIndex][0];
- bombMc.position.y = this.cookieMatrixPos[this.scanIndex][1];
- bombMc.loop = false;
- this.explodeContainer.addChild(bombMc);
- }
- //기본 폭발 이미지.. 모든 폭발에 적용
- for(var i=0; i<this.cookieMatrix.length; i++){
- if(this.cookieMatrix[i].flag == 0){
- //폭탄아이템 생성 조건
- this.bombAnerge++;
- if(this.bombAnerge >= this.bombfull) {
- makeBomb = true;
- this.setBombItem();
- this.bombAnerge -= this.bombfull;
- }
- var explodeMc = new gc.MovieClip('clear_effect_00', 1, 9, 0.4);
- explodeMc.anchor.set(0.5);
- explodeMc.position.x = this.cookieMatrixPos[i][0];
- explodeMc.position.y = this.cookieMatrixPos[i][1];
- explodeMc.alpha = 1;
- explodeMc.loop = false;
- if(!explodeEqual) {this.explodeContainer.addChild(explodeMc);
- }else{this.explodeContainer2.addChild(explodeMc);}
- }
- }
- this.scanIndex = undefined;
- //mask 폭탄 게이지 보이는 화면
- var gap = this.bombgauge.height/this.bombfull;
- if(this.thing == undefined) {
- this.thing = new PIXI.Graphics();
- this.thing.position.x = 0;
- this.thing.position.y = 0;
- this.bombgauge.addChild(this.thing);
- this.bombgauge.mask = this.thing;
- this.thing.lineStyle(0);
- this.thing.clear();
- this.thing.beginFill(0xffffff, 1);
- this.maskRect = this.thing.drawRect(-14, -this.bombgauge.height+gap*(this.bombfull-this.bombAnerge), this.bombgauge.width, this.bombgauge.height, 10);
- this.thing.endFill();
- }
- //점수 부여
- for(var i=0; i<this.cookieMatrix.length; i++){
- if(this.cookieMatrix[i].flag == 0) {this.addScore(i)}
- }
- //폭발 사운드 처리
- if(!explodeEqual && !this.test)this.manageSound();
- this.settingItem();
- //점수 합산
- if(!this.test) DataManager.point('point', this.addPoint, Date.now().toString()); // 획득 점수 저장
- this.score += this.addPoint;
- this.addPoint = 0;
- this.scoreTxt.setValue(this.score);
- //터지는 이미지 시간 작용
- this.explodetime = 0.3;
- if(this.crossIndex != undefined) {this.crossIndex = undefined;}
- if(explodeEqual) {this.explodetime = 0.15*(this.remembers.length+2);}
- if(makeBomb) {
- //폭탄 생성 이펙트
- this.cookieMatrix[this.randBombIndex].alpha = 0;
- var fakebomb = new PIXI.Sprite.fromFrame('bomb_0002.png');
- fakebomb.anchor.set(0.5);
- fakebomb.x = this.bomb.x;
- fakebomb.y = this.bomb.y;
- this.addChild(fakebomb);
- this.restComboTime = 3;
- TweenMax.to(fakebomb.scale, 0.3, {x:1.3, y:1.3, onComplete:(function () {
- TweenMax.to(fakebomb.scale, 0.2, {x:1, y:1, onComplete:(function () {
- TweenMax.to(fakebomb, 1, {rotation:90, x:this.cookieMatrixPos[this.randBombIndex][0], y:this.cookieMatrixPos[this.randBombIndex][1], onComplete:(function () {
- this.removeChild(fakebomb);
- this.cookieMatrix[this.randBombIndex].alpha = 1;
- this.explodeOver();
- }).bind(this)},0);
- }).bind(this)});
- }).bind(this)});
- //TweenMax.to(fakebomb, 1.2, {rotation:90, x:this.cookieMatrixPos[this.randBombIndex][0], y:this.cookieMatrixPos[this.randBombIndex][1], onComplete:(function () {
- // this.removeChild(fakebomb);
- // this.cookieMatrix[this.randBombIndex].alpha = 1;
- // this.explodeOver();
- //}).bind(this)},0);
- this.bomb.texture = PIXI.Texture.fromFrame('bomb_0002.png');
- TweenMax.to(this.maskRect, 0.1, {y:-this.bombgauge.height, onComplete:(function () {
- TweenMax.to(this.maskRect, 0.1, {y:-this.bombgauge.height+gap*this.bombfull, onComplete:(function () {
- TweenMax.to(this.maskRect, 0.1, {y:-this.bombgauge.height+gap*(this.bombfull-this.bombAnerge), onComplete:(function () {
- this.bomb.texture = PIXI.Texture.fromFrame('bomb_0001.png');
- }).bind(this)});
- }).bind(this)});
- }).bind(this)});
- } else {
- TweenMax.to(this.maskRect, 0.1, {y:-this.bombgauge.height+gap*(this.bombfull-this.bombAnerge)});
- this.explodeOver();
- }
- //폭발 이미지 제거
- TweenMax.to(this.cookieMatrix[0], this.explodetime, {onComplete: (function() {
- this.explodeContainer.removeChildren();
- if(this.explodeContainer2 != undefined)this.explodeContainer2.removeChildren();
- }.bind(this))});
- //메달 획득 확인
- this.manageMedal();
- };
- //폭발 후 쿠키 떨어뜨리는 역할
- gc.GameScene.prototype.explodeOver = function () {
- //터질때 발생하는 작업 전체 종료 후 쿠키 떨구기
- TweenMax.to(this.cookieMatrix[0], this.explodetime, {onComplete: (function() {
- this.dropCookie();
- }.bind(this))});
- };
- //소리===================================================================================================
- gc.GameScene.prototype.manageSound = function () {
- if(this.prestageMode == this.stageMode){
- this.exceptSound = false;
- this.basicSound();
- }else{
- //모드 변화 시
- if(this.stageMode == 'superfever' || this.stageMode == 'fever') {
- if(!this.exceptSound) {this.exceptSound = true;}
- else{GD.soundPlay('sound_match_fever');}
- } else{
- //모모타임일 때
- if(this.stageMode == 'momotime') {this.momoSound();}
- else{this.basicSound();}//피버모드가 풀렸을 때
- }
- }
- };
- gc.GameScene.prototype.basicSound = function () {
- //기본 블럭 사운드
- if(!this.useItem){
- if (this.stageMode == 'normal') {
- if (this.combo == 1) GD.soundPlay('sound_match_1');
- else if (this.combo == 3)GD.soundPlay('sound_match_2');
- else GD.soundPlay('sound_match_3');
- } else {GD.soundPlay('sound_match_fever');}
- return;
- }else{
- //아이템 사운드
- GD.soundPlay('sound_use');
- this.useItem = false;
- return;
- }
- };
- gc.GameScene.prototype.momoSound = function () {
- //기본 블럭 사운드
- if(!this.useItem){
- if (this.prestageMode == 'normal') {
- if (this.combo == 1) GD.soundPlay('sound_match_1');
- else if (this.combo == 3) GD.soundPlay('sound_match_2');
- else GD.soundPlay('sound_match_3');
- } else {GD.soundPlay('sound_match_fever')};
- return;
- }else{
- //아이템 사운드
- GD.soundPlay('sound_use');
- this.useItem = false;
- return;
- }
- };
- //점수===================================================================================================
- gc.GameScene.prototype.addScore = function (i) {
- if(this.stageMode == 'normal') {this.normalPoint(i);}
- else if(this.stageMode == 'fever'){this.feverPoint(i);}
- else if(this.stageMode == 'superfever'){this.superfeverPoint(i);}
- else { //모모타임 점수
- if(this.prestageMode == 'normal'){this.normalPoint(i);}
- else if(this.prestageMode == 'fever'){this.feverPoint(i);}
- else if(this.prestageMode == 'superfever'){this.superfeverPoint(i);}
- }
- };
- gc.GameScene.prototype.normalPoint = function (i) {
- if(this.cookieNumMatrix[i]<7) {this.addPoint += 100;}
- else {
- if(this.cookieNumMatrix[i] == 10) {this.addPoint += 450;}
- if(this.cookieNumMatrix[i] == 9) {this.addPoint += 350;}
- if(this.cookieNumMatrix[i] == 8) {this.addPoint += 250;}
- }
- };
- gc.GameScene.prototype.feverPoint = function (i) {
- if(this.cookieNumMatrix[i]<7) {this.addPoint += 200;}
- else {
- if(this.cookieNumMatrix[i] == 10) {this.addPoint += 600;}
- if(this.cookieNumMatrix[i] == 9) {this.addPoint += 550;}
- if(this.cookieNumMatrix[i] == 8) {this.addPoint += 350;}
- }
- }
- gc.GameScene.prototype.superfeverPoint = function (i) {
- if(this.cookieNumMatrix[i]<7) {
- this.addPoint += 300;}
- else {
- if(this.cookieNumMatrix[i] == 10) {this.addPoint += 900;}
- if(this.cookieNumMatrix[i] == 9) {this.addPoint += 700;}
- if(this.cookieNumMatrix[i] == 8) {this.addPoint += 500;}
- }
- };
- //아이템====================================================================================
- gc.GameScene.prototype.settingItem = function(){
- if(this.itemIndex1 != undefined){
- if(this.fixArr1.length >=5){
- this.setEqualItem('origin');
- } else if(this.fixArr1.length >=4){
- this.setCrossItem('origin');
- }
- this.cookieMatrix[this.itemIndex1].alpha = 1;
- this.cookieMatrix[this.itemIndex1].flag = 1;
- this.itemIndex1 = undefined;
- }
- if(this.itemIndex2 != undefined){
- if(this.fixArr2.length >=5){
- this.setEqualItem('other');
- } else if(this.fixArr2.length >=4){
- this.setCrossItem('other');
- }
- this.cookieMatrix[this.itemIndex2].alpha = 1;
- this.cookieMatrix[this.itemIndex2].flag = 1;
- this.itemIndex2 = undefined;
- }
- };
- gc.GameScene.prototype.setBombItem = function(){
- this.randBombIndex = parseInt(Math.random()*14);
- if(this.cookieMatrix[this.randBombIndex].flag != 0 && this.cookieNumMatrix[this.randBombIndex] <7) {
- this.cookieMatrix[this.randBombIndex].texture = PIXI.Texture.fromFrame('bomb_item_0001.png');
- this.cookieNumMatrix[this.randBombIndex] = 10;
- this.matchItemSize(this.randBombIndex);
- }else this.setBombItem();
- };
- gc.GameScene.prototype.setEqualItem = function(thing){
- var itemName = 'cookie2_000';
- var fullItemName;
- switch (thing) {
- case 'origin':
- this.cookieMatrix[this.itemIndex1].remember = this.cookieNumMatrix[this.itemIndex1];
- fullItemName = itemName+this.cookieMatrix[this.itemIndex1].remember+'.png';
- this.cookieMatrix[this.itemIndex1].texture = PIXI.Texture.fromFrame(fullItemName);
- this.cookieNumMatrix[this.itemIndex1] = 9;
- this.matchItemSize(this.itemIndex1);
- break;
- case 'other':
- this.cookieMatrix[this.itemIndex2].remember = this.cookieNumMatrix[this.itemIndex2];
- fullItemName = itemName+this.cookieMatrix[this.itemIndex2].remember+'.png';
- this.cookieMatrix[this.itemIndex2].texture = PIXI.Texture.fromFrame(fullItemName);
- this.cookieNumMatrix[this.itemIndex2] = 9;
- this.matchItemSize(this.itemIndex2);
- break;
- }
- };
- gc.GameScene.prototype.setCrossItem = function(thing){
- switch (thing) {
- case 'origin':
- this.cookieMatrix[this.itemIndex1].texture = PIXI.Texture.fromFrame('eraser_0001.png');
- this.cookieNumMatrix[this.itemIndex1] = 8;
- this.matchItemSize(this.itemIndex1);
- break;
- case 'other':
- this.cookieMatrix[this.itemIndex2].texture = PIXI.Texture.fromFrame('eraser_0001.png');
- this.cookieNumMatrix[this.itemIndex2] = 8;
- this.matchItemSize(this.itemIndex2);
- break;
- }
- };
- gc.GameScene.prototype.matchItemSize = function (index) {
- var min = 2;
- var max = 0;
- for(var i=0; i<this.cookieMatrix.length; i++){
- if(this.cookieMatrix[i].scale.x < min){min = this.cookieMatrix[i].scale.x}
- }
- if(min == 0.85){
- for(var i=0; i<this.cookieMatrix.length; i++){
- if(this.cookieMatrix[i].scale.x > max){max = this.cookieMatrix[i].scale.x}
- }
- }
- if(min != 0.85) {
- this.cookieMatrix[index].scale.x = min;
- this.cookieMatrix[index].scale.y = min;
- }else {
- this.cookieMatrix[index].scale.x = max;
- this.cookieMatrix[index].scale.y = max;
- }
- this.getItemIndex();
- };
- gc.GameScene.prototype.bump = function () {
- if(this.itemIndexes.length > 0) {
- if(this.cookieMatrix[this.itemIndexes[0]].scale.x >= 1 || this.cookieMatrix[this.itemIndexes[0]].scale.x <= 0.85){
- if(this.cookieMatrix[this.itemIndexes[0]].scale.x > 1) this.cookieMatrix[this.itemIndexes[0]].scale.x = 1;
- if(this.cookieMatrix[this.itemIndexes[0]].scale.x < 0.85) this.cookieMatrix[this.itemIndexes[0]].scale.x = 0.85;
- this.bumpscale *= -1;
- }
- this.cookieMatrix[this.itemIndexes[0]].scale.x += this.bumpscale;
- this.cookieMatrix[this.itemIndexes[0]].scale.y += this.bumpscale;
- }
- for(var i=0; i<this.itemIndexes.length; i++){
- this.cookieMatrix[this.itemIndexes[i]].scale.x = this.cookieMatrix[this.itemIndexes[0]].scale.x
- this.cookieMatrix[this.itemIndexes[i]].scale.y = this.cookieMatrix[this.itemIndexes[0]].scale.x;
- }
- };
- gc.GameScene.prototype.getItemIndex = function () {
- this.itemIndexes = [];
- for(var i=0; i<this.cookieNumMatrix.length; i++){
- if(this.cookieNumMatrix[i]>6){
- this.itemIndexes.push(i);
- }
- }
- };
- gc.GameScene.prototype.actBomb = function(actIndex){
- this.bombCombo++;
- //본인
- this.cookieMatrix[actIndex].flag = 0;
- this.cookieMatrix[actIndex].remember = 0;
- this.cookieMatrix[actIndex].alpha = 0;
- //첫번째 열이 아님
- if(actIndex%7 != 0) {
- //왼쪽 위
- if(actIndex-7-1 >= 0) {
- //대상이 아이템 블럭이 아님
- if(this.cookieNumMatrix[actIndex - 7 - 1] < 7) {
- this.cookieMatrix[actIndex - 7 - 1].flag = 0;
- this.cookieMatrix[actIndex - 7 - 1].alpha = 0;
- this.cookieMatrix[actIndex - 7 - 1].remember = 0;
- }
- }
- //왼쪽 아래
- if(actIndex+7-1 <= 48) {
- //대상이 아이템 블럭이 아님
- if(this.cookieNumMatrix[actIndex + 7 - 1] < 7) {
- this.cookieMatrix[actIndex + 7 - 1].flag = 0;
- this.cookieMatrix[actIndex + 7 - 1].alpha = 0;
- this.cookieMatrix[actIndex + 7 - 1].remember = 0;
- }
- }
- //왼쪽
- if(actIndex-1 >= 0) {
- //대상이 아이템 블럭이 아님
- if(this.cookieNumMatrix[actIndex - 1] < 7) {
- this.cookieMatrix[actIndex - 1].flag = 0;
- this.cookieMatrix[actIndex - 1].alpha = 0;
- this.cookieMatrix[actIndex - 1].remember = 0;
- }
- }
- }
- //위
- if(actIndex-7 >= 0){
- if(this.cookieNumMatrix[actIndex - 7] < 7) {
- this.cookieMatrix[actIndex - 7].flag = 0;
- this.cookieMatrix[actIndex - 7].alpha = 0;
- this.cookieMatrix[actIndex - 7].remember = 0;
- }
- }
- //아래
- if(actIndex+7 <= 48){
- if(this.cookieNumMatrix[actIndex + 7] < 7) {
- this.cookieMatrix[actIndex + 7].flag = 0;
- this.cookieMatrix[actIndex + 7].alpha = 0;
- this.cookieMatrix[actIndex + 7].remember = 0;
- }
- }
- //오른쪽 끝 열이 아님
- if(actIndex%7 != 6) {
- //오른쪽 위
- if (actIndex - 7 + 1 >= 0) {
- //대상이 아이템 블럭이 아님
- if (this.cookieNumMatrix[actIndex - 7 + 1] < 7) {
- this.cookieMatrix[actIndex - 7 + 1].flag = 0;
- this.cookieMatrix[actIndex - 7 + 1].alpha = 0;
- this.cookieMatrix[actIndex - 7 + 1].remember = 0;
- }
- }
- //오른쪽 아래
- if (actIndex + 7 + 1 <= 48) {
- //대상이 아이템 블럭이 아님
- if (this.cookieNumMatrix[actIndex + 7 + 1] < 7) {
- this.cookieMatrix[actIndex + 7 + 1].flag = 0;
- this.cookieMatrix[actIndex + 7 + 1].alpha = 0;
- this.cookieMatrix[actIndex + 7 + 1].remember = 0;
- }
- }
- //오른쪽
- if (actIndex + 1 <= 48) {
- //대상이 아이템 블럭이 아님
- if (this.cookieNumMatrix[actIndex + 1] < 7) {
- this.cookieMatrix[actIndex + 1].flag = 0;
- this.cookieMatrix[actIndex + 1].alpha = 0;
- this.cookieMatrix[actIndex + 1].remember = 0;
- }
- }
- }
- //아이템 사용시 강조 이펙트 제거를 위함
- this.stopItemAccentEffect();
- this.playItemAccentEffect();
- this.explode();
- };
- gc.GameScene.prototype.explodeEqual = function () {
- var explodeMc = new gc.MovieClip('clear_effect_00', 1, 9, 0.4);
- explodeMc.onComplete = function() {gc.game.explodeContainer2.removeChild(explodeMc);};
- explodeMc.anchor.set(0.5);
- explodeMc.position.x = this.cookieMatrixPos[this.remembers[0]][0];
- explodeMc.position.y = this.cookieMatrixPos[this.remembers[0]][1];
- explodeMc.alpha = 1;
- explodeMc.scale.x = 1.3;
- explodeMc.scale.y = 1.3;
- explodeMc.loop = false;
- this.explodeContainer2.addChild(explodeMc);
- };
- gc.GameScene.prototype.rise = function () {
- var fakeCookie = new PIXI.Sprite.fromFrame('cookie_1_0001.png');
- fakeCookie.texture = this.cookieMatrix[this.remembers[0]].texture;
- fakeCookie.anchor.set(0.5);
- fakeCookie.position.x = this.cookieMatrixPos[this.remembers[0]][0];
- fakeCookie.position.y = this.cookieMatrixPos[this.remembers[0]][1];
- this.explodeContainer2.addChild(fakeCookie);
- this.manageSound();
- this.cookieMatrix[this.remembers[0]].alpha = 0;
- this.cookieMatrix[this.remembers[0]].flag = 0;
- this.cookieMatrix[this.remembers[0]].remember = 0;
- TweenMax.to(fakeCookie.scale, 0.1,{x:1.15, y:1.15, onComplete:(function () {
- this.explodeEqual();
- this.remembers.splice(0, 1);
- if(this.remembers.length>0) setTimeout(this.rise.bind(this),100);
- else{
- this.explodeContainer2.removeChildren();
- this.explode();
- this.shadow.alpha = 0;
- }
- }).bind(this)});
- };
- gc.GameScene.prototype.actEqual = function(actIndex){
- this.remembers = [];
- this.tempRemembers = []; // 쿠키가 커진 후 크기 돌려놓기 위함
- //본인
- this.cookieMatrix[actIndex].flag = 0;
- this.remembers.push(actIndex);
- for (var i = 0; i < this.cookieNumMatrix.length; i++) {
- if (this.cookieNumMatrix[i] == this.cookieMatrix[actIndex].remember) {
- this.cookieMatrix[i].flag = 0;
- this.remembers.push(i);
- this.tempRemembers.push(i);
- }
- }
- this.shadow.alpha = 1;
- //아이템 사용시 강조 이펙트 제거를 위함
- this.stopItemAccentEffect();
- this.playItemAccentEffect();
- //순서대로 커지게 만들기
- this.rise();
- };
- gc.GameScene.prototype.actCross = function(actIndex){
- this.champagneCombo++;
- //본인
- this.cookieMatrix[actIndex].flag = 0;
- this.cookieMatrix[actIndex].remember = 0;
- this.cookieMatrix[actIndex].alpha = 0;
- var colIndex = actIndex%7; //몇번째 열인지 체크
- for(var i=0; i<7; i++){
- if(this.cookieMatrix[i * 7 + colIndex].flag != 0) {
- if (this.cookieNumMatrix[i * 7 + colIndex] < 7) {
- this.cookieMatrix[i * 7 + colIndex].flag = 0;
- this.cookieMatrix[i * 7 + colIndex].alpha = 0;
- this.cookieMatrix[i * 7 + colIndex].remember = 0;
- }
- }
- }
- var rowIndex = Math.floor(actIndex/7); //몇번째 열인지 체크
- for(var i=0; i<7; i++){
- if(this.cookieMatrix[rowIndex * 7 + i].flag != 0) {
- if (this.cookieNumMatrix[rowIndex * 7 + i] < 7) {
- this.cookieMatrix[rowIndex * 7 + i].flag = 0;
- this.cookieMatrix[rowIndex * 7 + i].alpha = 0;
- this.cookieMatrix[rowIndex * 7 + i].remember = 0;
- }
- }
- }
- //아이템 사용시 강조 이펙트 제거를 위함
- this.stopItemAccentEffect();
- this.playItemAccentEffect();
- this.explode();
- };
- //쿠키 메우기==================================================================
- gc.GameScene.prototype.dropCookie = function(){
- var index;
- var lineCount = 0; //한 열의 빈 블럭 수 카운트
- var dropCount = 0; //한 열의 내려온 블럭 수 카운트(완전히 내려온 후 카운트)
- var fullCount = 0; //떨어질 블럭 전체 수 카운트(빈 공간 + 새로 떨어질 블럭 수)
- var dropIndexes = []; //떨어질 블럭 인덱스
- for(var i=0; i<7; i++){
- lineCount = 0;
- //기존 블럭 내리기
- for(var j=6; j>=0; j--){
- index = j*7+i;
- if(this.cookieMatrix[index].flag == 0){
- lineCount++;
- this.cookieMatrix[index].alpha = 1;
- this.cookieMatrix[index].flag = 1;
- }else{
- if(lineCount > 0) {
- fullCount++;
- dropIndexes.push(index + lineCount * 7);
- //내려올 블럭: (index + lineCount * 7), 복사해올 블럭: (index)
- this.cookieMatrix[index + lineCount * 7].texture = this.cookieMatrix[index].texture;
- this.cookieMatrix[index + lineCount * 7].remember = this.cookieMatrix[index].remember;
- this.cookieMatrix[index].remember = 0;
- this.cookieNumMatrix[index + lineCount * 7] = this.cookieNumMatrix[index];
- this.cookieNumMatrix[index] = 0;
- //아이템이 내려올 때 크기 복사
- if(this.cookieNumMatrix[index + lineCount * 7] > 7) this.matchItemSize(index + lineCount * 7);
- else{
- this.cookieMatrix[index + lineCount * 7].scale.x = 0.85;
- this.cookieMatrix[index + lineCount * 7].scale.y = 0.85;
- }
- TweenMax.from(this.cookieMatrix[index + lineCount * 7], 0.3, {
- y: this.cookieMatrixPos[index][1], onComplete: (function () {
- dropCount++;
- if(dropCount == fullCount && !this.canClick) {
- //이전 스테이지모드 저장
- if(this.stageMode != 'momotime') this.prestageMode = this.stageMode;
- this.checkAgain();
- }
- else {
- this.lastEventTime = Date.now();
- }
- }.bind(this))
- });
- }
- }
- }
- //새로운 쿠키 내리기
- for(var j= lineCount-1; j>=0; j--){
- index = j*7+i;
- fullCount++;
- this.cookieNumMatrix[index] = parseInt(Math.random()*6+1);
- this.cookieMatrix[index].texture = PIXI.Texture.fromFrame('cookie_000'+ this.cookieNumMatrix[index] + '.png');
- this.cookieMatrix[index].scale.x = 0.85;
- this.cookieMatrix[index].scale.y = 0.85;
- this.cookieMatrix[index].remember = 0;
- this.cookieMatrix[index].alpha = 1;
- this.cookieMatrix[index].flag = 1;
- TweenMax.from(this.cookieMatrix[index], 0.3, {y:this.gameTable.position.y+this.cookieMatrix[index].height/2, onComplete: (function (){
- dropCount++;
- if(dropCount == fullCount && !this.canClick) {
- //이전 스테이지모드 저장
- if(this.stageMode != 'momotime') this.prestageMode = this.stageMode;
- this.checkAgain();
- }
- else {
- this.lastEventTime = Date.now();
- }
- }.bind(this))});
- }
- }
- //내려올 블럭이 아이템일 경우 아이템 강조 이펙트도 같이 움직이기 위함
- this.stopItemAccentEffect();
- this.playItemAccentEffect();
- this.getItemIndex();
- //객체 의미 없음
- TweenMax.from(this.cookieMatrix[0], 0.3, {onComplete: (function (){
- this.restComboTime = 3; //=아이템 블럭이 많으면 다음 콤보까지 시간 부족.. 블럭 다 떨어지고 초기화
- //힌트 저장을 위함
- this.giveHint = false;
- if(!this.checkMatching1() && this.playGame) {
- this.checkAgain();
- this.findHint();
- }
- ////게임 종료
- //if(this.chance<=0 && !this.haveEmpty) this.setGameOver();
- }.bind(this))});
- };
- gc.GameScene.prototype.checkAgain = function(){
- for(var i=0; i<this.cookieMatrixPos.length; i++) {
- this.cookieMatrix[i].position.x = this.cookieMatrixPos[i][0];
- this.cookieMatrix[i].position.y = this.cookieMatrixPos[i][1];
- }
- this.checkMatching3();
- };
- //아이템 강조 이펙트 설정======================================================================
- gc.GameScene.prototype.playItemAccentEffect = function () {
- for(var i=0; i<this.cookieNumMatrix.length; i++){
- if(this.cookieNumMatrix[i] > 7 && this.cookieMatrix[i].flag == 1){
- this.itemEffectMc[i].alpha = 1;
- this.itemEffectMc[i].play();
- }
- }
- };
- gc.GameScene.prototype.stopItemAccentEffect = function () {
- for(var i=0; i<this.itemEffectMc.length; i++) {
- this.itemEffectMc[i].stop();
- this.itemEffectMc[i].alpha = 0;
- }
- };
- //매칭확인=============================================================================
- //처음 그릴때 매칭 되는 거 없게 하기 위함
- gc.GameScene.prototype.checkMatching1= function(){
- //가로 체크
- var num1 = undefined;
- var num2 = undefined;
- var countRow = 0;
- var countCol = 0;
- var index1 = undefined;
- var index2 = undefined;
- //가로(행) 매칭 체크
- for(var i=0; i<7; i++){
- num1 = this.cookieNumMatrix[i*7];
- countRow = 0;
- for(var j=0; j<7; j++){
- index1 = j+i*7;
- if (num1 <7 && this.cookieNumMatrix[index1] == num1) {
- countRow++;
- } else {
- num1 = this.cookieNumMatrix[index1];
- countRow = 1;
- }
- if (countRow >= 3) {
- return true;
- }
- }
- }
- //세로(열) 매칭 체크
- for(var i=0; i<7; i++){
- countCol = 0;
- num2 = this.cookieNumMatrix[i];
- for(var j=0; j<7; j++){
- index2 = j*7+i;
- if (num2<7 && this.cookieNumMatrix[index2] == num2) {
- countCol++;
- } else {
- num2 = this.cookieNumMatrix[index2];
- countCol = 1;
- }
- if (countCol >= 3) {
- return true;
- }
- }
- }
- return false;
- };
- //스와핑 후 매칭 확인
- gc.GameScene.prototype.checkMatching2 = function (checkingIndex){
- this.l_c = 0;
- this.r_c = 0;
- this.u_c = 0;
- this.d_c = 0;
- this.itemIndex = undefined;
- this.memories = [];
- if(this.cookieNumMatrix[checkingIndex] < 7) {
- //왼쪽 파트
- for (var i = checkingIndex; i >= Math.floor(checkingIndex / 7) * 7; i--) {
- if (this.cookieNumMatrix[i] == this.cookieNumMatrix[checkingIndex]) {
- this.l_c++;
- } else {
- break;
- }
- }
- //오른쪽 파트
- for (var i = checkingIndex; i <= Math.floor(checkingIndex / 7 + 1) * 7 - 1; i++) {
- if (this.cookieNumMatrix[i] == this.cookieNumMatrix[checkingIndex]) {
- this.r_c++;
- } else {
- break;
- }
- }
- //위쪽 파트
- for (var i = checkingIndex; i >= 0; i -= 7) {
- if (this.cookieNumMatrix[i] == this.cookieNumMatrix[checkingIndex]) {
- this.u_c++;
- } else {
- break;
- }
- }
- //아래쪽 파트
- for (var i = checkingIndex; i < this.cookieMatrix.length; i += 7) {
- if (this.cookieNumMatrix[i] == this.cookieNumMatrix[checkingIndex]) {
- this.d_c++;
- } else {
- break;
- }
- }
- }
- //매칭 쿠키 확인
- if(this.l_c+this.r_c -1 >= 3){ //맞춰진 가로 수가 3개 이상이면
- //가로 4개 이상
- if(this.l_c+this.r_c -1 >= 4) this.itemIndex = checkingIndex;
- for(var i=checkingIndex-this.l_c+1; i <= checkingIndex + this.r_c-1; i++){
- this.cookieMatrix[i].flag = 0;
- this.memories.push(i);
- }
- if(this.u_c+this.d_c-1 >= 3){ //맞춰진 세로 수가 3개 이상이면
- for(var i=checkingIndex-(this.u_c-1)*7; i <= checkingIndex+(this.d_c-1)*7; i+=7){
- if(i != checkingIndex) {
- this.cookieMatrix[i].flag = 0;
- this.memories.push(i);
- }
- }
- //십자 모양
- this.itemIndex = checkingIndex;
- }
- return true;
- }else if(this.l_c+this.r_c -1 < 3 && this.u_c+this.d_c-1 >= 3) { //가로 개수가 3개 미만이고, 세로 개수가 3개 이상
- for(var i=checkingIndex-(this.u_c-1)*7; i <= checkingIndex+(this.d_c-1)*7; i+=7){
- this.cookieMatrix[i].flag = 0;
- this.memories.push(i);
- }
- //세로 4개 이상
- if(this.memories.length>=4) this.itemIndex = checkingIndex;
- return true;
- }else{ //맞는게 없을 때
- return false;
- }
- };
- //모든 쿠키 내리고 나서 다시 매칭 확인
- gc.GameScene.prototype.checkMatching3 = function(){
- this.bundle = []; //매칭되는 모든 배열을 저장하기 위한 배열
- for (var j = 0; j < this.cookieMatrix.length; j++) {
- this.l_c = 0;
- this.r_c = 0;
- this.u_c = 0;
- this.d_c = 0;
- this.itemIndex = undefined;
- this.memories = [];
- if (this.cookieMatrix[j].flag != 0 && this.cookieNumMatrix[j]<7) {
- //왼쪽 파트
- for (var i = j; i >= Math.floor(j / 7) * 7; i--) {
- if (this.cookieNumMatrix[i] == this.cookieNumMatrix[j]) {
- this.l_c++;
- } else {
- break;
- }
- }
- //오른쪽 파트
- for (var i = j; i <= Math.floor(j / 7 + 1) * 7 - 1; i++) {
- if (this.cookieNumMatrix[i] == this.cookieNumMatrix[j]) {
- this.r_c++;
- } else {
- break;
- }
- }
- //위쪽 파트
- for (var i = j; i >= 0; i -= 7) {
- if (this.cookieNumMatrix[i] == this.cookieNumMatrix[j]) {
- this.u_c++;
- } else {
- break;
- }
- }
- //아래쪽 파트
- for (var i = j; i < this.cookieMatrix.length; i += 7) {
- if (this.cookieNumMatrix[i] == this.cookieNumMatrix[j]) {
- this.d_c++;
- } else {
- break;
- }
- }
- //매칭 쿠키 확인
- if (this.l_c + this.r_c - 1 >= 3) { //맞춰진 가로 수가 3개 이상이면
- for (var i = j - this.l_c + 1; i <= j + this.r_c - 1; i++) {
- this.memories.push(i);
- }
- if (this.u_c + this.d_c - 1 >= 3) { //맞춰진 세로 수가 3개 이상이면
- for (var i = j - (this.u_c - 1) * 7; i <= j + (this.d_c - 1) * 7; i += 7) {
- if (i != j) {
- this.memories.push(i);
- }
- }
- }
- } else if (this.l_c + this.r_c - 1 < 3 && this.u_c + this.d_c - 1 >= 3) { //가로 개수가 3개 미만이고, 세로 개수가 3개 이상
- for (var i = j - (this.u_c - 1) * 7; i <= j + (this.d_c - 1) * 7; i += 7) {
- this.memories.push(i);
- }
- }
- }
- this.bundle[j] = this.memories;
- }
- var bundleCount = 0;
- for (var i = 0; i < this.bundle.length; i++) {
- if (this.bundle[i].length == 0) {
- bundleCount++;
- }
- }
- //맞춰진 블럭이 있을때
- if (bundleCount != this.bundle.length) this.searchingMaxLength();
- else {
- this.haveEmpty = false;
- for (var i = 0; i < this.cookieMatrix.length; i++) {
- if (this.cookieMatrix[i].flag == 0) this.haveEmpty = true;
- }
- if (this.haveEmpty) this.explode();
- else {
- if (this.playGame) {
- this.canClick = true;
- }
- else {
- if (this.itemOver) {
- this.PlayOver();//게임이 완전히 끝났을 때
- } else {
- this.lastPang();//횟수는 끝났으나 아이템이 남아있으면 터뜨리기}
- }
- }
- //게임 종료
- if (this.playGame && this.chance <= 0 && !this.haveEmpty) this.setGameOver();
- }
- }
- };
- gc.GameScene.prototype.PlayOver = function () {
- this.gameoverImg.anchor.set(0.5);
- this.gameoverImg.x = GD.width/2;
- this.gameoverImg.y = GD.height/2;
- this.addChild(this.gameoverImg);
- TweenMax.to(this.gameoverImg.scale, 0.5, {x:1, y:1, onComplete:(function () {
- TweenMax.to(this.gameoverImg.scale, 0.3, {x:1.2, y:1.2});
- }).bind(this)});
- TweenMax.from(this.gameoverImg, 0.5, {y:GD.height+this.gameoverImg.height});
- this.giveHint = true;
- this.canClick = false;
- this.normalmomo.stop();
- this.fevermomo.stop();
- this.normalshushu.stop();
- this.fevershushu.stop();
- this.fevereffect1.stop();
- this.fevereffect2.stop();
- GD.soundPlay('sound_gameover');
- setTimeout(this.onResult.bind(this),1000);
- };
- //타임업 사운드가 끝나고 결과창으로 이동
- gc.GameScene.prototype.onResult = function () {
- GD.bgmStop();
- gc.game = null;
- GD.commonOption.finish(this.score);
- };
- //맞춰진 배열에서 가장 긴 배열에 아이템을 넣기 위한 함수
- gc.GameScene.prototype.searchingMaxLength = function(){
- var maxLength = 0;
- var maxLengthIndex = undefined;
- for(var i=0; i<this.bundle.length; i++){
- if(this.bundle[i].length > maxLength) {
- maxLength = this.bundle[i].length;
- maxLengthIndex = i;
- }
- }
- for (var i = 0; i < this.bundle[maxLengthIndex].length; i++) {
- this.cookieMatrix[this.bundle[maxLengthIndex][i]].flag = 0;
- this.cookieMatrix[this.bundle[maxLengthIndex][i]].alpha = 0;
- this.cookieMatrix[this.bundle[maxLengthIndex][i]].remember = 0;
- }
- if(this.bundle[maxLengthIndex].length >= 4) {
- if (this.bundle[maxLengthIndex].length >= 5) {
- this.cookieMatrix[maxLengthIndex].remember = this.cookieNumMatrix[maxLengthIndex];
- var itemName = 'cookie2_000';
- var fullItemName = itemName+this.cookieMatrix[maxLengthIndex].remember+'.png';
- this.cookieMatrix[maxLengthIndex].texture = PIXI.Texture.fromFrame(fullItemName);
- this.cookieNumMatrix[maxLengthIndex] = 9;
- }else if (this.bundle[maxLengthIndex].length >= 4) {
- this.cookieMatrix[maxLengthIndex].texture = PIXI.Texture.fromFrame('eraser_0001.png');
- this.cookieNumMatrix[maxLengthIndex] = 8;
- }
- this.cookieMatrix[maxLengthIndex].flag = 1;
- this.cookieMatrix[maxLengthIndex].alpha = 1;
- }
- this.combo++;
- this.totalCombo++;
- if(this.stageMode != 'momotime') {
- if(this.combo>=15) {this.stageMode = 'superfever';}
- else if(this.combo>=5){
- this.stageMode = 'fever';
- this.callfevercnt = 0;
- } else{this.stageMode = 'normal';}
- }
- this.lastTime = Date.now();
- this.restComboTime = 3;
- this.checkMatching3();
- };
- //피버모드=======================================================================================================
- gc.GameScene.prototype.setFeverText = function () {
- this.superfeverText.anchor.set(0.5);
- this.superfeverText.position.x = gc.width / 2;
- this.superfeverText.position.y = this.gameTable.position.y;
- this.superfeverText.scale.x = 0;
- this.superfeverText.scale.y = 0;
- this.addChild(this.superfeverText);
- this.feverText.anchor.set(0.5);
- this.feverText.position.x = gc.width / 2;
- this.feverText.position.y = this.gameTable.position.y;
- this.feverText.scale.x = 0;
- this.feverText.scale.y = 0;
- this.addChild(this.feverText);
- };
- gc.GameScene.prototype.setFever = function () {
- if(!this.pauseMode) {
- var now = Date.now();
- if (this.lastTime == undefined) this.lastTime = now;
- if (this.playGame) {
- if (this.restComboTime > 0) {this.restComboTime -= (now - this.lastTime) / 1000;}
- else {
- this.combo = 0;
- this.restComboTime = 0;
- this.lastTime = undefined;
- if(this.stageMode != 'normal') this.prestageMode = this.stageMode;
- this.stageMode = 'normal';
- this.callfevercnt = 0;
- }
- if (this.prestageMode != this.stageMode && this.callfevercnt == 0) {this.actFever();}
- this.lastTime = now;
- }
- }else this.lastTime = Date.now();
- };
- gc.GameScene.prototype.actFever = function () {
- this.callfevercnt++;
- if(this.stageMode == 'normal'){
- this.normalMode();
- this.gameBG.texture = GD.loader.resources['game_bg'].texture;
- this.fevereffect1.alpha = 0;
- this.fevereffect2.alpha = 0;
- } else{
- this.otherMode();
- this.actfeverEffect();
- }
- };
- gc.GameScene.prototype.actfeverEffect = function(){
- if(this.test){
- this.fevereffect1.y = -200;
- this.fevereffect2.y = -200;
- }else {
- this.gameBG.texture = GD.loader.resources['game_bg_fever'].texture;
- this.fevereffect1.y = 465;
- this.fevereffect2.y = 345;
- }
- this.fevereffect1.alpha = 1;
- this.fevereffect2.alpha = 1;
- this.fevereffect2.scale.y = 1.5;
- if(!this.test)if (this.stageMode != 'momotime') GD.soundPlay('sound_fever');
- if (this.stageMode == 'superfever') {
- this.superfeverText.alpha = 1;
- TweenMax.to(this.superfeverText.scale, 0.5, {
- x: 1, y: 1, alpha: 1, onComplete: (function () {
- TweenMax.to(this.superfeverText, 0.7, {
- onComplete: (function () {
- this.superfeverText.scale.x = 0;
- this.superfeverText.scale.y = 0;
- this.superfeverText.alpha = 0;
- }).bind(this)
- });
- }).bind(this)
- });
- } else if (this.stageMode == 'fever') {
- this.feverText.alpha = 1;
- TweenMax.to(this.feverText.scale, 0.5, {
- x: 1, y: 1, alpha: 1, onComplete: (function () {
- TweenMax.to(this.feverText, 0.7, {
- onComplete: (function () {
- this.feverText.scale.x = 0;
- this.feverText.scale.y = 0;
- this.feverText.alpha = 0;
- if(this.test) {
- this.test = false;
- this.stageMode = 'normal';
- }
- }).bind(this)
- });
- }).bind(this)
- });
- }
- };
- // 일시정지
- gc.GameScene.prototype.pause = function(){
- this.pauseMode = true;
- this.setInteractive(false);
- };
- // 게임진행
- gc.GameScene.prototype.resume = function(){
- this.pauseMode = false;
- this.setInteractive(true);
- };
- // 버튼 이벤트 설정
- gc.GameScene.prototype.setInteractive = function(bool){
- for(var i=0; i<this.cookieMatrix.length; i++){ this.cookieMatrix[i].interactive = bool;}
- if(this.pauseMode){
- this.fevereffect1.stop();
- this.fevereffect2.stop();
- this.normalmomo.stop();
- this.fevermomo.stop();
- this.normalshushu.stop();
- this.fevershushu.stop();
- if(this.giveHint){
- this.hintMc1.stop();
- this.hintMc2.stop();
- }
- }else{
- this.fevereffect1.play();
- this.fevereffect2.play();
- if(this.stageMode == 'normal') {this.normalMode();}
- else{this.otherMode();}
- if(this.giveHint){
- this.hintMc1.play();
- this.hintMc2.play();
- }
- }
- };
- //메달(업적) 관리==================================================================================================
- gc.GameScene.prototype.manageMedal = function () {
- if(this.totalCombo >= 100 && !this.getMedal4) {
- DataManager.addMedal(4);
- this.getMedal4 = true;
- } else if(this.totalCombo >= 3 && !this.getMedal1) {
- DataManager.addMedal(1);
- this.getMedal1 = true;
- }else if(this.champagneCombo >= 10 && !this.getMedal2) {
- DataManager.addMedal(2);
- this.getMedal2 = true;
- }else if(this.bombCombo >= 10 && !this.getMedal3) {
- DataManager.addMedal(3);
- this.getMedal3 = true;
- }
- };
- gc.GameScene.getInstance = function(){
- if(!gc.game) gc.game = new gc.GameScene();
- return gc.game;
- };
- module.exports.gc = gc;
|