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