123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162 |
- var com;
- (function(a) {
- (function(d) {
- var c = (function() {
- function e() {
- }
- e.init = function() {
- };
- e.clear = function() {
- };
- return e
- })();
- d.TextureCache = c
- })(a.goldenratio || (a.goldenratio = {}));
- var b = a.goldenratio
- })(com || (com = {}));
- var com;
- (function(a) {
- (function(d) {
- var c = (function() {
- function e(f) {
- this.type = f
- }
- e.LAUNCH_GAME = "com.goldenratio.GameEvent.LAUNCH_GAME";
- e.GAME_OVER = "com.goldenratio.GameEvent.GAME_OVER";
- e.GAME_OVER_BUTTON_READY = "com.goldenratio.GameEvent.GAME_OVER_BUTTON_READY";
- e.SOUND_LOADED = "com.goldenratio.GameEvent.SOUND_LOADED";
- e.SOUND_ERROR = "com.goldenratio.GameEvent.SOUND_ERROR";
- e.BUTTON_UP = "com.goldenratio.GameEvent.BUTTON_UP";
- e.BUTTON_DOWN = "com.goldenratio.GameEvent.BUTTON_DOWN";
- e.TOGGLE_PAUSE = "com.goldenratio.GameEvent.TOGGLE_PAUSE";
- e.START_GAME = "com.goldenratio.GameEvent.START_GAME";
- e.CANVAS_MOUSE_DOOWN = "com.goldenratio.GameEvent.CANVAS_MOUSE_DOOWN";
- e.EGG_OUTOFF_BASKET = "com.goldenratio.GameEvent.EGG_OUTOFF_BASKET";
- e.EGG_INSIDE_BASKET = "com.goldenratio.GameEvent.EGG_INSIDE_BASKET";
- e.EGG_DIED = "com.goldenratio.GameEvent.EGG_DIED";
- e.SCREEN_TRANSITION_SHOW_SCREEN = "com.goldenratio.GameEvent.SCREEN_TRANSITION_SHOW_SCREEN";
- e.SCREEN_TRANSITION_HIDE_SCREEN = "com.goldenratio.GameEvent.SCREEN_TRANSITION_HIDE_SCREEN";
- e.PLAY_AGAIN_CLICK = "com.goldenratio.GameEvent.PLAY_AGAIN_CLICK";
- return e
- })();
- d.GameEvent = c
- })(a.goldenratio || (a.goldenratio = {}));
- var b = a.goldenratio
- })(com || (com = {}));
- var com;
- (function(a) {
- (function(d) {
- var c = (function() {
- function e() {
- }
- e.supportsDeviceOrientation = function() {
- if ("ondeviceorientation" in window) {
- return true
- }
- return false
- };
- e.isTouchDevice = function() {
- if ("ontouchstart" in window || window.navigator.msMaxTouchPoints > 0 || window.navigator.maxTouchPoints > 0) {
- return true
- }
- return false
- };
- e.isMobileDevice = function() {
- if (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) || navigator.userAgent.match(/Mobile/i) || navigator.userAgent.match(/Tablet/i) || navigator.userAgent.match(/Silk/i)) {
- return true
- }
- return false
- };
- e.isChrome = function() {
- if (navigator.userAgent.match(/Chrome/i)) {
- return true
- }
- return false
- };
- e.isFirefox = function() {
- if (navigator.userAgent.match(/Firefox/i)) {
- return true
- }
- return false
- };
- e.isFirefoxForAndroid = function() {
- return e.isAndroid() && e.isFirefox()
- };
- e.isFirefoxOS = function() {
- return (("mozApps") in navigator) && (navigator.userAgent.search("Mobile") != -1)
- };
- e.isOpera = function() {
- if (navigator.userAgent.match(/Opera/i) || navigator.userAgent.match(/OPR/i)) {
- return true
- }
- return false
- };
- e.isIE11 = function() {
- if (navigator.userAgent.match(/Trident/i)) {
- return true
- }
- return false
- };
- e.isAndroid = function() {
- if (navigator.userAgent.match(/Android/i)) {
- return true
- }
- return false
- };
- e.isLinux = function() {
- if (navigator.userAgent.match(/Linux/i)) {
- return true
- }
- return false
- };
- e.isWindows = function() {
- if (navigator.userAgent.match(/Windows/i)) {
- return true
- }
- return false
- };
- e.isMac = function() {
- if (navigator.userAgent.match(/Mac/i)) {
- return true
- }
- return false
- };
- e.getAndroidVersion = function() {
- var f = navigator.userAgent;
- if (f.indexOf("Android") >= 0) {
- return parseFloat(f.slice(f.indexOf("Android") + 8))
- }
- return 0
- };
- e.renderInWebGL = function() {
- if (e.isFirefox() && e.isLinux()) {
- return false
- }
- return true
- };
- e.lockScreenToPortrait = function() {
- var f = ["portrait-primary"];
- if (window.screen.mozLockOrientation) {
- return window.screen.mozLockOrientation(f)
- }
- if (window.screen.msLockOrientation) {
- return window.screen.msLockOrientation(f)
- }
- if (window.screen.lockOrientation) {
- return window.screen.lockOrientation(f)
- }
- return false
- };
- e.lockScreenToLandscape = function() {
- var f = ["landscape-primary"];
- if (window.screen.mozLockOrientation) {
- return window.screen.mozLockOrientation(f)
- }
- if (window.screen.msLockOrientation) {
- return window.screen.msLockOrientation(f)
- }
- if (window.screen.lockOrientation) {
- return window.screen.lockOrientation(f)
- }
- return false
- };
- e.isLandscapeMode = function() {
- if (window.orientation == 90 || window.orientation == -90) {
- return e.isMobileDevice()
- }
- if (window.orientation == null || window.orientation == 0) {
- return (window.innerWidth > window.innerHeight) && e.isMobileDevice()
- }
- return false
- };
- e.isGamepadSupported = function() {
- return !!navigator.webkitGetGamepads || !!navigator.webkitGamepads || (navigator.userAgent.indexOf("Firefox/") != -1)
- };
- return e
- })();
- d.DeviceUtils = c
- })(a.goldenratio || (a.goldenratio = {}));
- var b = a.goldenratio
- })(com || (com = {}));
- var __extends = this.__extends || function(f, a) {
- for (var e in a) {
- if (a.hasOwnProperty(e)) {
- f[e] = a[e]
- }
- }
- function c() {
- this.constructor = f
- }
- c.prototype = a.prototype;
- f.prototype = new c()
- };
- var com;
- (function(a) {
- (function(d) {
- var c = (function(e) {
- __extends(f, e);
- function f() {
- e.call(this);
- this.loaderContainer = document.getElementById("loader-container");
- this.loadProgressContainer = document.getElementById("loader-progress");
- this.loadCompleteContainer = document.getElementById("loader-complete");
- this.loaderTapToPlay = document.getElementById("loader-tap-to-play");
- this.fullscreenCheckboxContainer = document.getElementById("fullscreen-option");
- this.showFullscreenCheckbox(false);
- this.loaderContainer.style.display = "block";
- this.loadProgressContainer.style.display = "block";
- this.mapBinds()
- }
- f.prototype.showFullscreenCheckbox = function(g) {
- this.fullscreenCheckbox = null;
- if (fullscreenEnabled && g && isMobileDevice) {
- this.fullscreenCheckboxContainer.style.display = "block";
- this.fullscreenCheckbox = document.getElementById("fullscreen-opt")
- } else {
- this.fullscreenCheckboxContainer.style.display = "none"
- }
- };
- f.prototype.mapBinds = function() {
- this.onLoaderTapToPlayClickHL = this.onLoaderTapToPlayClickHL.bind(this)
- };
- f.prototype.updateViewPort = function(g, h) {
- this.loaderContainer.style.width = g + "px";
- this.loaderContainer.style.height = h-40 + "px";
- if (g < window.innerWidth && this.fullscreenCheckbox == null && d.DeviceUtils.isLandscapeMode() == false) {
- this.showFullscreenCheckbox(true)
- }
- };
- f.prototype.onLoadComplete = function() {
- this.loadProgressContainer.style.display = "none";
- this.loadCompleteContainer.style.display = "block";
- this.addLoaderListeners(true);
- this.launchGame();
- // if (f.SHOW_TAP_TO_PLAY == false) {
- // this.launchGame()
- // }
- };
- f.prototype.addLoaderListeners = function(g) {
- this.loaderTapToPlay.removeEventListener("click", this.onLoaderTapToPlayClickHL, false);
- if (g) {
- this.loaderTapToPlay.addEventListener("click", this.onLoaderTapToPlayClickHL, false)
- }
- };
- f.prototype.onLoaderTapToPlayClickHL = function(g) {
- this.launchGame();
- g.preventDefault();
- g.stopPropagation()
- };
- f.prototype.launchGame = function() {
- this.loaderContainer.style.display = "none";
- this.addLoaderListeners(false);
-
- if (fullscreenEnabled) {
- if (this.fullscreenCheckbox && this.fullscreenCheckbox.checked == true) {
- triggerFullscreen()
- }
- }
-
- this.dispatchEvent(new d.GameEvent(d.GameEvent.LAUNCH_GAME))
- };
- f.SHOW_TAP_TO_PLAY = true;
- return f
- })(PIXI.EventTarget);
- d.LoaderScreen = c
- })(a.goldenratio || (a.goldenratio = {}));
- var b = a.goldenratio
- })(com || (com = {}));
- var com;
- (function(a) {
- (function(d) {
- var c = (function() {
- function e(h, g, i, f) {
- this.type = h;
- this.startTime = g;
- this.duration = i;
- this.loop = f
- }
- e.CLICK = new e("click", 0, 261.2244897959184, false);
- e.EGG_FALL = new e("egg_fall", 2000, 789.4784580498869, false);
- e.EGG_SUCCESS = new e("egg_success", 4000, 1732.154195011338, false);
- e.LEVEL_COMPLETE = new e("level_complete", 7000, 1500, false);
- e.WOOD_TAP = new e("wood_tap", 10000, 624.9886621315195, false);
- e.HOWLER_DATA = {click: [0, 261.2244897959184],egg_fall: [2000, 789.4784580498869],egg_success: [4000, 1732.154195011338],level_complete: [7000, 1500],wood_tap: [10000, 624.9886621315195]};
- return e
- })();
- d.AudioSpriteData = c
- })(a.goldenratio || (a.goldenratio = {}));
- var b = a.goldenratio
- })(com || (com = {}));
- var com;
- (function(a) {
- (function(e) {
- var d = (function() {
- function f(g) {
- this.type = g
- }
- f.CLICK = new f(e.AudioSpriteData.CLICK.type);
- f.WOOD_TAP = new f(e.AudioSpriteData.WOOD_TAP.type);
- f.EGG_FALL = new f(e.AudioSpriteData.EGG_FALL.type);
- f.EGG_SUCCESS = new f(e.AudioSpriteData.EGG_SUCCESS.type);
- f.LEVEL_COMPLETE = new f(e.AudioSpriteData.LEVEL_COMPLETE.type);
- return f
- })();
- e.SFXType = d;
- var c = (function() {
- function f() {
- }
- f.init = function() {
- if (f.isSFXLoaded == true) {
- return
- }
- if (f.isSFXLoadError == true) {
- return
- }
- f.loadSFX();
- window.addEventListener("blur", f.onWindowBlur, false);
- window.addEventListener("focus", f.onWindowFocus, false);
- document.addEventListener(visibilityChange, f.handleVisibilityChange, false)
- };
- f.onWindowBlur = function(g) {
- f.mute(true)
- };
- f.onWindowFocus = function(g) {
- if (f.userMuteState == false) {
- f.mute(false)
- }
- };
- f.handleVisibilityChange = function() {
- if (document[hidden]) {
- f.mute(true)
- } else {
- if (f.userMuteState == false) {
- f.mute(false)
- }
- }
- };
- f.loadSFX = function() {
- this._sfx = new Howl({urls: ["sfx.ogg", "sfx.mp3"],sprite: e.AudioSpriteData.HOWLER_DATA,onplay: function() {
- f.isSFXLoaded = false;
- f.isSFXPlaying = true
- },onend: function() {
- f.isSFXLoaded = false;
- f.isSFXPlaying = false
- },onload: function() {
- f.isSFXLoaded = true;
- f.event.dispatchEvent(new e.GameEvent(e.GameEvent.SOUND_LOADED))
- },onloaderror: function() {
- f.isSFXLoaded = false;
- f.isSFXLoadError = true;
- f.event.dispatchEvent(new e.GameEvent(e.GameEvent.SOUND_ERROR))
- }});
- f.isSFXLoaded = false;
- f.isSFXLoadError = true;
- f.event.dispatchEvent(new e.GameEvent(e.GameEvent.SOUND_ERROR))
- };
- f.canPlaySFX = function(g) {
- return f.isSFXLoaded && (f.muteState == false || g)
- };
- f.playSFX = function(g, h) {
- if (typeof h === "undefined") {
- h = false
- }
- if (f.canPlaySFX(h) == true) {
- this._sfx.play(g.type)
- }
- };
- f.mute = function(g) {
- f.muteState = g;
- if (g) {
- Howler.mute()
- } else {
- Howler.unmute()
- }
- };
- f.toggleUserMute = function() {
- f.userMuteState = !f.userMuteState;
- f.mute(f.userMuteState)
- };
- f.setUserMute = function(g) {
- if (f.userMuteState != g) {
- f.userMuteState = g;
- f.mute(g)
- }
- };
- f.event = new PIXI.EventTarget();
- f.isSFXPlaying = false;
- f.isSFXLoaded = false;
- f.isSFXLoadError = false;
- f.muteState = false;
- f.userMuteState = false;
- return f
- })();
- e.SoundManager = c
- })(a.goldenratio || (a.goldenratio = {}));
- var b = a.goldenratio
- })(com || (com = {}));
- var com;
- (function(a) {
- (function(d) {
- var c = (function() {
- function e() {
- this.id_basket_01 = "basket_01";
- this.id_basket_02 = "basket_02";
- this.id_bg = "bg";
- this.id_button_credits = "button_credits";
- this.id_button_mainmenu = "button_mainmenu";
- this.id_button_moregames = "button_moregames";
- this.id_button_playagain = "button_playagain";
- this.id_button_startgame = "button_startgame";
- this.id_credits_panel = "credits_panel";
- this.id_egg = "egg";
- this.id_egg_life = "egg_life";
- this.id_egg_nolife = "egg_nolife";
- this.id_egg_title = "egg_title";
- this.id_labrat_copyright = "labrat_copyright";
- this.id_medal_bronze_1 = "medal_bronze_1";
- this.id_medal_gold_1 = "medal_gold_1";
- this.id_medal_gold_2 = "medal_gold_2";
- this.id_medal_gold_3 = "medal_gold_3";
- this.id_medal_gold_4 = "medal_gold_4";
- this.id_medal_none = "medal_none";
- this.id_medal_silver_1 = "medal_silver_1";
- this.id_medal_silver_2 = "medal_silver_2";
- this.id_medal_silver_3 = "medal_silver_3";
- this.id_medal_silver_4 = "medal_silver_4";
- this.id_number_0 = "number_0";
- this.id_number_1 = "number_1";
- this.id_number_2 = "number_2";
- this.id_number_3 = "number_3";
- this.id_number_4 = "number_4";
- this.id_number_5 = "number_5";
- this.id_number_6 = "number_6";
- this.id_number_7 = "number_7";
- this.id_number_8 = "number_8";
- this.id_number_9 = "number_9";
- this.id_pause_play_button = "pause_play_button";
- this.id_score_new = "score_new";
- this.id_score_panel = "score_panel";
- this.id_tap_hand_01 = "tap_hand_01";
- this.id_tap_hand_02 = "tap_hand_02";
- this.id_tap_left = "tap_left";
- this.id_tap_right = "tap_right";
- this.id_text_0 = "text_0";
- this.id_text_1 = "text_1";
- this.id_text_2 = "text_2";
- this.id_text_3 = "text_3";
- this.id_text_4 = "text_4";
- this.id_text_5 = "text_5";
- this.id_text_6 = "text_6";
- this.id_text_7 = "text_7";
- this.id_text_8 = "text_8";
- this.id_text_9 = "text_9";
- this.id_text_gameover = "text_gameover";
- this.id_text_paused = "text_paused";
- this.id_trans = "trans";
- this.id_volume_off = "volume_off";
- this.id_volume_on = "volume_on"
- }
- e.prototype.basket_01 = function() {
- return PIXI.Sprite.fromFrame("basket_01")
- };
- e.prototype.basket_02 = function() {
- return PIXI.Sprite.fromFrame("basket_02")
- };
- e.prototype.bg = function() {
- return PIXI.Sprite.fromFrame("bg")
- };
- e.prototype.button_credits = function() {
- return PIXI.Sprite.fromFrame("button_credits")
- };
- e.prototype.button_mainmenu = function() {
- return PIXI.Sprite.fromFrame("button_mainmenu")
- };
- e.prototype.button_moregames = function() {
- return PIXI.Sprite.fromFrame("button_moregames")
- };
- e.prototype.button_playagain = function() {
- return PIXI.Sprite.fromFrame("button_playagain")
- };
- e.prototype.button_startgame = function() {
- return PIXI.Sprite.fromFrame("button_startgame")
- };
- e.prototype.credits_panel = function() {
- return PIXI.Sprite.fromFrame("credits_panel")
- };
- e.prototype.egg = function() {
- return PIXI.Sprite.fromFrame("egg")
- };
- e.prototype.egg_life = function() {
- return PIXI.Sprite.fromFrame("egg_life")
- };
- e.prototype.egg_nolife = function() {
- return PIXI.Sprite.fromFrame("egg_nolife")
- };
- e.prototype.egg_title = function() {
- return PIXI.Sprite.fromFrame("egg_title")
- };
- e.prototype.labrat_copyright = function() {
- return PIXI.Sprite.fromFrame("labrat_copyright")
- };
- e.prototype.medal_bronze_1 = function() {
- return PIXI.Sprite.fromFrame("medal_bronze_1")
- };
- e.prototype.medal_gold_1 = function() {
- return PIXI.Sprite.fromFrame("medal_gold_1")
- };
- e.prototype.medal_gold_2 = function() {
- return PIXI.Sprite.fromFrame("medal_gold_2")
- };
- e.prototype.medal_gold_3 = function() {
- return PIXI.Sprite.fromFrame("medal_gold_3")
- };
- e.prototype.medal_gold_4 = function() {
- return PIXI.Sprite.fromFrame("medal_gold_4")
- };
- e.prototype.medal_none = function() {
- return PIXI.Sprite.fromFrame("medal_none")
- };
- e.prototype.medal_silver_1 = function() {
- return PIXI.Sprite.fromFrame("medal_silver_1")
- };
- e.prototype.medal_silver_2 = function() {
- return PIXI.Sprite.fromFrame("medal_silver_2")
- };
- e.prototype.medal_silver_3 = function() {
- return PIXI.Sprite.fromFrame("medal_silver_3")
- };
- e.prototype.medal_silver_4 = function() {
- return PIXI.Sprite.fromFrame("medal_silver_4")
- };
- e.prototype.number_0 = function() {
- return PIXI.Sprite.fromFrame("number_0")
- };
- e.prototype.number_1 = function() {
- return PIXI.Sprite.fromFrame("number_1")
- };
- e.prototype.number_2 = function() {
- return PIXI.Sprite.fromFrame("number_2")
- };
- e.prototype.number_3 = function() {
- return PIXI.Sprite.fromFrame("number_3")
- };
- e.prototype.number_4 = function() {
- return PIXI.Sprite.fromFrame("number_4")
- };
- e.prototype.number_5 = function() {
- return PIXI.Sprite.fromFrame("number_5")
- };
- e.prototype.number_6 = function() {
- return PIXI.Sprite.fromFrame("number_6")
- };
- e.prototype.number_7 = function() {
- return PIXI.Sprite.fromFrame("number_7")
- };
- e.prototype.number_8 = function() {
- return PIXI.Sprite.fromFrame("number_8")
- };
- e.prototype.number_9 = function() {
- return PIXI.Sprite.fromFrame("number_9")
- };
- e.prototype.pause_play_button = function() {
- return PIXI.Sprite.fromFrame("pause_play_button")
- };
- e.prototype.score_new = function() {
- return PIXI.Sprite.fromFrame("score_new")
- };
- e.prototype.score_panel = function() {
- return PIXI.Sprite.fromFrame("score_panel")
- };
- e.prototype.tap_hand_01 = function() {
- return PIXI.Sprite.fromFrame("tap_hand_01")
- };
- e.prototype.tap_hand_02 = function() {
- return PIXI.Sprite.fromFrame("tap_hand_02")
- };
- e.prototype.tap_left = function() {
- return PIXI.Sprite.fromFrame("tap_left")
- };
- e.prototype.tap_right = function() {
- return PIXI.Sprite.fromFrame("tap_right")
- };
- e.prototype.text_0 = function() {
- return PIXI.Sprite.fromFrame("text_0")
- };
- e.prototype.text_1 = function() {
- return PIXI.Sprite.fromFrame("text_1")
- };
- e.prototype.text_2 = function() {
- return PIXI.Sprite.fromFrame("text_2")
- };
- e.prototype.text_3 = function() {
- return PIXI.Sprite.fromFrame("text_3")
- };
- e.prototype.text_4 = function() {
- return PIXI.Sprite.fromFrame("text_4")
- };
- e.prototype.text_5 = function() {
- return PIXI.Sprite.fromFrame("text_5")
- };
- e.prototype.text_6 = function() {
- return PIXI.Sprite.fromFrame("text_6")
- };
- e.prototype.text_7 = function() {
- return PIXI.Sprite.fromFrame("text_7")
- };
- e.prototype.text_8 = function() {
- return PIXI.Sprite.fromFrame("text_8")
- };
- e.prototype.text_9 = function() {
- return PIXI.Sprite.fromFrame("text_9")
- };
- e.prototype.text_gameover = function() {
- return PIXI.Sprite.fromFrame("text_gameover")
- };
- e.prototype.text_paused = function() {
- return PIXI.Sprite.fromFrame("text_paused")
- };
- e.prototype.trans = function() {
- return PIXI.Sprite.fromFrame("trans")
- };
- e.prototype.volume_off = function() {
- return PIXI.Sprite.fromFrame("volume_off")
- };
- e.prototype.volume_on = function() {
- return PIXI.Sprite.fromFrame("volume_on")
- };
- return e
- })();
- d.Frame = c
- })(a.goldenratio || (a.goldenratio = {}));
- var b = a.goldenratio
- })(com || (com = {}));
- var com;
- (function(a) {
- (function(d) {
- var c = (function() {
- function e() {
- }
- e.frame = new d.Frame();
- return e
- })();
- d.Res = c
- })(a.goldenratio || (a.goldenratio = {}));
- var b = a.goldenratio
- })(com || (com = {}));
- var com;
- (function(a) {
- (function(d) {
- var c = (function() {
- function e() {
- }
- e.removeAllChildren = function(g) {
- if (g == null) {
- return
- }
- for (var f = g.children.length - 1; f >= 0; f--) {
- g.removeChild(g.children[f])
- }
- };
- e.removeFromParent = function(f) {
- if (f && f.parent) {
- f.parent.removeChild(f)
- }
- };
- e.removeList = function(f) {
- for (var g = f.length - 1; g >= 0; g--) {
- this.removeFromParent(f[g]);
- f[g] = null
- }
- };
- return e
- })();
- d.DisplayObjectUtils = c
- })(a.goldenratio || (a.goldenratio = {}));
- var b = a.goldenratio
- })(com || (com = {}));
- var com;
- (function(a) {
- (function(g) {
- var f = (function() {
- function h(i) {
- this._bucketType = i
- }
- h.prototype.toString = function() {
- return "{type: " + this._bucketType + "}"
- };
- h.MOVE_NONE = new h("MOVE_NONE");
- h.MOVE_LEFT_RIGHT = new h("MOVE_LEFT_RIGHT");
- h.MOVE_RIGHT_LEFT = new h("MOVE_RIGHT_LEFT");
- return h
- })();
- g.BucketAnimationType = f;
- var c = (function() {
- function h(i) {
- this._type = i
- }
- h.prototype.toString = function() {
- return "{type: " + this._type + "}"
- };
- h.STATIC = new h("static");
- h.FALLING = new h("falling");
- return h
- })();
- g.BucketType = c;
- var d = (function() {
- function h(i, j) {
- this.value = j;
- this._type = i
- }
- h.SLOW = new h("SLOW", 1);
- h.MEDIUM = new h("MEDIUM", 2);
- h.FAST = new h("FAST", 3);
- return h
- })();
- g.BucketSpeed = d;
- var e = (function() {
- function h(i, j) {
- this._rect = new PIXI.Rectangle(0, 0, 0, 0);
- this._eggPosition = new PIXI.Point(0, 0);
- this._isBounce = false;
- this._bounceCount = 0;
- this._animationType = f.MOVE_NONE;
- this._speed = d.SLOW;
- this._id = -1;
- this._direction = 1;
- this._isBlinkStart = false;
- this._blinkCount = 0;
- this._isFirstBlink = false;
- this._isSecondBlink = false;
- this._canDropBasket = false;
- this._canDropEgg = false;
- this.onBlinkComplete = this.onBlinkComplete.bind(this);
- this.dropBasket = this.dropBasket.bind(this);
- if (i == c.STATIC) {
- this._gfx = g.Res.frame.basket_01()
- } else {
- if (i == c.FALLING) {
- this._gfx = g.Res.frame.basket_02()
- }
- }
- this._type = i;
- this._id = j;
- this._gfx.pivot.x = this._gfx.width >> 1;
- this._gfx.pivot.y = this._gfx.height >> 1;
- this._gfx.scale.x = this._gfx.scale.y = 0.5;
- this._rect.width = this._gfx.width;
- this._rect.height = this._gfx.height-40
- }
- h.prototype.setAnimationType = function(i) {
- this._animationType = i;
- if (this._animationType == f.MOVE_RIGHT_LEFT) {
- this._direction = -1
- }
- if (this._animationType == f.MOVE_LEFT_RIGHT) {
- this._direction = 1
- }
- };
- Object.defineProperty(h.prototype, "animationType", {get: function() {
- return this._animationType
- },enumerable: true,configurable: true});
- h.prototype.setSpeed = function(i) {
- this._speed = i
- };
- h.prototype.setPosition = function(j, i) {
- this._rect.x = j;
- this._rect.y = i;
- this.updateRect()
- };
- h.prototype.updateRect = function() {
- this._eggPosition.x = this._rect.x + (this._rect.width >> 1);
- this._eggPosition.y = this._rect.y + (this._rect.height >> 1) - 10;
- this._gfx.position.x = this._rect.x + (this._rect.width >> 1);
- this._gfx.position.y = this._rect.y + (this._rect.height >> 1)
- };
- Object.defineProperty(h.prototype, "id", {get: function() {
- return this._id
- },enumerable: true,configurable: true});
- Object.defineProperty(h.prototype, "type", {get: function() {
- return this._type
- },enumerable: true,configurable: true});
- Object.defineProperty(h.prototype, "canDropEgg", {get: function() {
- return this._canDropEgg
- },enumerable: true,configurable: true});
- h.prototype.bounce = function() {
- if (this._isBounce == false) {
- this._rect.y += 2;
- this._isBounce = true;
- this.updateRect()
- }
- };
- h.prototype.onEggJumpedOffBasket = function() {
- this.bounce();
- this._isBlinkStart = false;
- this._isFirstBlink = false;
- this._isSecondBlink = false;
- this._blinkCount = 0
- };
- h.prototype.onEggLanded = function() {
- this.bounce();
- if (this._type == c.FALLING) {
- this._isBlinkStart = true;
- this._isFirstBlink = true
- }
- };
- h.prototype.reset = function() {
- this._isBlinkStart = false;
- this._isFirstBlink = false;
- this._isSecondBlink = false;
- this._canDropBasket = false;
- this._canDropEgg = false;
- this._blinkCount = 0;
- var i = this;
- this._tween = new TWEEN.Tween({alpha: this._gfx.alpha}).to({alpha: 1}, 200).easing(TWEEN.Easing.Linear.None).onUpdate(function() {
- if (i._gfx) {
- i._gfx.alpha = this.alpha
- }
- }).start()
- };
- h.prototype.update = function(i) {
- if (this._isBounce) {
- this._bounceCount++;
- if (this._bounceCount >= 8) {
- this._isBounce = false;
- this._bounceCount = 0;
- this._rect.y -= 2;
- this.updateRect()
- }
- }
- if (this._animationType && this._rect) {
- if (this._animationType == f.MOVE_LEFT_RIGHT || this._animationType == f.MOVE_RIGHT_LEFT) {
- this._rect.x -= this._speed.value * i * this._direction;
- if (this._rect.x <= 0) {
- this._rect.x = 0;
- this._direction *= -1
- } else {
- if (this._rect.x >= (320 - this._rect.width)) {
- this._rect.x = (320 - this._rect.width);
- this._direction *= -1
- }
- }
- this.updateRect()
- }
- }
- if (this._isBlinkStart) {
- this._blinkCount++;
- if (this._blinkCount >= 80 && this._isFirstBlink == true) {
- this._isFirstBlink = false;
- this.blinkBucket(false)
- }
- if (this._blinkCount >= 80 && this._isSecondBlink == true) {
- this._isSecondBlink = false;
- this.blinkBucket(true)
- }
- }
- };
- h.prototype.blinkBucket = function(j) {
- this._isBlinkStart = false;
- this._canDropBasket = j;
- var i = this;
- this._tween = new TWEEN.Tween({alpha: 1}).to({alpha: 0.3}, 600).repeat(3).yoyo(true).easing(TWEEN.Easing.Linear.None).onUpdate(function() {
- if (i._gfx) {
- i._gfx.alpha = this.alpha
- }
- }).onComplete(this.onBlinkComplete).start()
- };
- h.prototype.onBlinkComplete = function() {
- if (this._canDropBasket) {
- var i = this;
- this._tween = new TWEEN.Tween({alpha: 1}).to({alpha: 0}, 300).easing(TWEEN.Easing.Linear.None).onUpdate(function() {
- if (i._gfx) {
- i._gfx.alpha = this.alpha
- }
- }).onComplete(this.dropBasket).start();
- return
- }
- this._blinkCount = 0;
- this._isBlinkStart = true;
- this._isSecondBlink = true
- };
- h.prototype.dropBasket = function() {
- this._canDropEgg = true
- };
- Object.defineProperty(h.prototype, "gfx", {get: function() {
- return this._gfx
- },enumerable: true,configurable: true});
- Object.defineProperty(h.prototype, "rect", {get: function() {
- return this._rect
- },enumerable: true,configurable: true});
- Object.defineProperty(h.prototype, "eggPosition", {get: function() {
- return this._eggPosition
- },enumerable: true,configurable: true});
- h.prototype.dispose = function() {
- if (this._tween) {
- this._tween = null
- }
- g.DisplayObjectUtils.removeFromParent(this._gfx);
- this._gfx = null;
- this._rect = null;
- this._eggPosition = null;
- this._animationType = null;
- this._speed = null;
- this._type = null
- };
- return h
- })();
- g.Bucket = e
- })(a.goldenratio || (a.goldenratio = {}));
- var b = a.goldenratio
- })(com || (com = {}));
- var com;
- (function(a) {
- (function(d) {
- var c = (function() {
- function e(g) {
- this._list = [];
- this._container = g;
- var k = 999;
- var n = 115;
- var l = -50;
- var t = new d.Bucket(d.BucketType.STATIC, 0);
- t.setPosition(n, l);
- t.setAnimationType(d.BucketAnimationType.MOVE_NONE);
- this._list.push(t);
- l -= 180;
- var s = new d.Bucket(d.BucketType.STATIC, 1);
- s.setPosition(n, l);
- s.setAnimationType(d.BucketAnimationType.MOVE_NONE);
- this._list.push(s);
- k -= 2;
- var o = 0;
- for (var m = 0; m < k; m++) {
- l -= 180;
- var j = (Math.random() * 50) | 0;
- var f = this.getRandomBucketType(j);
- var h = this.getRandomAnimationType(j);
- var q = d.BucketSpeed.MEDIUM;
- if (f == d.BucketType.STATIC) {
- q = this.getRandomBucketSpeed(j)
- }
- if (m > 0) {
- var p = this._list[(m + 2) - 1];
- if (p.animationType == d.BucketAnimationType.MOVE_LEFT_RIGHT && h == d.BucketAnimationType.MOVE_LEFT_RIGHT) {
- h = d.BucketAnimationType.MOVE_NONE
- } else {
- if (p.animationType == d.BucketAnimationType.MOVE_RIGHT_LEFT && h == d.BucketAnimationType.MOVE_RIGHT_LEFT) {
- h = d.BucketAnimationType.MOVE_NONE
- }
- }
- if ((p.animationType == d.BucketAnimationType.MOVE_LEFT_RIGHT || p.animationType == d.BucketAnimationType.MOVE_RIGHT_LEFT) && h == d.BucketAnimationType.MOVE_NONE) {
- n = (Math.random() * 230) | 0
- }
- }
- if (f == d.BucketType.STATIC && h == d.BucketAnimationType.MOVE_NONE) {
- o++
- }
- if (o >= 4) {
- o = 0;
- h = d.BucketAnimationType.MOVE_RIGHT_LEFT
- }
- var r = new d.Bucket(f, m + 2);
- if (h == d.BucketAnimationType.MOVE_NONE) {
- r.setPosition(n, l)
- } else {
- r.setPosition((Math.random() * 230) | 0, l)
- }
- r.setAnimationType(h);
- r.setSpeed(q);
- this._list.push(r)
- }
- this._list.reverse();
- this._firstBasket = this._list[this._list.length - 1]
- }
- e.prototype.getRandomAnimationType = function(f) {
- if (f > 16 && f <= 32) {
- return d.BucketAnimationType.MOVE_LEFT_RIGHT
- } else {
- if (f > 32) {
- return d.BucketAnimationType.MOVE_RIGHT_LEFT
- }
- }
- return d.BucketAnimationType.MOVE_NONE
- };
- e.prototype.getRandomBucketSpeed = function(f) {
- if (f >= 0 && f <= 20) {
- return d.BucketSpeed.SLOW
- }
- return d.BucketSpeed.MEDIUM
- };
- e.prototype.getRandomBucketType = function(f) {
- if (f >= 30) {
- return d.BucketType.FALLING
- }
- return d.BucketType.STATIC
- };
- e.prototype.updateCurrentBasket = function(g) {
- this._nextBasket = null;
- this._currentBasket = null;
- if (this._firstBasket && !this._firstBasket.gfx.parent) {
- this._container.addChild(this._firstBasket.gfx)
- }
- for (var f = this._list.length - 1; f >= 0; f--) {
- if (this._list[f].id == g) {
- this._currentBasket = this._list[f];
- if (!this._currentBasket.gfx.parent) {
- this._container.addChild(this._currentBasket.gfx)
- }
- if (this._list[f - 1]) {
- this._nextBasket = this._list[f - 1];
- if (!this._nextBasket.gfx.parent) {
- this._container.addChild(this._nextBasket.gfx)
- }
- }
- if (this._list[f - 2]) {
- this._list[f - 2].gfx.visible = true;
- if (!this._list[f - 2].gfx.parent) {
- this._container.addChild(this._list[f - 2].gfx)
- }
- }
- return
- }
- }
- };
- Object.defineProperty(e.prototype, "currentBasket", {get: function() {
- return this._currentBasket
- },enumerable: true,configurable: true});
- Object.defineProperty(e.prototype, "nextBasket", {get: function() {
- return this._nextBasket
- },enumerable: true,configurable: true});
- Object.defineProperty(e.prototype, "firstBasket", {get: function() {
- return this._firstBasket
- },enumerable: true,configurable: true});
- e.prototype.update = function(j) {
- var h = this._list.length;
- var f = (h - 3);
- if (f < 0) {
- f = 0
- }
- for (var g = h - 1; g >= f; g--) {
- this._list[g].update(j)
- }
- };
- e.prototype.onEggLanded = function() {
- };
- e.prototype.onContainerScrollComplete = function() {
- for (var f = this._list.length - 1; f >= 0; f--) {
- if (this._list[f].id < this._currentBasket.id) {
- var g = this._list[f];
- if (g) {
- g.dispose();
- g = null;
- this._list.splice(f, 1)
- }
- } else {
- break
- }
- }
- this._firstBasket = this._list[this._list.length - 1]
- };
- e.prototype.dispose = function() {
- for (var f = 0; f < this._list.length; f++) {
- this._list[f].dispose();
- this._list[f] = null
- }
- this._list.length = 0;
- this._list = null;
- this._currentBasket = null;
- this._nextBasket = null;
- this._firstBasket = null;
- this._container = null
- };
- return e
- })();
- d.BucketManager = c
- })(a.goldenratio || (a.goldenratio = {}));
- var b = a.goldenratio
- })(com || (com = {}));
- var com;
- (function(a) {
- (function(d) {
- var c = (function() {
- function e() {
- }
- e.distanceBetweenTwoPoints = function(h, g, f, i) {
- return Math.sqrt(Math.pow(f - h, 2) + Math.pow(i - g, 2))
- };
- e.degreesToRadians = function(f) {
- return f * Math.PI / 180
- };
- e.radiansToDegrees = function(f) {
- return f * 180 / Math.PI
- };
- return e
- })();
- d.MathUtils = c
- })(a.goldenratio || (a.goldenratio = {}));
- var b = a.goldenratio
- })(com || (com = {}));
- var com;
- (function(a) {
- (function(e) {
- var d = (function() {
- function f() {
- }
- f.SPEED = 5;
- f.MAX_HEIGHT = 240;
- f.ROTATION_SPEED = 15;
- return f
- })();
- e.EggConf = d;
- var c = (function(g) {
- __extends(f, g);
- function f() {
- g.call(this);
- this._rect = new PIXI.Rectangle(0, 0, 0, 0);
- this._position = new PIXI.Point(0, 0);
- this._rotation = 0;
- this._isJump = false;
- this._destinationPosition = new PIXI.Point(0, 0);
- this._initialPosition = new PIXI.Point(0, 0);
- this._fallFlag = false;
- this._basketID = -1;
- this._fallFriction = 1;
- this._raiseFriction = 1;
- this._isFreeFall = false;
- this._swapDepthFlag = false;
- this._swapDepthInsideFlag = false;
- this._canLandInNextBasket = false;
- this._isAlive = true;
- this._hasFallenOffScreen = false;
- this._gfx = e.Res.frame.egg();
- this._gfx.pivot.x = this._gfx.width >> 1;
- this._gfx.pivot.y = this._gfx.height >> 1;
- this._gfx.scale.x = this._gfx.scale.y = 0.5;
- this._rect.width = this._gfx.width;
- this._rect.height = this._gfx.height-40
- }
- f.prototype.resetFlags = function() {
- this._fallFlag = false;
- this._isJump = false;
- this._initialPosition.x = 0;
- this._initialPosition.y = 0;
- this._destinationPosition.x = 0;
- this._destinationPosition.y = 0;
- this._rotation = 0;
- this._canLandInNextBasket = false
- };
- f.prototype.setPosition = function(i, h) {
- this._position.x = i;
- this._position.y = h;
- this.updateRect()
- };
- f.prototype.updateRect = function() {
- this._rect.x = this._position.x - (this._rect.width >> 1);
- this._rect.y = this._position.y - (this._rect.height >> 1);
- this._gfx.position.x = this._position.x;
- this._gfx.position.y = this._position.y;
- this._gfx.rotation = e.MathUtils.degreesToRadians(this._rotation)
- };
- f.prototype.setJump = function(h) {
- if (this._isJump != h) {
- this._isJump = h;
- if (this._isJump) {
- this._fallFlag = false;
- this._fallFriction = 0;
- this._raiseFriction = 1;
- this._isFreeFall = false;
- this._swapDepthFlag = false;
- this._swapDepthInsideFlag = false;
- this._initialPosition.y = this._position.y;
- this._destinationPosition.y = (this._position.y - d.MAX_HEIGHT) >> 0
- }
- }
- };
- Object.defineProperty(f.prototype, "gfx", {get: function() {
- return this._gfx
- },enumerable: true,configurable: true});
- Object.defineProperty(f.prototype, "rect", {get: function() {
- return this._rect
- },enumerable: true,configurable: true});
- Object.defineProperty(f.prototype, "isJumping", {get: function() {
- return this._isJump
- },enumerable: true,configurable: true});
- Object.defineProperty(f.prototype, "hasFallenOffScreen", {get: function() {
- return this._hasFallenOffScreen
- },enumerable: true,configurable: true});
- Object.defineProperty(f.prototype, "canLandInNextBasket", {get: function() {
- return this._canLandInNextBasket
- },enumerable: true,configurable: true});
- Object.defineProperty(f.prototype, "isFalling", {get: function() {
- return this._fallFlag
- },enumerable: true,configurable: true});
- f.prototype.setBasketID = function(h) {
- this._basketID = h;
- this.resetFlags()
- };
- Object.defineProperty(f.prototype, "basketID", {get: function() {
- return this._basketID
- },enumerable: true,configurable: true});
- f.prototype.update = function(k, i, h, j) {
- if (this._hasFallenOffScreen) {
- return
- }
- if (this._isJump) {
- if (!this._fallFlag) {
- this._fallFlag = (this._position.y <= this._destinationPosition.y)
- }
- if (this._fallFlag) {
- if (this._fallFriction < 1) {
- this._fallFriction += 0.05
- }
- if (this._fallFriction > 1) {
- this._fallFriction = 1
- }
- this._position.y += d.SPEED * this._fallFriction
- } else {
- if (this._isFreeFall) {
- if (this._raiseFriction > 0) {
- this._raiseFriction -= 0.05
- }
- if (this._raiseFriction < 0) {
- this._raiseFriction = 0
- }
- this._position.y -= d.SPEED * this._raiseFriction
- } else {
- this._position.y -= d.SPEED
- }
- }
- if (Math.abs(this._destinationPosition.y - this._position.y) > 40) {
- this._rotation += d.ROTATION_SPEED;
- this._isFreeFall = false
- } else {
- this._rotation = 270;
- this._isFreeFall = true
- }
- if (this._rotation >= 360) {
- this._rotation = 0
- }
- if (this._swapDepthFlag == false && (this._position.y <= (this._initialPosition.y - 60))) {
- this._swapDepthFlag = true;
- this.dispatchEvent(new e.GameEvent(e.GameEvent.EGG_OUTOFF_BASKET))
- }
- if (this._fallFlag && h) {
- if ((this._position.x > h.rect.x + 10) && (this._position.x < (h.rect.x + h.rect.width - 10))) {
- if (this._swapDepthInsideFlag == false && (this._position.y >= h.rect.y - 15) && (this._position.y <= h.rect.y)) {
- this._swapDepthInsideFlag = true;
- this.dispatchEvent(new e.GameEvent(e.GameEvent.EGG_INSIDE_BASKET))
- }
- if (this._canLandInNextBasket == false && (this._position.y >= h.rect.y - 5) && (this._position.y <= h.rect.y)) {
- this._canLandInNextBasket = true
- }
- }
- if (this._hasFallenOffScreen == false && this._position.y >= (j.rect.y + j.rect.height + 100)) {
- this._hasFallenOffScreen = true;
- this.dispatchEvent(new e.GameEvent(e.GameEvent.GAME_OVER));
- return
- }
- }
- } else {
- if (i) {
- if (i.canDropEgg == false) {
- this._position.x = i.eggPosition.x;
- this._position.y = i.eggPosition.y
- } else {
- if (this._hasFallenOffScreen == false && this._position.y >= (j.rect.y + j.rect.height + 100)) {
- this._hasFallenOffScreen = true;
- this.dispatchEvent(new e.GameEvent(e.GameEvent.GAME_OVER));
- return
- }
- this._position.y += 6 * k;
- if (this._isAlive) {
- this._isAlive = false;
- this.dispatchEvent(new e.GameEvent(e.GameEvent.EGG_DIED))
- }
- }
- }
- }
- this.updateRect()
- };
- f.prototype.reset = function() {
- this.resetFlags();
- this._hasFallenOffScreen = false;
- this._fallFlag = false;
- this._fallFriction = 0;
- this._raiseFriction = 1;
- this._isFreeFall = false;
- this._swapDepthFlag = false;
- this._swapDepthInsideFlag = false
- };
- f.prototype.dispose = function() {
- e.DisplayObjectUtils.removeFromParent(this._gfx);
- this._gfx = null;
- this._rect = null;
- this._position = null;
- this._destinationPosition = null;
- this._initialPosition = null
- };
- return f
- })(PIXI.EventTarget);
- e.Egg = c
- })(a.goldenratio || (a.goldenratio = {}));
- var b = a.goldenratio
- })(com || (com = {}));
- var com;
- (function(a) {
- (function(d) {
- var c = (function() {
- function e() {
- }
- e.hideMouse = function(f) {
- f.style.cursor = "none"
- };
- e.showMouse = function(f) {
- f.style.cursor = "default"
- };
- e.getMouseX = function(i, f, h) {
- var g = h.offsetX ? h.offsetX : h.clientX - i.left;
- return ((g / i.width) * f) >> 0
- };
- e.getMouseY = function(h, i, g) {
- var f = g.offsetY ? g.offsetY : g.clientY - h.top;
- return ((f / h.height) * i) >> 0
- };
- e.getTouchX = function(i, f, h) {
- var j = h.touches[0];
- var g = j.clientX - i.left;
- return ((g / i.width) * f) >> 0
- };
- e.getTouchY = function(h, i, g) {
- var j = g.touches[0];
- var f = j.clientY - h.top;
- return ((f / h.height) * i) >> 0
- };
- return e
- })();
- d.MouseUtils = c
- })(a.goldenratio || (a.goldenratio = {}));
- var b = a.goldenratio
- })(com || (com = {}));
- var com;
- (function(a) {
- (function(d) {
- var c = (function(f) {
- __extends(e, f);
- function e() {
- f.call(this);
- this.isSoundButtonPressed = false;
- this.isPlayAgainPressed = false;
- this.isMoreGamesPressed = false;
- this.isStartGamePressed = false;
- this.isCreditPressed = false;
- this.isMainMenuPressed = false;
- this.isPauseButtonPressed = false;
- this._isGamePaused = false;
- this.mapBinds();
- this.setEnable(false)
- }
- e.prototype.mapBinds = function() {
- this.onMouseDownHL = this.onMouseDownHL.bind(this);
- this.onMouseUpHL = this.onMouseUpHL.bind(this);
- this.onTouchStartHL = this.onTouchStartHL.bind(this);
- this.onTouchEndHL = this.onTouchEndHL.bind(this)
- };
- e.prototype.setSoundButtonRect = function(g) {
- this._soundRect = g
- };
- e.prototype.setStartGameRect = function(g) {
- this._startGameRect = g
- };
- e.prototype.setCreditsRect = function(g) {
- this._creditsRect = g
- };
- e.prototype.setMainMenuRect = function(g) {
- this._mainMenuRect = g
- };
- e.prototype.setPlayAgainRect = function(g) {
- this._playAgainRect = g
- };
- e.prototype.setMoreGamesRect = function(g) {
- this._moreGamesRect = g
- };
- e.prototype.setPauseButtonRect = function(g) {
- this._pauseButtonRect = g
- };
- e.prototype.setGamePaused = function(g) {
- this._isGamePaused = g
- };
- e.prototype.setEnable = function(g) {
-
- gameContainer.removeEventListener("touchstart", this.onTouchStartHL, false);
- gameContainer.removeEventListener("touchend", this.onTouchEndHL, false);
- gameContainer.removeEventListener("mousedown", this.onMouseDownHL, false);
- gameContainer.removeEventListener("mouseup", this.onMouseUpHL, false);
-
- if (g) {
- gameContainer.addEventListener("touchstart", this.onTouchStartHL, false);
- gameContainer.addEventListener("touchend", this.onTouchEndHL, false);
- gameContainer.addEventListener("mousedown", this.onMouseDownHL, false);
- gameContainer.addEventListener("mouseup", this.onMouseUpHL, false)
- }
- };
- e.prototype.onMouseUpHL = function(g) {
- g.stopPropagation();
- g.preventDefault();
- this.handleUPState()
- };
- e.prototype.onTouchEndHL = function(g) {
- g.stopPropagation();
- g.preventDefault();
- this.handleUPState()
- };
- e.prototype.onTouchStartHL = function(j) {
- j.stopPropagation();
- j.preventDefault();
- var i = gameContainer.getBoundingClientRect();
- var h = d.MouseUtils.getTouchX(i, d.Main.GAME_DIMENSION.width, j);
- var g = d.MouseUtils.getTouchY(i, d.Main.GAME_DIMENSION.height, j);
- this.checkButtonHit(h, g)
- };
- e.prototype.onMouseDownHL = function(j) {
- j.stopPropagation();
- j.preventDefault();
- var i = gameContainer.getBoundingClientRect();
- var h = d.MouseUtils.getMouseX(i, d.Main.GAME_DIMENSION.width, j);
- var g = d.MouseUtils.getMouseY(i, d.Main.GAME_DIMENSION.height, j );
- this.checkButtonHit(h, g)
- };
- e.prototype.checkButtonHit = function(h, g) {
- if (!this._isGamePaused) {
- if (this._soundRect && this._soundRect.contains(h, g)) {
- this.isSoundButtonPressed = true;
- this.dispatchEvent(new d.GameEvent(d.GameEvent.BUTTON_DOWN))
- } else {
- if (this._playAgainRect && this._playAgainRect.contains(h, g)) {
- this.isPlayAgainPressed = true;
- this.dispatchEvent(new d.GameEvent(d.GameEvent.BUTTON_DOWN))
- } else {
- if (this._moreGamesRect && this._moreGamesRect.contains(h, g)) {
- this.isMoreGamesPressed = true;
- this.dispatchEvent(new d.GameEvent(d.GameEvent.BUTTON_DOWN))
- } else {
- if (this._startGameRect && this._startGameRect.contains(h, g)) {
- this.isStartGamePressed = true;
- this.dispatchEvent(new d.GameEvent(d.GameEvent.BUTTON_DOWN))
- } else {
- if (this._creditsRect && this._creditsRect.contains(h, g)) {
- this.isCreditPressed = true;
- this.dispatchEvent(new d.GameEvent(d.GameEvent.BUTTON_DOWN))
- } else {
- if (this._mainMenuRect && this._mainMenuRect.contains(h, g)) {
- this.isMainMenuPressed = true;
- this.dispatchEvent(new d.GameEvent(d.GameEvent.BUTTON_DOWN))
- } else {
- this.dispatchEggJump()
- }
- }
- }
- }
- }
- }
- } else {
- if (this._pauseButtonRect && this._pauseButtonRect.contains(h, g)) {
- this.isPauseButtonPressed = true;
- this.dispatchEvent(new d.GameEvent(d.GameEvent.BUTTON_DOWN))
- }
- }
- };
- e.prototype.handleUPState = function() {
- if (this.isSoundButtonPressed) {
- this.dispatchEvent(new d.GameEvent(d.GameEvent.BUTTON_UP));
- this.isSoundButtonPressed = false
- } else {
- if (this.isPlayAgainPressed) {
- this.dispatchEvent(new d.GameEvent(d.GameEvent.BUTTON_UP));
- this.isPlayAgainPressed = false
- } else {
- if (this.isMoreGamesPressed) {
- this.dispatchEvent(new d.GameEvent(d.GameEvent.BUTTON_UP));
- this.isMoreGamesPressed = false
- } else {
- if (this.isStartGamePressed) {
- this.dispatchEvent(new d.GameEvent(d.GameEvent.BUTTON_UP));
- this.isStartGamePressed = false
- } else {
- if (this.isCreditPressed) {
- this.dispatchEvent(new d.GameEvent(d.GameEvent.BUTTON_UP));
- this.isCreditPressed = false
- } else {
- if (this.isMainMenuPressed) {
- this.dispatchEvent(new d.GameEvent(d.GameEvent.BUTTON_UP));
- this.isMainMenuPressed = false
- } else {
- if (this.isPauseButtonPressed) {
- this.dispatchEvent(new d.GameEvent(d.GameEvent.BUTTON_UP));
- this.isPauseButtonPressed = false
- }
- }
- }
- }
- }
- }
- }
- };
- e.prototype.dispatchEggJump = function() {
- this.dispatchEvent(new d.GameEvent(d.GameEvent.CANVAS_MOUSE_DOOWN))
- };
- e.prototype.dispose = function() {
- this.setEnable(false);
- this._soundRect = null;
- this._playAgainRect = null;
- this._moreGamesRect = null;
- this._startGameRect = null;
- this._creditsRect = null;
- this._pauseButtonRect = null
- };
- return e
- })(PIXI.EventTarget);
- d.InputControl = c
- })(a.goldenratio || (a.goldenratio = {}));
- var b = a.goldenratio
- })(com || (com = {}));
- var com;
- (function(a) {
- (function(e) {
- var c = (function() {
- function f() {
- }
- f.SOUND_KEY = "com.labrat.egg.sound_key";
- f.SCORE = "com.labrat.egg.score";
- return f
- })();
- e.LocalKey = c;
- var d = (function() {
- function f() {
- }
- f.save = function(g, i) {
- localStorage.setItem(g, i);
- try {
- var k = f.convertValueToHash(i);
- var h = g + "_data";
- localStorage.setItem(h, k.toString())
- } catch (j) {
- }
- };
- f.convertValueToHash = function(h) {
- var g = h + f.HASH;
- return CryptoJS.MD5(g).toString()
- };
- f.get = function(i, g) {
- var j = localStorage.getItem(i);
- var h = localStorage.getItem(i + "_data");
- var k = j;
- if (j != null && h != null) {
- try {
- var m = f.convertValueToHash(k.toString());
- if (m != h) {
- k = null
- }
- } catch (l) {
- }
- }
- if (k == null && g != null) {
- k = g
- }
- return k
- };
- f.getNumber = function(i, g) {
- var j = 0;
- var h = f.get(i);
- if (h) {
- j = parseInt(h);
- if (isNaN(j)) {
- if (!isNaN(g)) {
- j = g
- } else {
- j = 0
- }
- }
- } else {
- if (!isNaN(g)) {
- j = g
- }
- }
- return j
- };
- f.getBoolean = function(i, g) {
- var h = f.get(i);
- if (h == "true" || h == "1") {
- return true
- }
- if (h == "false" || h == "0") {
- return false
- }
- if (typeof g !== "undefined") {
- return g
- }
- return false
- };
- f.HASH = "xPBUEYnZpWrjlACCKDXh";
- return f
- })();
- e.LocalStorageUtils = d
- })(a.goldenratio || (a.goldenratio = {}));
- var b = a.goldenratio
- })(com || (com = {}));
- var com;
- (function(a) {
- (function(d) {
- var c = (function() {
- function e() {
- }
- e.getMedalGfxFromScore = function(f) {
- if (f <= 0) {
- return d.Res.frame.medal_none()
- }
- if (f >= 1 && f < 10) {
- return d.Res.frame.medal_bronze_1()
- }
- if (f >= 10 && f < 30) {
- return d.Res.frame.medal_silver_1()
- }
- if (f >= 30 && f < 50) {
- return d.Res.frame.medal_silver_2()
- }
- if (f >= 50 && f < 70) {
- return d.Res.frame.medal_silver_3()
- }
- if (f >= 70 && f < 90) {
- return d.Res.frame.medal_silver_4()
- }
- if (f >= 90 && f < 120) {
- return d.Res.frame.medal_gold_1()
- }
- if (f >= 120 && f < 150) {
- return d.Res.frame.medal_gold_2()
- }
- if (f >= 150 && f < 180) {
- return d.Res.frame.medal_gold_3()
- }
- if (f >= 180) {
- return d.Res.frame.medal_gold_4()
- }
- return d.Res.frame.medal_none()
- };
- return e
- })();
- d.MedalData = c
- })(a.goldenratio || (a.goldenratio = {}));
- var b = a.goldenratio
- })(com || (com = {}));
- var com;
- (function(a) {
- (function(e) {
- var c = (function(g) {
- __extends(f, g);
- function f(h) {
- g.call(this);
- this._gameOverContainer = new PIXI.DisplayObjectContainer();
- h.addChild(this._gameOverContainer);
- this.showScorePanel = this.showScorePanel.bind(this);
- this.populateScoreData = this.populateScoreData.bind(this);
- this.showButtons = this.showButtons.bind(this);
- this.dispatchButtonReadyEvent = this.dispatchButtonReadyEvent.bind(this)
- }
- f.prototype.show = function(i) {
- this._score = i;
- this._gameOverText = e.Res.frame.text_gameover();
- this._gameOverText.anchor.x = 0.5;
- this._gameOverText.anchor.y = 0.5;
- this._gameOverText.scale.x = 0;
- this._gameOverText.scale.y = 0;
- this._gameOverText.position.x = 160;
- this._gameOverText.position.y = 80;
- this._gameOverContainer.addChild(this._gameOverText);
- var h = this;
- this._tween = new TWEEN.Tween({scale: this._gameOverText.scale.x}).to({scale: 0.5}, 600).easing(TWEEN.Easing.Bounce.Out).onUpdate(function() {
- if (h._gameOverText) {
- h._gameOverText.scale.x = this.scale;
- h._gameOverText.scale.y = this.scale
- }
- }).onComplete(h.showScorePanel).start()
- //var titlex = "鸡妈妈感谢你拯救了"+this._score+"颗蛋!分享到朋友圈告诉朋友一起来帮助鸡妈妈~~";
- var score = this._score;
- window._myscore = parseInt(score);
- myScores ();
- };
- f.prototype.showScorePanel = function() {
- this._scorePanelGfx = e.Res.frame.score_panel();
- this._scorePanelGfx.scale.x = 1;
- this._scorePanelGfx.scale.y = 1;
- this._scorePanelGfx.anchor.x = 0.5;
- this._scorePanelGfx.anchor.y = 0.5;
- this._scorePanelGfx.position.x = 160;
- this._scorePanelGfx.position.y = 520;
- this._gameOverContainer.addChild(this._scorePanelGfx);
- var h = this;
- this._tween = new TWEEN.Tween({y: this._scorePanelGfx.position.y}).to({y: 190}, 400).easing(TWEEN.Easing.Back.Out).onUpdate(function() {
- if (h._scorePanelGfx) {
- h._scorePanelGfx.position.y = this.y;
- h._scorePanelGfx.position.y = this.y
- }
- }).onComplete(h.populateScoreData).start()
- };
- f.prototype.populateScoreData = function() {
- var m = new d(this._score.toString());
- m.position.x = 272;
- m.position.y = 155;
- m.alpha = 0;
- this._gameOverContainer.addChild(m);
- var h = e.LocalStorageUtils.getNumber(e.LocalKey.SCORE, 0);
- var k;
- if (this._score > h) {
- h = this._score;
- e.LocalStorageUtils.save(e.LocalKey.SCORE, h.toString());
- k = e.Res.frame.score_new()
- }
- var l = new d(h.toString());
- l.position.x = 272;
- l.position.y = 220;
- l.alpha = 0;
- this._gameOverContainer.addChild(l);
- var j = e.MedalData.getMedalGfxFromScore(this._score);
- if (j) {
- j.position.x = 50;
- j.position.y = 155;
- j.scale.x = 0.8;
- j.scale.y = 0.8;
- j.alpha = 0;
- this._gameOverContainer.addChild(j)
- }
- if (k) {
- k.position.x = 180;
- k.position.y = 195;
- k.alpha = 0;
- this._gameOverContainer.addChild(k)
- }
- var i = this;
- this._tween = new TWEEN.Tween({alpha: 0}).to({alpha: 1}, 200).easing(TWEEN.Easing.Linear.None).onUpdate(function() {
- if (m) {
- m.alpha = this.alpha
- }
- if (l) {
- l.alpha = this.alpha
- }
- if (j) {
- j.alpha = this.alpha
- }
- if (k) {
- k.alpha = this.alpha
- }
- }).onComplete(i.showButtons).start()
- };
- f.getScoreText = function(h) {
- if (h == "0") {
- return e.Res.frame.number_0()
- }
- if (h == "1") {
- return e.Res.frame.number_1()
- }
- if (h == "2") {
- return e.Res.frame.number_2()
- }
- if (h == "3") {
- return e.Res.frame.number_3()
- }
- if (h == "4") {
- return e.Res.frame.number_4()
- }
- if (h == "5") {
- return e.Res.frame.number_5()
- }
- if (h == "6") {
- return e.Res.frame.number_6()
- }
- if (h == "7") {
- return e.Res.frame.number_7()
- }
- if (h == "8") {
- return e.Res.frame.number_8()
- }
- if (h == "9") {
- return e.Res.frame.number_9()
- }
- };
- f.prototype.showButtons = function() {
- this._playAgainButton = e.Res.frame.button_playagain();
- this._playAgainButton.position.x = (320 - this._playAgainButton.width) >> 1;
- this._playAgainButton.position.y = 300;
- this._playAgainButton.alpha = 0;
- this._playAgainRect = new PIXI.Rectangle(this._playAgainButton.position.x, this._playAgainButton.position.y, this._playAgainButton.width, this._playAgainButton.height);
- this._moreGamesButton = e.Res.frame.button_moregames();
- this._moreGamesButton.position.x = (320 - this._moreGamesButton.width) >> 1;
- this._moreGamesButton.position.y = 320;
- this._moreGamesButton.alpha = 0;
- this._moreGamesRect = new PIXI.Rectangle(this._moreGamesButton.position.x, 350, this._moreGamesButton.width, this._moreGamesButton.height);
- this._gameOverContainer.addChild(this._moreGamesButton);
- this._gameOverContainer.addChild(this._playAgainButton);
- var h = this;
- this._tween = new TWEEN.Tween({alpha: 0}).to({alpha: 1}, 200).easing(TWEEN.Easing.Linear.None).onUpdate(function() {
- if (h._playAgainButton) {
- h._playAgainButton.alpha = this.alpha
- }
- }).start();
- var i = new TWEEN.Tween({alpha: 0,y: 320}).to({alpha: 1,y: 350}, 200).delay(100).easing(TWEEN.Easing.Back.Out).onUpdate(function() {
- if (h._moreGamesButton) {
- h._moreGamesButton.alpha = this.alpha;
- h._moreGamesButton.position.y = this.y
- }
- }).onComplete(h.dispatchButtonReadyEvent).start()
- };
- f.prototype.dispatchButtonReadyEvent = function() {
- this.dispatchEvent(new e.GameEvent(e.GameEvent.GAME_OVER_BUTTON_READY))
- };
- f.prototype.setPlayAgainButtonState = function(h) {
- if (h == 1) {
- this._playAgainButton.position.y += 2;
- e.SoundManager.playSFX(e.SFXType.CLICK)
- } else {
- if (h == 2) {
- this._playAgainButton.position.y -= 2
- }
- }
- };
- f.prototype.setMoreGamesButtonState = function(h) {
- if (h == 1) {
- this._moreGamesButton.position.y += 2;
- e.SoundManager.playSFX(e.SFXType.CLICK)
- } else {
- if (h == 2) {
- this._moreGamesButton.position.y -= 2
- }
- }
- };
- Object.defineProperty(f.prototype, "playAgainRect", {get: function() {
- return this._playAgainRect
- },enumerable: true,configurable: true});
- Object.defineProperty(f.prototype, "moreGamesRect", {get: function() {
- return this._moreGamesRect
- },enumerable: true,configurable: true});
- f.prototype.update = function(h) {
- };
- f.prototype.dispose = function() {
- if (this._tween) {
- this._tween.stop();
- this._tween = null
- }
- if (this._gameOverContainer) {
- e.DisplayObjectUtils.removeAllChildren(this._gameOverContainer);
- e.DisplayObjectUtils.removeFromParent(this._gameOverContainer);
- this._gameOverContainer = null
- }
- this._gameOverText = null;
- this._scorePanelGfx = null;
- this._playAgainButton = null;
- this._playAgainRect = null;
- this._moreGamesButton = null;
- this._moreGamesRect = null
- };
- return f
- })(PIXI.EventTarget);
- e.GameOverScreen = c;
- var d = (function(g) {
- __extends(f, g);
- function f(l) {
- g.call(this);
- var j = new PIXI.DisplayObjectContainer();
- var h = 0;
- for (var k = l.length - 1; k >= 0; k--) {
- var m = c.getScoreText(l.charAt(k));
- m.position.x = h - m.width;
- j.addChild(m);
- h -= m.width - 5
- }
- this.addChild(j)
- }
- return f
- })(PIXI.DisplayObjectContainer);
- e.ScoreText = d
- })(a.goldenratio || (a.goldenratio = {}));
- var b = a.goldenratio
- })(com || (com = {}));
- var com;
- (function(a) {
- (function(d) {
- var c = (function() {
- function e(j, k) {
- this._list = [];
- this._listBG = [];
- this._lifeLeft = 5;
- this._container = j;
- this._lifeLeft = k;
- var h = 12;
- var f = 14;
- var m;
- for (m = 0; m < this._lifeLeft; m++) {
- var l = d.Res.frame.egg_nolife();
- l.scale.x = 0.6;
- l.scale.y = 0.6;
- l.anchor.x = 0.5;
- l.anchor.y = 0.5;
- l.position.x = h;
- l.position.y = f;
- l.visible = false;
- j.addChild(l);
- this._listBG.push(l);
- h += l.width + 3;
- if ((m + 1) % 5 == 0) {
- h = 12;
- f += 21
- }
- }
- h = 12;
- f = 14;
- for (m = 0; m < this._lifeLeft; m++) {
- var g = d.Res.frame.egg_life();
- g.scale.x = 0.6;
- g.scale.y = 0.6;
- g.anchor.x = 0.5;
- g.anchor.y = 0.5;
- g.position.x = h;
- g.position.y = f;
- j.addChild(g);
- h += g.width + 3;
- this._list.push(g);
- if ((m + 1) % 5 == 0) {
- h = 12;
- f += 21
- }
- }
- }
- e.prototype.reduceLife = function() {
- this._lifeLeft -= 1;
- var f = this._list[this._lifeLeft];
- if (f) {
- this._listBG[this._lifeLeft].visible = true;
- this._tween = new TWEEN.Tween({scaleValue: f.scale.x}).to({scaleValue: 0}, 200).easing(TWEEN.Easing.Quadratic.Out).onUpdate(function() {
- if (f) {
- f.scale.x = this.scaleValue;
- f.scale.y = this.scaleValue
- }
- }).onComplete(function() {
- f.visible = false
- }).start()
- }
- };
- e.prototype.dispose = function() {
- this._container = null;
- this._tween = null;
- if (this._list) {
- d.DisplayObjectUtils.removeList(this._list);
- this._list = null
- }
- if (this._listBG) {
- d.DisplayObjectUtils.removeList(this._listBG);
- this._listBG = null
- }
- };
- return e
- })();
- d.LifeLeftDisplay = c
- })(a.goldenratio || (a.goldenratio = {}));
- var b = a.goldenratio
- })(com || (com = {}));
- var com;
- (function(a) {
- (function(d) {
- var c = (function() {
- function e(f) {
- this._container = f;
- this._scoreContainer = new PIXI.DisplayObjectContainer();
- this._container.addChild(this._scoreContainer)
- }
- e.getScoreText = function(f) {
- if (f == "0") {
- return d.Res.frame.text_0()
- }
- if (f == "1") {
- return d.Res.frame.text_1()
- }
- if (f == "2") {
- return d.Res.frame.text_2()
- }
- if (f == "3") {
- return d.Res.frame.text_3()
- }
- if (f == "4") {
- return d.Res.frame.text_4()
- }
- if (f == "5") {
- return d.Res.frame.text_5()
- }
- if (f == "6") {
- return d.Res.frame.text_6()
- }
- if (f == "7") {
- return d.Res.frame.text_7()
- }
- if (f == "8") {
- return d.Res.frame.text_8()
- }
- if (f == "9") {
- return d.Res.frame.text_9()
- }
- };
- e.prototype.setScore = function(k) {
- d.DisplayObjectUtils.removeAllChildren(this._scoreContainer);
- var j = k.toString();
- var g = 0;
- for (var h = 0; h < j.length; h++) {
- var f = e.getScoreText(j.charAt(h));
- f.scale.x = 0.5;
- f.scale.y = 0.5;
- f.position.x = g;
- this._scoreContainer.addChild(f);
- g += f.width - 6
- }
- this._scoreContainer.position.x = (320 - g + 6) >> 1;
- this._scoreContainer.position.y = -4
- };
- e.prototype.hide = function() {
- var f = this;
- this._tween = new TWEEN.Tween({alpha: 1}).to({alpha: 0}, 200).easing(TWEEN.Easing.Linear.None).onUpdate(function() {
- if (f._scoreContainer) {
- f._scoreContainer.alpha = this.alpha
- }
- }).start()
- };
- e.prototype.dispose = function() {
- this._container = null;
- if (this._tween) {
- this._tween.stop();
- this._tween = null
- }
- if (this._scoreContainer) {
- d.DisplayObjectUtils.removeAllChildren(this._scoreContainer);
- d.DisplayObjectUtils.removeFromParent(this._scoreContainer);
- this._scoreContainer = null
- }
- };
- return e
- })();
- d.ScoreDisplay = c
- })(a.goldenratio || (a.goldenratio = {}));
- var b = a.goldenratio
- })(com || (com = {}));
- var com;
- (function(a) {
- (function(d) {
- var c = (function() {
- function e(f) {
- this._onState = true;
- this._container = f;
- this._soundOn = d.Res.frame.volume_on();
- this._soundOn.scale.x = 0.5;
- this._soundOn.scale.y = 0.5;
- this._soundOn.position.x = 320 - this._soundOn.width - 4;
- this._soundOn.position.y = 2;
- this._soundOn.visible = false;
- this._container.addChild(this._soundOn);
- this._soundRect = new PIXI.Rectangle(this._soundOn.position.x, this._soundOn.position.y, this._soundOn.width, this._soundOn.height);
- this._soundOff = d.Res.frame.volume_off();
- this._soundOff.scale.x = 0.5;
- this._soundOff.scale.y = 0.5;
- this._soundOff.position.x = 320 - this._soundOff.width - 4;
- this._soundOff.position.y = 2;
- this._soundOff.visible = false;
- this._container.addChild(this._soundOff);
- var g = d.LocalStorageUtils.getBoolean(d.LocalKey.SOUND_KEY, true);
- d.SoundManager.setUserMute(!g);
- this.setSoundOn(g)
- }
- e.prototype.setSoundOn = function(f) {
- this._onState = f;
- this.update()
- };
- e.prototype.toggleSound = function() {
- this._onState = !this._onState;
- d.SoundManager.setUserMute(!this._onState);
- d.LocalStorageUtils.save(d.LocalKey.SOUND_KEY, this._onState.toString());
- this.update()
- };
- e.prototype.buttonDown = function() {
- this._soundOn.position.y += 2;
- this._soundOff.position.y += 2;
- d.SoundManager.playSFX(d.SFXType.CLICK)
- };
- e.prototype.buttonUp = function() {
- this._soundOn.position.y -= 2;
- this._soundOff.position.y -= 2
- };
- e.prototype.update = function() {
- this.clear();
- if (this._onState) {
- this._soundOn.visible = true
- } else {
- this._soundOff.visible = true
- }
- };
- e.prototype.clear = function() {
- this._soundOff.visible = false;
- this._soundOn.visible = false
- };
- Object.defineProperty(e.prototype, "soundRect", {get: function() {
- return this._soundRect
- },enumerable: true,configurable: true});
- Object.defineProperty(e.prototype, "onState", {get: function() {
- return this._onState
- },enumerable: true,configurable: true});
- e.prototype.dispose = function() {
- this._container = null;
- this._soundRect = null;
- if (this._soundOn) {
- d.DisplayObjectUtils.removeFromParent(this._soundOn);
- this._soundOn = null
- }
- if (this._soundOff) {
- d.DisplayObjectUtils.removeFromParent(this._soundOff);
- this._soundOff = null
- }
- };
- return e
- })();
- d.SoundButtonDisplay = c
- })(a.goldenratio || (a.goldenratio = {}));
- var b = a.goldenratio
- })(com || (com = {}));
- var com;
- (function(a) {
- (function(d) {
- var c = (function() {
- function e(f) {
- this._tapContainer = new PIXI.DisplayObjectContainer();
- f.addChild(this._tapContainer);
- this.dispose = this.dispose.bind(this)
- }
- e.prototype.show = function() {
- var h = d.Res.frame.tap_right();
- h.scale.x = 0.6;
- h.scale.y = 0.6;
- h.position.x = 200;
- h.position.y = 400;
- var g = d.Res.frame.tap_left();
- g.scale.x = 0.6;
- g.scale.y = 0.6;
- g.position.x = 40;
- g.position.y = 400;
- this._tapContainer.addChild(g);
- this._tapContainer.addChild(h);
- var f = new PIXI.MovieClip([PIXI.Texture.fromFrame(d.Res.frame.id_tap_hand_01), PIXI.Texture.fromFrame(d.Res.frame.id_tap_hand_02)]);
- f.loop = true;
- f.animationSpeed = 0.05;
- f.gotoAndPlay(0);
- f.scale.x = 0.6;
- f.scale.y = 0.6;
- f.position.x = 125;
- f.position.y = 410;
- this._tapContainer.addChild(f)
- };
- e.prototype.hide = function() {
- var f = this;
- this._tween = new TWEEN.Tween({alpha: 1}).to({alpha: 0}, 200).easing(TWEEN.Easing.Linear.None).onUpdate(function() {
- if (f._tapContainer) {
- f._tapContainer.alpha = this.alpha
- }
- }).onComplete(f.dispose).start()
- };
- e.prototype.dispose = function() {
- if (this._tapContainer) {
- d.DisplayObjectUtils.removeAllChildren(this._tapContainer);
- d.DisplayObjectUtils.removeFromParent(this._tapContainer);
- this._tapContainer = null
- }
- };
- return e
- })();
- d.TapInfo = c
- })(a.goldenratio || (a.goldenratio = {}));
- var b = a.goldenratio
- })(com || (com = {}));
- var com;
- (function(a) {
- (function(d) {
- var c = (function(e) {
- __extends(f, e);
- function f(g) {
- e.call(this);
- this._transitionContainer = new PIXI.DisplayObjectContainer();
- g.addChild(this._transitionContainer);
- this.clear = this.clear.bind(this)
- }
- f.prototype.showScreen = function() {
- this._gfx = d.Res.frame.trans();
- this._gfx.position.x = -320;
- this._transitionContainer.addChild(this._gfx);
- var g = this;
- this._tween = new TWEEN.Tween({x: -320}).to({x: -960}, 500).easing(TWEEN.Easing.Quadratic.In).onUpdate(function() {
- if (g._gfx) {
- g._gfx.position.x = this.x
- }
- }).onComplete(function() {
- g.dispatchEvent(new d.GameEvent(d.GameEvent.SCREEN_TRANSITION_SHOW_SCREEN))
- }).start()
- };
- f.prototype.clear = function() {
- d.DisplayObjectUtils.removeAllChildren(this._transitionContainer);
- this._gfx = null
- };
- f.prototype.hideScreen = function() {
- this._gfx = d.Res.frame.trans();
- this._gfx.position.x = 320;
- this._transitionContainer.addChild(this._gfx);
- var g = this;
- this._tween = new TWEEN.Tween({x: 320}).to({x: -320}, 500).easing(TWEEN.Easing.Quadratic.Out).onUpdate(function() {
- if (g._gfx) {
- g._gfx.position.x = this.x
- }
- }).onComplete(function() {
- g.dispatchEvent(new d.GameEvent(d.GameEvent.SCREEN_TRANSITION_HIDE_SCREEN))
- }).start()
- };
- f.prototype.dispose = function() {
- if (this._tween) {
- this._tween = null
- }
- if (this._transitionContainer) {
- d.DisplayObjectUtils.removeAllChildren(this._transitionContainer);
- this._transitionContainer = null
- }
- this._gfx = null
- };
- return f
- })(PIXI.EventTarget);
- d.ScreenTransition = c
- })(a.goldenratio || (a.goldenratio = {}));
- var b = a.goldenratio
- })(com || (com = {}));
- var com;
- (function(a) {
- (function(d) {
- var c = (function() {
- function e(f) {
- this._stage = f;
- this.mapBinds();
- this.init()
- }
- e.prototype.resetProperties = function() {
- this._landBasketCount = 0;
- this._lifesLeft = 3;
- this._scoreValue = 0;
- this._canEggJump = false;
- this._showTapInfo = true;
- this._isGamePaused = false;
- this._isGameOver = false
- };
- e.prototype.init = function() {
- this.resetProperties();
- this._backgroundContainer = new PIXI.DisplayObjectContainer();
- this._stage.addChild(this._backgroundContainer);
- this._container = new PIXI.DisplayObjectContainer();
- this._container.position.x = 0;
- this._container.position.y = 460;
- this._stage.addChild(this._container);
- this._overlayContainer = new PIXI.DisplayObjectContainer();
- this._stage.addChild(this._overlayContainer);
- this._pauseContainer = new PIXI.DisplayObjectContainer();
- this._stage.addChild(this._pauseContainer);
- this.createBackground();
- this.createEgg();
- this._bucketManager = new d.BucketManager(this._container);
- this._lifeLeftDisplay = new d.LifeLeftDisplay(this._backgroundContainer, this._lifesLeft);
- this._scoreDisplay = new d.ScoreDisplay(this._backgroundContainer);
- this._scoreDisplay.setScore(this._scoreValue);
- this._soundButton = new d.SoundButtonDisplay(this._backgroundContainer);
- this._inputControl = new d.InputControl();
- this._inputControl.addEventListener(d.GameEvent.CANVAS_MOUSE_DOOWN, this.onCanvasMouseDownHL);
- this._inputControl.addEventListener(d.GameEvent.BUTTON_DOWN, this.onInputButtonDownHL);
- this._inputControl.addEventListener("ontouchstart", this.onInputButtonDownHL);
- this._inputControl.addEventListener(d.GameEvent.BUTTON_UP, this.onInputButtonUpHL);
- this._inputControl.addEventListener("ontouchend", this.onInputButtonUpHL);
- this._inputControl.setSoundButtonRect(this._soundButton.soundRect);
- this._inputControl.setEnable(false);
- this._pauseTextGfx = d.Res.frame.text_paused();
- this._pauseTextGfx.scale.x = 0.5;
- this._pauseTextGfx.scale.y = 0.5;
- this._pauseTextGfx.position.x = ((320 - this._pauseTextGfx.width) >> 1) + 5;
- this._pauseTextGfx.position.y = 110;
- this._pauseButtonGfx = d.Res.frame.pause_play_button();
- this._pauseButtonGfx.scale.x = 0.5;
- this._pauseButtonGfx.scale.y = 0.5;
- this._pauseButtonGfx.position.x = ((320 - this._pauseButtonGfx.width) >> 1) + 5;
- this._pauseButtonGfx.position.y = 200;
- this._inputControl.setPauseButtonRect(new PIXI.Rectangle(this._pauseButtonGfx.position.x, 200, this._pauseButtonGfx.width, this._pauseButtonGfx.height));
- this._gameOverScreen = new d.GameOverScreen(this._overlayContainer);
- this._gameOverScreen.addEventListener(d.GameEvent.GAME_OVER_BUTTON_READY, this.onGameOverButtonReady);
- this._tapInfo = new d.TapInfo(this._overlayContainer);
- this._screenTransition = new d.ScreenTransition(this._overlayContainer);
- this._screenTransition.addEventListener(d.GameEvent.SCREEN_TRANSITION_SHOW_SCREEN, this.onScreenTransitionShowScreen);
- this._screenTransition.addEventListener(d.GameEvent.SCREEN_TRANSITION_HIDE_SCREEN, this.onScreenTransitionHideScreen);
- window.addEventListener("blur", this.onWindowBlurHL, false);
- document.addEventListener(visibilityChange, this.handleVisiblityChange, false);
- this.setCanEggJump(true);
- this._egg.setBasketID(0);
- this._bucketManager.updateCurrentBasket(this._egg.basketID);
- this._tapInfo.show();
- this._screenTransition.showScreen()
- };
- e.prototype.handleVisiblityChange = function(f) {
- this.pauseGame();
- f.stopPropagation()
- };
- e.prototype.onWindowBlurHL = function(f) {
- this.pauseGame();
- f.stopPropagation()
- };
- e.prototype.pauseGame = function() {
- if (this._isGamePaused || this._isGameOver) {
- return
- }
- this._isGamePaused = true;
- this._pauseTextGfx.alpha = 1;
- this._pauseContainer.addChild(this._pauseTextGfx);
- this._pauseButtonGfx.alpha = 1;
- this._pauseContainer.addChild(this._pauseButtonGfx);
- this._inputControl.setGamePaused(true)
- };
- e.prototype.resumeGame = function() {
- if (!this._isGamePaused || this._isGameOver) {
- return
- }
- var f = this;
- new TWEEN.Tween({alpha: 1}).to({alpha: 0}, 170).easing(TWEEN.Easing.Linear.None).onUpdate(function() {
- if (f._pauseButtonGfx) {
- f._pauseButtonGfx.alpha = this.alpha
- }
- if (f._pauseTextGfx) {
- f._pauseTextGfx.alpha = this.alpha
- }
- }).onComplete(function() {
- f._isGamePaused = false;
- d.DisplayObjectUtils.removeAllChildren(f._pauseContainer);
- f._inputControl.setGamePaused(false)
- }).start()
- };
- e.prototype.createEgg = function() {
- this._egg = new d.Egg();
- this.addEggListeners();
- this._egg.setPosition(0, 0);
- this._container.addChild(this._egg.gfx)
- };
- e.prototype.addEggListeners = function() {
- this._egg.addEventListener(d.GameEvent.EGG_OUTOFF_BASKET, this.onEggOutOffBasket);
- this._egg.addEventListener(d.GameEvent.EGG_INSIDE_BASKET, this.onEggInsideBasket);
- this._egg.addEventListener(d.GameEvent.EGG_DIED, this.onEggDieHL);
- this._egg.addEventListener(d.GameEvent.GAME_OVER, this.onGameOverHL)
- };
- e.prototype.removeEggListeners = function() {
- this._egg.removeEventListener(d.GameEvent.EGG_OUTOFF_BASKET, this.onEggOutOffBasket);
- this._egg.removeEventListener(d.GameEvent.EGG_INSIDE_BASKET, this.onEggInsideBasket);
- this._egg.removeEventListener(d.GameEvent.EGG_DIED, this.onEggDieHL);
- this._egg.removeEventListener(d.GameEvent.GAME_OVER, this.onGameOverHL)
- };
- e.prototype.createBackground = function() {
- var f = d.Res.frame.bg();
- f.scale.x = 0.4;
- f.scale.y = 0.4;
- this._backgroundContainer.addChild(f)
- };
- e.prototype.mapBinds = function() {
- this.onCanvasMouseDownHL = this.onCanvasMouseDownHL.bind(this);
- this.onEggOutOffBasket = this.onEggOutOffBasket.bind(this);
- this.onEggInsideBasket = this.onEggInsideBasket.bind(this);
- this.onEggDieHL = this.onEggDieHL.bind(this);
- this.onGameOverHL = this.onGameOverHL.bind(this);
- this.onInputButtonUpHL = this.onInputButtonUpHL.bind(this);
- this.onInputButtonDownHL = this.onInputButtonDownHL.bind(this);
- this.onContainerScrollComplete = this.onContainerScrollComplete.bind(this);
- this.onGameOverButtonReady = this.onGameOverButtonReady.bind(this);
- this.onScreenTransitionShowScreen = this.onScreenTransitionShowScreen.bind(this);
- this.onScreenTransitionHideScreen = this.onScreenTransitionHideScreen.bind(this);
- this.onWindowBlurHL = this.onWindowBlurHL.bind(this);
- this.handleVisiblityChange = this.handleVisiblityChange.bind(this)
- };
- e.prototype.onCanvasMouseDownHL = function(f) {
- if (!this._canEggJump || !this._egg) {
- return
- }
- if (this._showTapInfo) {
- this._showTapInfo = false;
- if (this._tapInfo) {
- this._tapInfo.hide()
- }
- }
- this.setCanEggJump(false);
- this._canEggJump = false;
- this._egg.setJump(true);
- this._bucketManager.currentBasket.onEggJumpedOffBasket();
- d.SoundManager.playSFX(d.SFXType.WOOD_TAP)
- };
- e.prototype.setCanEggJump = function(f) {
- this._canEggJump = f
- };
- e.prototype.onInputButtonUpHL = function(f) {
- if (this._inputControl.isSoundButtonPressed) {
- this._soundButton.buttonUp();
- this._soundButton.toggleSound()
- } else {
- if (this._inputControl.isPlayAgainPressed) {
- this._inputControl.setEnable(false);
- this._gameOverScreen.setPlayAgainButtonState(2);
- this._screenTransition.hideScreen()
- } else {
- if (this._inputControl.isMoreGamesPressed) {
- this._gameOverScreen.setMoreGamesButtonState(2);
- //window.top.location.href = btGame.URL.getMoreGame();
- clickMore();
- } else {
- if (this._inputControl.isPauseButtonPressed) {
- this._pauseButtonGfx.position.y -= 2;
- this.resumeGame()
- }
- }
- }
- }
- };
- e.prototype.onInputButtonDownHL = function(f) {
- if (this._inputControl.isSoundButtonPressed) {
- this._soundButton.buttonDown()
- } else {
- if (this._inputControl.isPlayAgainPressed) {
- this._gameOverScreen.setPlayAgainButtonState(1)
- } else {
- if (this._inputControl.isMoreGamesPressed) {
- this._gameOverScreen.setMoreGamesButtonState(1)
- } else {
- if (this._inputControl.isPauseButtonPressed) {
- this._pauseButtonGfx.position.y += 2;
- d.SoundManager.playSFX(d.SFXType.CLICK)
- }
- }
- }
- }
- };
- e.prototype.onEggOutOffBasket = function(f) {
- if (this._bucketManager.nextBasket) {
- this._container.swapChildren(this._bucketManager.nextBasket.gfx, this._egg.gfx)
- }
- };
- e.prototype.onEggDieHL = function(f) {
- this.setCanEggJump(false);
- this._container.swapChildren(this._bucketManager.currentBasket.gfx, this._egg.gfx)
- };
- e.prototype.onGameOverHL = function(f) {
- d.SoundManager.playSFX(d.SFXType.EGG_FALL);
- this._lifesLeft -= 1;
- this._lifeLeftDisplay.reduceLife();
- if (this._lifesLeft > 0) {
- this._egg.reset();
- this._egg.setBasketID(this._bucketManager.currentBasket.id);
- this._bucketManager.currentBasket.reset();
- this._bucketManager.onEggLanded();
- this._bucketManager.currentBasket.onEggLanded();
- this.clearAndUpdateDisplayList();
- this.setCanEggJump(true)
- } else {
- this.showGameOverForReal(true)
- }
- };
- e.prototype.showGameOverForReal = function(f) {
- if (this._egg && f) {
- this._egg.dispose();
- this.removeEggListeners();
- this._egg = null
- }
- this._isGameOver = true;
- this._scoreDisplay.hide();
- this._gameOverScreen.show(this._scoreValue);
- d.SoundManager.playSFX(d.SFXType.LEVEL_COMPLETE)
- };
- e.prototype.onScreenTransitionShowScreen = function(f) {
- this._screenTransition.clear();
- this._inputControl.setEnable(true)
- };
- e.prototype.onScreenTransitionHideScreen = function(f) {
- this.clearGameArea();
- this.init()
- };
- e.prototype.onGameOverButtonReady = function(f) {
- this._inputControl.setPlayAgainRect(this._gameOverScreen.playAgainRect);
- this._inputControl.setMoreGamesRect(this._gameOverScreen.moreGamesRect)
- };
- e.prototype.clearAndUpdateDisplayList = function() {
- d.DisplayObjectUtils.removeAllChildren(this._container);
- this._container.addChild(this._egg.gfx);
- this._bucketManager.updateCurrentBasket(this._egg.basketID)
- };
- e.prototype.onEggInsideBasket = function(f) {
- if (this._bucketManager.nextBasket) {
- this._container.swapChildren(this._bucketManager.nextBasket.gfx, this._egg.gfx)
- }
- };
- e.prototype.update = function(f) {
- if (this._isGamePaused) {
- return
- }
- if (this._egg && !this._egg.hasFallenOffScreen) {
- this._egg.update(f, this._bucketManager.currentBasket, this._bucketManager.nextBasket, this._bucketManager.firstBasket);
- if (this._egg && !this._egg.hasFallenOffScreen) {
- if (this._egg.isFalling && this._egg.canLandInNextBasket && this._bucketManager.nextBasket) {
- this.landOnNextBasket()
- }
- }
- }
- if (this._bucketManager && this._egg) {
- this._bucketManager.update(f)
- }
- };
- e.prototype.landOnNextBasket = function() {
- this._landBasketCount++;
- d.SoundManager.playSFX(d.SFXType.EGG_SUCCESS);
- if (this._bucketManager.currentBasket) {
- this._egg.setBasketID(this._bucketManager.nextBasket.id);
- this._bucketManager.onEggLanded();
- this._bucketManager.updateCurrentBasket(this._egg.basketID);
- this._bucketManager.currentBasket.onEggLanded();
- this.incrementScore(1);
- if (this._bucketManager.nextBasket) {
- if (this._landBasketCount >= 2) {
- this._landBasketCount = 0;
- var f = this;
- this._tween = new TWEEN.Tween({y: this._container.position.y}).to({y: 460 - this._bucketManager.currentBasket.rect.y - this._bucketManager.currentBasket.rect.height - 20}, 500).easing(TWEEN.Easing.Quadratic.Out).delay(200).onUpdate(function() {
- if (f._container) {
- f._container.position.y = this.y
- }
- }).onComplete(this.onContainerScrollComplete).start()
- } else {
- this.setCanEggJump(true)
- }
- } else {
- this.showGameOverForReal(false)
- }
- }
- };
- e.prototype.incrementScore = function(f) {
- this._scoreValue += f;
- this._scoreDisplay.setScore(this._scoreValue)
- };
- e.prototype.onContainerScrollComplete = function() {
- this._bucketManager.onContainerScrollComplete();
- this.setCanEggJump(true)
- };
- e.prototype.clearGameArea = function() {
- window.removeEventListener("blur", this.onWindowBlurHL, false);
- document.removeEventListener(visibilityChange, this.handleVisiblityChange, false);
- if (this._tween) {
- this._tween = null
- }
- if (this._bucketManager) {
- this._bucketManager.dispose();
- this._bucketManager = null
- }
- if (this._lifeLeftDisplay) {
- this._lifeLeftDisplay.dispose();
- this._lifeLeftDisplay = null
- }
- if (this._scoreDisplay) {
- this._scoreDisplay.dispose();
- this._scoreDisplay = null
- }
- if (this._soundButton) {
- this._soundButton.dispose();
- this._soundButton = null
- }
- if (this._inputControl) {
- this._inputControl.removeEventListener(d.GameEvent.CANVAS_MOUSE_DOOWN, this.onCanvasMouseDownHL);
- this._inputControl.removeEventListener(d.GameEvent.BUTTON_DOWN, this.onInputButtonDownHL);
- this._inputControl.removeEventListener(d.GameEvent.BUTTON_UP, this.onInputButtonUpHL);
- this._inputControl.dispose();
- this._inputControl = null
- }
- if (this._egg) {
- this._egg.dispose();
- this._egg = null
- }
- if (this._gameOverScreen) {
- this._gameOverScreen.removeEventListener(d.GameEvent.GAME_OVER_BUTTON_READY, this.onGameOverButtonReady);
- this._gameOverScreen.dispose();
- this._gameOverScreen = null
- }
- if (this._tapInfo) {
- this._tapInfo.dispose();
- this._tapInfo = null
- }
- if (this._screenTransition) {
- this._screenTransition.removeEventListener(d.GameEvent.SCREEN_TRANSITION_SHOW_SCREEN, this.onScreenTransitionShowScreen);
- this._screenTransition.removeEventListener(d.GameEvent.SCREEN_TRANSITION_HIDE_SCREEN, this.onScreenTransitionHideScreen);
- this._screenTransition.dispose();
- this._screenTransition = null
- }
- d.DisplayObjectUtils.removeAllChildren(this._container);
- d.DisplayObjectUtils.removeFromParent(this._container);
- this._container = null;
- d.DisplayObjectUtils.removeAllChildren(this._backgroundContainer);
- d.DisplayObjectUtils.removeFromParent(this._backgroundContainer);
- this._backgroundContainer = null;
- d.DisplayObjectUtils.removeAllChildren(this._overlayContainer);
- d.DisplayObjectUtils.removeFromParent(this._overlayContainer);
- this._overlayContainer = null;
- d.DisplayObjectUtils.removeAllChildren(this._pauseContainer);
- d.DisplayObjectUtils.removeFromParent(this._pauseContainer);
- this._pauseContainer = null;
- this._pauseButtonGfx = null;
- this._pauseTextGfx = null
- };
- e.prototype.dispose = function() {
- this.clearGameArea();
- this._stage = null
- };
- return e
- })();
- d.GameArea = c
- })(a.goldenratio || (a.goldenratio = {}));
- var b = a.goldenratio
- })(com || (com = {}));
- var com;
- (function(a) {
- (function(d) {
- var c = (function(f) {
- __extends(e, f);
- function e(g) {
- f.call(this);
- this.mapBinds();
- this._backgroundContainer = new PIXI.DisplayObjectContainer();
- g.addChild(this._backgroundContainer);
- this._gfxContainer = new PIXI.DisplayObjectContainer();
- g.addChild(this._gfxContainer);
- this._overlayContainer = new PIXI.DisplayObjectContainer();
- g.addChild(this._overlayContainer);
- this.createBackground();
- this.createTitleGfx(false);
- var h = d.Res.frame.labrat_copyright();
- h.position.x = 5;
- h.position.y = 445;
- this._backgroundContainer.addChild(h);
- this._soundButton = new d.SoundButtonDisplay(this._backgroundContainer);
- this._inputControl = new d.InputControl();
- this._inputControl.addEventListener(d.GameEvent.BUTTON_DOWN, this.onInputButtonDownHL);
- this._inputControl.addEventListener(d.GameEvent.BUTTON_UP, this.onInputButtonUpHL);
- this._inputControl.setEnable(false);
- this._inputControl.setSoundButtonRect(this._soundButton.soundRect);
- this.createAndShowButtons(false);
- this._screenTransition = new d.ScreenTransition(this._overlayContainer);
- this._screenTransition.addEventListener(d.GameEvent.SCREEN_TRANSITION_SHOW_SCREEN, this.onScreenTransitionShowScreen);
- this._screenTransition.addEventListener(d.GameEvent.SCREEN_TRANSITION_HIDE_SCREEN, this.onScreenTransitionHideScreen);
- this._screenTransition.showScreen()
- }
- e.prototype.mapBinds = function() {
- this.onScreenTransitionShowScreen = this.onScreenTransitionShowScreen.bind(this);
- this.onScreenTransitionHideScreen = this.onScreenTransitionHideScreen.bind(this);
- this.onInputButtonUpHL = this.onInputButtonUpHL.bind(this);
- this.onInputButtonDownHL = this.onInputButtonDownHL.bind(this);
- this.showCreditsPanel = this.showCreditsPanel.bind(this);
- this.showCreditsMainMenuButton = this.showCreditsMainMenuButton.bind(this);
- this.showCreditsDone = this.showCreditsDone.bind(this);
- this.clearCreditsScreen = this.clearCreditsScreen.bind(this)
- };
- e.prototype.createBackground = function() {
- var g = d.Res.frame.bg();
- g.scale.x = 0.4;
- g.scale.y = 0.4;
- this._backgroundContainer.addChild(g)
- };
- e.prototype.createTitleGfx = function(h) {
- this._titleGfx = d.Res.frame.egg_title();
- this._titleGfx.scale.x = 0.5;
- this._titleGfx.scale.y = 0.5;
- this._titleGfx.position.x = 17;
- this._titleGfx.position.y = 50;
- if (h) {
- this._titleGfx.alpha = 0
- }
- this._gfxContainer.addChild(this._titleGfx);
- if (h) {
- var g = this;
- new TWEEN.Tween({alpha: 0}).to({alpha: 1}, 170).easing(TWEEN.Easing.Linear.None).onUpdate(function() {
- if (g._titleGfx) {
- g._titleGfx.alpha = this.alpha
- }
- }).start()
- }
- };
- e.prototype.createAndShowButtons = function(h) {
- this._playButton = d.Res.frame.button_startgame();
- this._playButton.position.x = 79;
- this._playButton.position.y = 305;
- if (h) {
- this._playButton.alpha = 0
- }
- this._gfxContainer.addChild(this._playButton);
- this._creditsButton = d.Res.frame.button_credits();
- this._creditsButton.position.x = 79;
- this._creditsButton.position.y = 370;
- if (h) {
- this._creditsButton.position.y = 315;
- this._creditsButton.alpha = 0
- }
- this._gfxContainer.addChild(this._creditsButton);
- this._playButtonRect = new PIXI.Rectangle(79, 305, this._playButton.width, this._playButton.height);
- this._creditButtonRect = new PIXI.Rectangle(79, 370, this._creditsButton.width, this._creditsButton.height);
- this._inputControl.setStartGameRect(this._playButtonRect);
- this._inputControl.setCreditsRect(this._creditButtonRect);
- if (h) {
- var g = this;
- new TWEEN.Tween({alpha: 0}).to({alpha: 1}, 200).delay(150).easing(TWEEN.Easing.Linear.None).onUpdate(function() {
- if (g._playButton) {
- g._playButton.alpha = this.alpha
- }
- }).start();
- new TWEEN.Tween({y: 315,alpha: 0}).to({y: 370,alpha: 1}, 200).delay(180).easing(TWEEN.Easing.Back.InOut).onUpdate(function() {
- if (g._creditsButton) {
- g._creditsButton.position.y = this.y;
- g._creditsButton.alpha = this.alpha
- }
- }).onComplete(function() {
- g._inputControl.setEnable(true)
- }).start()
- }
- };
- e.prototype.onInputButtonDownHL = function(g) {
- if (this._inputControl.isSoundButtonPressed) {
- this._soundButton.buttonDown()
- } else {
- if (this._inputControl.isStartGamePressed) {
- this._playButton.position.y += 2;
- d.SoundManager.playSFX(d.SFXType.CLICK)
- } else {
- if (this._inputControl.isCreditPressed) {
- this._creditsButton.position.y += 2;
- d.SoundManager.playSFX(d.SFXType.CLICK)
- } else {
- if (this._inputControl.isMainMenuPressed) {
- this._mainMenuButton.position.y += 2;
- d.SoundManager.playSFX(d.SFXType.CLICK)
- }
- }
- }
- }
- };
- e.prototype.onInputButtonUpHL = function(g) {
- if (this._inputControl.isSoundButtonPressed) {
- this._soundButton.buttonUp();
- this._soundButton.toggleSound()
- } else {
- if (this._inputControl.isStartGamePressed) {
- this._playButton.position.y -= 2;
- this.startGame()
- } else {
- if (this._inputControl.isCreditPressed) {
- this._creditsButton.position.y -= 2;
- // this.hideTitle()
- myMoreGoHome ();
- } else {
- if (this._inputControl.isMainMenuPressed) {
- this._mainMenuButton.position.y -= 2;
- this.hideCreditsScreen()
- }
- }
- }
- }
- };
- e.prototype.startGame = function() {
- this._inputControl.setEnable(false);
- this._screenTransition.hideScreen()
- };
- e.prototype.hideTitle = function() {
- this._inputControl.setEnable(false);
- var g = this;
- new TWEEN.Tween({alpha: 1}).to({alpha: 0}, 170).easing(TWEEN.Easing.Linear.None).onUpdate(function() {
- if (g._titleGfx) {
- g._titleGfx.alpha = this.alpha
- }
- }).start();
- new TWEEN.Tween({x: 79,x2: 79}).to({x: -160,x2: 430}, 200).easing(TWEEN.Easing.Quadratic.Out).onUpdate(function() {
- if (g._playButton) {
- g._playButton.position.x = this.x
- }
- if (g._creditsButton) {
- g._creditsButton.position.x = this.x2
- }
- }).onComplete(g.showCreditsPanel).start()
- };
- e.prototype.clearTitleScreen = function() {
- d.DisplayObjectUtils.removeAllChildren(this._gfxContainer);
- this._titleGfx = null;
- this._playButton = null;
- this._creditsButton = null;
- this._creditButtonRect = null;
- this._playButtonRect = null;
- this._inputControl.setStartGameRect(null);
- this._inputControl.setCreditsRect(null)
- };
- e.prototype.showCreditsPanel = function() {
- this.clearTitleScreen();
- this._creditsPanelGfx = d.Res.frame.credits_panel();
- this._creditsPanelGfx.position.x = 24;
- this._creditsPanelGfx.position.y = 90;
- this._creditsPanelGfx.alpha = 0;
- this._gfxContainer.addChild(this._creditsPanelGfx);
- var g = this;
- new TWEEN.Tween({y: 400,alpha: 0}).to({y: 90,alpha: 1}, 800).easing(TWEEN.Easing.Back.InOut).onUpdate(function() {
- if (g._creditsPanelGfx) {
- g._creditsPanelGfx.position.y = this.y;
- g._creditsPanelGfx.alpha = this.alpha
- }
- }).onComplete(g.showCreditsMainMenuButton).start()
- };
- e.prototype.showCreditsMainMenuButton = function() {
- this._mainMenuButton = d.Res.frame.button_mainmenu();
- this._mainMenuButton.position.x = 79;
- this._mainMenuButton.position.y = 335;
- this._mainMenuButton.alpha = 0;
- this._gfxContainer.addChild(this._mainMenuButton);
- this._mainMenuButtonRect = new PIXI.Rectangle(79, 335, this._mainMenuButton.width, this._mainMenuButton.height);
- var g = this;
- new TWEEN.Tween({y: 290,alpha: 0}).to({y: 335,alpha: 1}, 200).easing(TWEEN.Easing.Quadratic.Out).onUpdate(function() {
- if (g._mainMenuButton) {
- g._mainMenuButton.position.y = this.y;
- g._mainMenuButton.alpha = this.alpha
- }
- }).onComplete(g.showCreditsDone).start()
- };
- e.prototype.hideCreditsScreen = function() {
- this._inputControl.setEnable(false);
- var g = this;
- new TWEEN.Tween({alpha: 1}).to({alpha: 0}, 170).easing(TWEEN.Easing.Linear.None).onUpdate(function() {
- if (g._creditsPanelGfx) {
- g._creditsPanelGfx.alpha = this.alpha
- }
- if (g._mainMenuButton) {
- g._mainMenuButton.alpha = this.alpha
- }
- }).onComplete(g.clearCreditsScreen).start()
- };
- e.prototype.clearCreditsScreen = function() {
- d.DisplayObjectUtils.removeAllChildren(this._gfxContainer);
- this._mainMenuButton = null;
- this._mainMenuButtonRect = null;
- this._creditsPanelGfx = null;
- this._inputControl.setMainMenuRect(null);
- this.createTitleGfx(true);
- this.createAndShowButtons(true)
- };
- e.prototype.showCreditsDone = function() {
- this._inputControl.setMainMenuRect(this._mainMenuButtonRect);
- this._inputControl.setEnable(true)
- };
- e.prototype.onScreenTransitionShowScreen = function(g) {
- this._screenTransition.clear();
- this._inputControl.setEnable(true)
- };
- e.prototype.onScreenTransitionHideScreen = function(g) {
- this.dispatchEvent(new d.GameEvent(d.GameEvent.START_GAME))
- };
- e.prototype.update = function(g) {
- };
- e.prototype.dispose = function() {
- if (this._screenTransition) {
- this._screenTransition.dispose();
- this._screenTransition = null
- }
- if (this._inputControl) {
- this._inputControl.dispose();
- this._inputControl = null
- }
- if (this._soundButton) {
- this._soundButton.dispose();
- this._soundButton = null
- }
- if (this._backgroundContainer) {
- d.DisplayObjectUtils.removeAllChildren(this._backgroundContainer);
- d.DisplayObjectUtils.removeFromParent(this._backgroundContainer);
- this._backgroundContainer = null
- }
- if (this._overlayContainer) {
- d.DisplayObjectUtils.removeAllChildren(this._overlayContainer);
- d.DisplayObjectUtils.removeFromParent(this._overlayContainer);
- this._overlayContainer = null
- }
- if (this._gfxContainer) {
- d.DisplayObjectUtils.removeAllChildren(this._gfxContainer);
- d.DisplayObjectUtils.removeFromParent(this._gfxContainer);
- this._gfxContainer = null
- }
- this._titleGfx = null;
- this._creditsPanelGfx = null;
- this._playButton = null;
- this._playButtonRect = null;
- this._creditButtonRect = null;
- this._creditsButton = null;
- this._mainMenuButton = null;
- this._mainMenuButtonRect = null
- };
- return e
- })(PIXI.EventTarget);
- d.TitleScreen = c
- })(a.goldenratio || (a.goldenratio = {}));
- var b = a.goldenratio
- })(com || (com = {}));
- var com;
- (function(a) {
- (function(d) {
- var c = (function() {
- function e(f) {
- this.type = f
- }
- e.SCRIPT = new e("script");
- e.GRAPHICS = new e("graphics");
- e.SFX = new e("sfx");
- return e
- })();
- d.LoadingState = c
- })(a.goldenratio || (a.goldenratio = {}));
- var b = a.goldenratio
- })(com || (com = {}));
- var com;
- (function(a) {
- (function(e) {
- var d = (function() {
- function f() {
- this._rafDelta = new c();
- this._gameRect = new PIXI.Rectangle(0, 0, f.GAME_DIMENSION.width, f.GAME_DIMENSION.height);
- this._gameRectDesktop = new PIXI.Rectangle(0, 0, 400, 575);
- isMobileDevice = e.DeviceUtils.isMobileDevice();
- if (isMobileDevice) {
- this.resizeGameForMobile()
- } else {
- this.resizeGameForDesktop()
- }
- this.mapBinds();
- window.addEventListener("resize", this.onResizeWindowHandler, false);
- window.addEventListener("orientationchange", this.onOrientationChangeHandler, false);
- document.addEventListener("fullscreenchange", this.onFullscreenChangeHL, false);
- document.addEventListener("mozfullscreenchange", this.onFullscreenChangeHL, false);
- document.addEventListener("webkitfullscreenchange", this.onFullscreenChangeHL, false);
- document.addEventListener("msfullscreenchange", this.onFullscreenChangeHL, false);
- e.SoundManager.event.addEventListener(e.GameEvent.SOUND_LOADED, this.onSoundLoadComplete);
- e.SoundManager.event.addEventListener(e.GameEvent.SOUND_ERROR, this.onSoundLoadComplete);
- this._loader = new e.LoaderScreen();
- this._loader.addEventListener(e.GameEvent.LAUNCH_GAME, this.onLaunchGameHL);
- this._loader.updateViewPort(this._gameRect.width, this._gameRect.height);
- this.updateLoadingTextState(e.LoadingState.GRAPHICS);
- this._assetLoader = new PIXI.AssetLoader(["js/data.json"]);
- this._assetLoader.addEventListener("onComplete", this.onAssetsLoadComplete);
- this._assetLoader.load()
- }
- f.prototype.mapBinds = function() {
- this.onAssetsLoadComplete = this.onAssetsLoadComplete.bind(this);
- this.onOrientationChangeHandler = this.onOrientationChangeHandler.bind(this);
- this.onResizeWindowHandler = this.onResizeWindowHandler.bind(this);
- this.update = this.update.bind(this);
- this.onFullscreenChangeHL = this.onFullscreenChangeHL.bind(this);
- this.onLaunchGameHL = this.onLaunchGameHL.bind(this);
- this.launchStartGameFromTitle = this.launchStartGameFromTitle.bind(this);
- this.onSoundLoadComplete = this.onSoundLoadComplete.bind(this)
- };
- f.prototype.onFullscreenChangeHL = function(g) {
- if (isFullscreen()) {
- e.DeviceUtils.lockScreenToPortrait()
- }
- };
- f.prototype.onResizeWindowHandler = function(g) {
- if (isMobileDevice) {
- this.resizeGameForMobile()
- } else {
- this.resizeGameForDesktop()
- }
- };
- f.prototype.onOrientationChangeHandler = function(g) {
- if (isMobileDevice) {
- this.resizeGameForMobile()
- }
- };
- f.prototype.onAssetsLoadComplete = function(g) {
- this._assetLoader.removeEventListener("onComplete", this.onAssetsLoadComplete);
- this.updateLoadingTextState(e.LoadingState.SFX);
- e.SoundManager.init()
- };
- f.prototype.updateLoadingTextState = function(g) {
- document.getElementById("loader-message").style.display = "none";
- document.getElementById("loader-message-sfx").style.display = "none";
- document.getElementById("loader-message-graphics").style.display = "none";
- if (g == e.LoadingState.GRAPHICS) {
- document.getElementById("loader-message-graphics").style.display = "block"
- } else {
- if (g == e.LoadingState.SFX) {
- document.getElementById("loader-message-sfx").style.display = "block"
- } else {
- if (g == e.LoadingState.SCRIPT) {
- document.getElementById("loader-message").style.display = "block"
- }
- }
- }
- };
- f.prototype.onSoundLoadComplete = function(g) {
- e.SoundManager.event.removeEventListener(e.GameEvent.SOUND_LOADED, this.onSoundLoadComplete);
- e.SoundManager.event.removeEventListener(e.GameEvent.SOUND_ERROR, this.onSoundLoadComplete);
- this._loader.onLoadComplete()
- };
- f.prototype.onLaunchGameHL = function(g) {
- this.init()
- };
- f.prototype.init = function() {
- disableTouchFreeze();
- gameArea.style.display = "block";
- var h = document.getElementById("game_area");
- this._stage = new PIXI.Stage(0, false);
- var i = e.DeviceUtils.renderInWebGL();
- var g = getQueryVariable("webgl");
- if (g != null) {
- i = g == "1"
- }
- if (i) {
- this._renderer = PIXI.autoDetectRenderer(f.GAME_DIMENSION.width, f.GAME_DIMENSION.height, h, false, false)
- } else {
- this._renderer = new PIXI.CanvasRenderer(f.GAME_DIMENSION.width, f.GAME_DIMENSION.height, h, false)
- }
- this._renderer.view.style.width = this._gameRect.width + "px";
- this._renderer.view.style.height = this._gameRect.height-40 + "px";
- this.initTitleArea();
- this.onResizeWindowHandler(null);
- this._rafDelta.init();
- this.update()
- };
- f.prototype.initGamePlay = function() {
- if (this._gameArea) {
- this.disposeGameArea()
- }
- this._gameArea = new e.GameArea(this._stage)
- };
- f.prototype.disposeGameArea = function() {
- if (this._gameArea) {
- this._gameArea.dispose();
- this._gameArea = null
- }
- };
- f.prototype.initTitleArea = function() {
- if (this._titleArea) {
- this.disposeTitleArea()
- }
- this._titleArea = new e.TitleScreen(this._stage);
- this._titleArea.addEventListener(e.GameEvent.START_GAME, this.launchStartGameFromTitle)
- };
- f.prototype.disposeTitleArea = function() {
- if (this._titleArea) {
- this._titleArea.addEventListener(e.GameEvent.START_GAME, this.launchStartGameFromTitle);
- this._titleArea.dispose();
- this._titleArea = null
- }
- };
- f.prototype.launchStartGameFromTitle = function(g) {
- this.disposeTitleArea();
- this.initGamePlay()
- };
- f.prototype.update = function() {
- requestAnimFrame(this.update);
- this._rafDelta.update();
- if (this._gameArea) {
- this._gameArea.update(this._rafDelta.delta)
- }
- if (this._titleArea) {
- this._titleArea.update(this._rafDelta.delta)
- }
- if (this._renderer) {
- this._renderer.render(this._stage)
- }
- TWEEN.update()
- };
- f.prototype.resizeGameForDesktop = function() {
- this.resizeGameForMobile(this._gameRectDesktop.width, this._gameRectDesktop.height)
- };
- f.prototype.resizeGameForMobile = function(k, j) {
- var g = window.innerWidth;
- var l = window.innerHeight;
- if (k) {
- g = k
- }
- if (j) {
- l = j
- }
- var m = f.GAME_DIMENSION.width / f.GAME_DIMENSION.height;
- var i = g / l;
- if (i > m) {
- g = Math.round(l * m)
- } else {
- l = Math.round(g / m)
- }
- this._gameRect.width = g;
- this._gameRect.height = l;
- if (this._renderer) {
- this._renderer.view.style.height = l-40 + "px";
- this._renderer.view.style.width = g + "px"
- }
- gameContainer.style.width = g + "px";
- gameContainer.style.height = l-40 + "px";
- if (this._loader) {
- this._loader.updateViewPort(g, l)
- }
- var h = (window.innerHeight - l) >> 1;
- gameContainer.style.marginTop = h.toString() + "px";
- this.displayRotateDeviceInfo()
- };
- f.prototype.displayRotateDeviceInfo = function() {
- if (isMobileDevice) {
- if (e.DeviceUtils.isLandscapeMode() == true) {
- rotateDeviceInfo.style.display = "block"
- } else {
- rotateDeviceInfo.style.display = "none"
- }
- }
- };
- f.GAME_DIMENSION = new PIXI.Rectangle(0, 0, 320, 460);
- return f
- })();
- e.Main = d;
- var c = (function() {
- function f() {
- }
- f.prototype.init = function() {
- this._then = Date.now()
- };
- f.prototype.update = function() {
- this._now = Date.now();
- this.delta = (this._now - this._then) * 0.06;
- this._then = this._now;
- this.delta = (((this.delta * 100) + 0.5) >> 0) / 100;
- if (this.delta > 1) {
- this.delta = 1
- }
- };
- return f
- })();
- e.RAFDelta = c
- })(a.goldenratio || (a.goldenratio = {}));
- var b = a.goldenratio
- })(com || (com = {}));
- var gameContainer;
- var gameArea;
- var rotateDeviceInfo;
- window.addEventListener("load", onLoad, false);
- function onLoad() {
- gameContainer = document.getElementById("container");
- gameArea = document.getElementById("game_area");
- rotateDeviceInfo = document.getElementById("rotate-device-instruction");
- gameContainer.style.display = "block";
- new com.goldenratio.Main()
- }
- function disableTouchFreeze() {
-
- }
- function touchHandlerDummy(a) {
- a.preventDefault();
- return false
- }
- ;
|