123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349 |
- var m_imageList = "brand_logo load_bar load_element number_context number_score medals blink button_ok button_start title brand_copyright ninja bg top scroll shuriken text_ready text_gameover samurai shuriken_shadow indicator gib hp_bar text_hit score_panel new".split(" "),
- m_ninjaPool, m_sumonTimer = 0,
- m_samurai, m_shuriken, m_shakingTimer = 0,
- m_shaking_y = 0,
- m_hitDisplay, m_scoreDisplay, m_scoreFont, m_hpDisplay, m_killCount = 0,
- m_notification, m_playing = !1,
- m_button_ok, m_button_start, m_shurikenIcon, m_title;
- function Ninja() {
- this.load(img_ninja, 36, 42, 0, 0, 36, 42);
- this.addAnim("run", 8, !0, [0, 1]);
- this.play("run", !0);
- this.hurtTimer = this.level = this.deadTimer = 0;
- this.reset = function (a, c, d) {
- this.visible = this.active = !0;
- this.speedy = 1 + 0.005 * m_killCount;
- this.x = Math.floor(a);
- this.y = Math.floor(c);
- this.deadTimer = 0;
- this.level = d
- };
- var a = 0;
- this.update = function (b) {
- 0 >= this.deadTimer ? (this.preUpdate(b), 0 < this.hurtTimer && (this.hurtTimer -= 0.2), this.y += this.speedy, 0 == this.currentAnim.currentFrameIndex && (this.y += this.speedy), this.y >
- SCREEN_HEIGHT && (this.visible = this.active = !1, m_shuriken.combo = 0, m_shakingTimer = 0.2, 20 <= m_hpDisplay.health && (m_hpDisplay.health -= 20, 0 >= m_hpDisplay.health && (m_shuriken.active = !1, m_shuriken.visible = !1, m_notification.reset(NOTIFY_GAME_OVER)))), m_shuriken.active && !m_shuriken.isAtHost() && 0 >= this.hurtTimer && !(this.x + this.w < m_shuriken.x || this.x > m_shuriken.x + m_shuriken.w || this.y + this.h < m_shuriken.y || this.y > m_shuriken.y + m_shuriken.h) && (a = m_shuriken.level > this.level + 1 ? this.level + 1 : m_shuriken.level, this.level -=
- a, m_shuriken.level -= a, 0 > this.level ? this.deadTimer = 1 : this.hurtTimer = 1, m_scoreContextPool.next().reset(this.x + 0.5 * this.w, this.y + 0.5 * this.h, 10 + 5 * m_shuriken.combo, !0), m_scoreDisplay.score += 10 + 5 * m_shuriken.combo, m_shuriken.onTarget()), this.postUpdate(b)) : (this.deadTimer -= 0.2, 0 >= this.deadTimer && (this.visible = this.active = !1, m_killCount++))
- };
- this.render = function (a, c, d) {
- var e = this.currentAnim.currentFrame + 2 * this.level;
- if (0 < this.deadTimer || 0 < this.hurtTimer) e = this.currentAnim.currentFrame + 6;
- c = Math.round(this.x -
- this.offsetX + c);
- d = Math.round(this.y - this.offsetY + d);
- 0 >= this.deadTimer ? a.drawImage(this.image, this.frames[e].x, this.frames[e].y, this.frameWidth, this.frameHeight, c, d, this.frameWidth, this.frameHeight) : (a.globalAlpha = this.deadTimer, a.drawImage(this.image, this.frames[e].x, this.frames[e].y, this.frameWidth, this.frameHeight, c, d, this.frameWidth, this.frameHeight), a.globalAlpha = 1)
- }
- }
- function Samurai() {
- this.load(img_samurai, 42, 48, 0, 0, 42, 48);
- this.addAnim("run", 10, !0, [0, 1]);
- this.play("run", !0);
- this.deadTimer = 0;
- this.reset = function (a, b) {
- this.visible = this.active = !0;
- this.speedy = 2;
- this.x = Math.floor(a);
- this.y = Math.floor(b);
- this.deadTimer = 0
- };
- this.update = function (a) {
- 0 >= this.deadTimer ? (this.preUpdate(a), this.y += this.speedy, 0 == this.currentAnim.currentFrameIndex && (this.y += this.speedy), this.y > SCREEN_HEIGHT - this.h && (this.visible = this.active = !1, m_sumonTimer = 0.01, m_scoreContextPool.next().reset(this.x +
- 0.5 * this.w, this.y + 0.5 * this.h, 100, !0), m_scoreDisplay.score += 100), m_shuriken.isAtHost() || this.x + this.w < m_shuriken.x || this.x > m_shuriken.x + m_shuriken.w || this.y + this.h < m_shuriken.y || this.y > m_shuriken.y + m_shuriken.h || (this.deadTimer = 1, m_shuriken.combo = 0, m_shuriken.deactive(), m_sumonTimer = 0.01), this.postUpdate(a)) : (this.deadTimer -= 0.2, 0 >= this.deadTimer && (this.visible = this.active = !1))
- };
- this.render = function (a, b, c) {
- var d = this.currentAnim.currentFrame;
- 0 < this.deadTimer && (d = this.currentAnim.currentFrame + 2);
- b =
- Math.round(this.x - this.offsetX + b);
- c = Math.round(this.y - this.offsetY + c);
- 0 >= this.deadTimer ? a.drawImage(this.image, this.frames[d].x, this.frames[d].y, this.frameWidth, this.frameHeight, b, c, this.frameWidth, this.frameHeight) : (a.globalAlpha = this.deadTimer, a.drawImage(this.image, this.frames[d].x, this.frames[d].y, this.frameWidth, this.frameHeight, b, c, this.frameWidth, this.frameHeight), a.globalAlpha = 1)
- }
- }
- function Shuriken() {
- this.load(img_shuriken, 27, 27, 0, 0, 27, 27);
- this.addAnim("spin", 240, !0, [0, 1, 2, 3]);
- this.play("spin", !0);
- this.needShadow = !0;
- this.host_x = 0.5 * SCREEN_WIDTH;
- this.host_y = SCREEN_HEIGHT - 2 * img_top.height;
- this.onHand = !1;
- this.combo = this.cosa = this.sina = 0;
- this.targeted = !1;
- this.level = 0;
- this.reset = function (a, b, c) {
- this.x = Math.floor(a);
- this.y = Math.floor(b);
- this.visible = this.active = !0;
- this.speedy = this.speedx = 0;
- this.targeted = this.onHand = !1;
- this.level = 0;
- c && (this.combo = this.cosa = this.sina = 0)
- };
- this.isAtHost =
- function () {
- return 0 == this.speedx && 0 == this.speedy
- };
- this.fireFrom = function () {
- this.isAtHost() && (this.onHand ? (10 < m_shuriken.combo ? (this.speedx = 18 * -this.cosa, this.speedy = 18 * -this.sina) : (this.speedx = 12 * -this.cosa, this.speedy = 12 * -this.sina), this.level = 40 < this.combo ? 3 : 20 < this.combo ? 2 : 1) : this.speedy = this.speedx = 0)
- };
- this.moveTo = function (a, b) {
- if (this.isAtHost()) {
- var c = m_math.sqrt((a - this.host_x) * (a - this.host_x) + (b - this.host_y) * (b - this.host_y));
- 3 < c ? (this.cosa = (a - this.host_x) / c, this.sina = (b - this.host_y) / c, this.x =
- Math.floor(this.host_x + 60 * this.cosa - 0.5 * this.h), this.y = Math.floor(this.host_y + 60 * this.sina - 0.5 * this.w), this.onHand = !0) : (this.sina = this.cosa = 0, this.x = this.host_x - 0.5 * this.w, this.y = this.host_y - 0.5 * this.h, this.onHand = !1)
- }
- };
- this.onTarget = function () {
- this.combo++;
- this.targeted = !0;
- 0 >= this.level && this.deactive()
- };
- this.deactive = function () {
- this.visible = this.active = !1;
- this.reset(this.host_x - 0.5 * this.w, this.host_y - 0.5 * this.h, !1)
- };
- this.update = function (a) {
- this.preUpdate(a);
- !this.isAtHost() && (this.x += this.speedx,
- this.y += this.speedy, 1 < this.level && (0 > this.x || this.x > SCREEN_WIDTH - this.w) && (this.speedx = -this.speedx, this.level--), this.y < -this.h || this.x < -this.w || this.y > SCREEN_HEIGHT || this.x > SCREEN_WIDTH) && (this.targeted || (this.combo = 0), this.deactive());
- this.postUpdate(a)
- };
- this.render = function (a, b, c) {
- var d = this.currentAnim.currentFrame + this.flip * this.numberOfFrames,
- e = Math.round(this.x - this.offsetX + b),
- f = Math.round(this.y - this.offsetY + c);
- if (this.isAtHost()) {
- var g = Math.floor(3 * m_heartBeat.delta);
- a.drawImage(img_indicator,
- 0, 0, 21, 21, e + 3, f + 27 + g, 21, 21);
- a.drawImage(img_indicator, 21, 0, 21, 21, e + 3, f - 21 - g, 21, 21);
- a.drawImage(img_indicator, 42, 0, 21, 21, e - 21 - g, f + 3, 21, 21);
- a.drawImage(img_indicator, 63, 0, 21, 21, e + 27 + g, f + 3, 21, 21);
- if (this.onHand)
- for (var g = (this.x + 0.5 * this.w - this.host_x) / 4, k = (this.y + 0.5 * this.h - this.host_y) / 4, h = 0; 4 > h; h++) e = Math.floor(this.host_x + g * h - this.offsetX + b - 4), f = Math.floor(this.host_y + k * h - this.offsetY + c - 4), a.drawImage(img_gib, 0, 0, 9, 9, e, f, 9, 9)
- }
- e = Math.round(this.x - this.offsetX + b);
- f = Math.round(this.y - this.offsetY + c);
- this.needShadow && a.drawImage(img_shuriken_shadow, this.frames[d].x, this.frames[d].y, this.frameWidth, this.frameHeight, e, f + 9, this.frameWidth, this.frameHeight);
- a.drawImage(this.image, this.frames[d].x, this.frames[d].y, this.frameWidth, this.frameHeight, e, f, this.frameWidth, this.frameHeight)
- }
- }
- function HitDisplay() {
- this.update = function () {};
- this.render = function (a, b, c) {
- a.drawImage(img_text_hit, b - img_text_hit.width, c + 6);
- m_scoreFont.write(a, m_shuriken.combo, b - img_text_hit.width - 3, c, !1, 4)
- }
- }
- function ScoreDisplay() {
- this.visible = !1;
- this.score = 0;
- this.render = function (a, b, c) {
- m_scoreFont.write(a, this.score, b, c, !1, 8)
- }
- }
- function HPDisplay() {
- this.health = 100;
- this.render = function (a, b, c) {
- a.drawImage(img_hp_bar, b, c);
- c = 3 * Math.floor(40 - 0.4 * this.health);
- a.fillRect(b + img_hp_bar.width - 6 - c, 12, c, 9)
- }
- }
- var NOTIFY_READY = 0,
- NOTIFY_GAME_OVER = 1;
- function ScorePanel() {
- this.tween = new dot_VarTween;
- this.visible = this.active = !1;
- this.score = this.state = 0;
- try {
- this.best = localStorage && localStorage.getItem("assaultBest") ? localStorage.assaultBest : 0
- } catch (a) {
- this.best = 0
- }
- this.needNew = !1;
- this.medal = new dot_Medal;
- this.reset = function () {
- // updateShare(m_scoreDisplay.score);
- this.x = SCREEN_WIDTH - img_score_panel.width >> 1;
- this.y = SCREEN_HEIGHT;
- this.tween.reset(this.y, SCREEN_HEIGHT - img_score_panel.height >> 1, EASE_CUBE_INOUT, 0.5);
- this.visible = this.active = !0;
- this.state =
- 0;
- this.needNew = !1;
- // Play68.setRankingScoreDesc(m_scoreDisplay.score);
- };
- this.update = function (a) {
- if (!this.tween.finished && (this.tween.update(a), 0 == this.state ? this.y = Math.floor(this.tween.delta) : this.score = Math.floor(this.tween.delta), this.tween.finished))
- if (0 == this.state) this.tween.reset(0, m_scoreDisplay.score, EASE_CUBE_INOUT, 2), this.state = 1;
- else if (1 == this.state) {
- if (this.score > this.best) {
- this.best = this.score;
- this.needNew = !0;
- try {
- localStorage && localStorage.setItem("assaultBest", this.best)
- } catch (c) {}
- }
- m_button_ok.reset(SCREEN_WIDTH - m_button_ok.w >> 1, SCREEN_HEIGHT -
- img_top.height - 60);
- m_button_ok.visible = !0;
- 2E5 <= this.score ? this.medal.reset(this.x + 48, this.y + 45, 0) : 1E5 <= this.score ? this.medal.reset(this.x + 48, this.y + 45, 1) : 5E4 <= this.score ? this.medal.reset(this.x + 48, this.y + 45, 2) : 25E3 <= this.score && this.medal.reset(this.x + 48, this.y + 45, 3)
- }
- this.medal.active && this.medal.update(a);
- m_button_ok.active && (m_button_ok.update(a), m_button_ok.justReleased && 1 == this.state && (m_effect.reset(EFFECT_FADE_IN, 0.25, 1), this.state = 2))
- };
- this.render = function (a, c, d) {
- a.drawImage(img_score_panel,
- this.x, this.y);
- m_scoreFont.write(a, this.score, this.x + 309, this.y + 33, !1, 8);
- m_scoreFont.write(a, this.best, this.x + 309, this.y + 96, !1, 8);
- this.needNew && a.drawImage(img_new, this.x + 204, this.y + 72);
- this.medal.visible && this.medal.render(a, c, d);
- m_button_ok.visible && (m_button_ok.render(a, c, d), m_shurikenIcon.preUpdate(0.03), m_shurikenIcon.x = m_button_ok.x - 9 - m_shurikenIcon.w, m_shurikenIcon.y = m_button_ok.y + 6, m_shurikenIcon.render(a, c, d), m_shurikenIcon.x = m_button_ok.x + m_button_ok.w + 9, m_shurikenIcon.y = m_button_ok.y + 6,
- m_shurikenIcon.render(a, c, d))
- }
- }
- function Notification() {
- this.textImage = null;
- this.tween = new dot_VarTween;
- this.state = 0;
- this.visible = this.active = !1;
- this.scorePanel = new ScorePanel;
- this.reset = function (a) {
- a == NOTIFY_READY ? (this.textImage = img_text_ready, this.stay = !1) : (this.textImage = img_text_gameover, this.stay = !0);
- this.tween.reset(0, 1, EASE_CUBE_INOUT, 1);
- this.state = 0;
- this.visible = this.active = !0;
- this.scorePanel.active = !1;
- this.scorePanel.visible = !1
- };
- this.update = function (a) {
- this.active && (this.tween.finished || (this.tween.update(a), this.tween.finished &&
- (0 == this.state ? (this.tween.reset(0, 1, EASE_CUBE_INOUT, 1), this.state = 1) : 1 == this.state ? this.stay ? (this.tween.reset(SCREEN_HEIGHT - img_scroll.height >> 1, (SCREEN_HEIGHT - 144 >> 1) - img_scroll.height - 18, EASE_CUBE_INOUT, 0.25), this.state = 3, this.scorePanel.reset()) : (this.tween.reset(1, 0, EASE_CUBE_INOUT, 0.5), this.state = 2) : 2 == this.state ? (this.active = this.visible = !1, m_playing = !0) : 3 == this.state && (this.state = 4))), this.scorePanel.active && this.scorePanel.update(a))
- };
- this.render = function (a, b, c) {
- this.visible && (0 == this.state ||
- 2 == this.state ? (a.globalAlpha = this.tween.delta, a.drawImage(img_scroll, SCREEN_WIDTH - img_scroll.width >> 1, SCREEN_HEIGHT - img_scroll.height >> 1), a.drawImage(this.textImage, SCREEN_WIDTH - this.textImage.width >> 1, SCREEN_HEIGHT - this.textImage.height >> 1), a.globalAlpha = 1) : 1 == this.state ? (a.drawImage(img_scroll, SCREEN_WIDTH - img_scroll.width >> 1, SCREEN_HEIGHT - img_scroll.height >> 1), a.drawImage(this.textImage, SCREEN_WIDTH - this.textImage.width >> 1, SCREEN_HEIGHT - this.textImage.height >> 1)) : 3 == this.state ? (a.drawImage(img_scroll,
- SCREEN_WIDTH - img_scroll.width >> 1, Math.floor(this.tween.delta)), a.drawImage(this.textImage, SCREEN_WIDTH - this.textImage.width >> 1, Math.floor(this.tween.delta) + (img_scroll.height - this.textImage.height >> 1)), this.scorePanel.render(a, b, c)) : 4 == this.state && (a.drawImage(img_scroll, SCREEN_WIDTH - img_scroll.width >> 1, (SCREEN_HEIGHT - 144 >> 1) - img_scroll.height - 18), a.drawImage(this.textImage, SCREEN_WIDTH - this.textImage.width >> 1, (SCREEN_HEIGHT - 144 >> 1) - img_scroll.height - 18 + (img_scroll.height - this.textImage.height >> 1)),
- this.scorePanel.render(a, b, c)))
- }
- }
- function Title() {
- this.tween = new dot_VarTween;
- this.visible = this.active = !1;
- this.w = img_title.width;
- this.h = img_title.height;
- this.x = SCREEN_WIDTH - this.w >> 1;
- this.y = -this.h;
- this.reset = function () {
- this.y = -this.h;
- this.tween.reset(-this.h, (SCREEN_HEIGHT >> 1) - this.h, EASE_CUBE_INOUT, 0.25);
- this.visible = this.active = !0;
- };
- this.update = function (a) {
- this.tween.finished || (this.tween.update(a), this.y = Math.floor(this.tween.delta))
- };
- this.render = function (a) {
- a.drawImage(img_title, this.x, this.y);
- a.drawImage(img_brand_copyright,
- SCREEN_WIDTH - img_brand_copyright.width >> 1, SCREEN_HEIGHT - (img_top.height - img_brand_copyright.height >> 1) - img_brand_copyright.height)
- }
- }
- this.gameUpdate = function (a) {
- if (m_playing) {
- if (0 < m_sumonTimer && (m_sumonTimer -= a, 0 >= m_sumonTimer)) {
- m_sumonTimer = 0.5 + 1 * Math.random();
- var b = m_ninjaPool.next(),
- c = Math.random();
- c < 0.001 * m_killCount ? b.reset(Math.random() * (SCREEN_WIDTH - b.w), -b.h, 2) : c < 0.005 * m_killCount ? b.reset(Math.random() * (SCREEN_WIDTH - b.w), -b.h, 1) : b.reset(Math.random() * (SCREEN_WIDTH - b.w), -b.h, 0)
- }
- m_samurai.active && (m_samurai.update(a), m_samurai.visible && m_samurai.render(m_fgObjectContext, 0, 0))
- }
- m_ninjaPool.update(a);
- m_ninjaPool.render(m_fgObjectContext,
- 0, 0);
- m_fgObjectContext.drawImage(img_top, Math.floor(0.5 * (SCREEN_WIDTH - img_top.width)), SCREEN_HEIGHT - img_top.height + m_shaking_y);
- m_playing && (m_scoreDisplay.visible && (m_scoreDisplay.render(m_fgObjectContext, SCREEN_WIDTH - 6, 6), 1 < m_shuriken.combo && (m_hitDisplay.update(a), m_hitDisplay.render(m_fgObjectContext, SCREEN_WIDTH - 6, SCREEN_HEIGHT - img_text_hit.height - 12)), m_hpDisplay.render(m_fgObjectContext, 6, 6)), 0 < m_shakingTimer && (m_shakingTimer -= a, m_shaking_y = 0 >= m_shakingTimer ? 0 : Math.floor(6 * Math.random())));
- m_playing && m_shuriken.active && 0 < m_hpDisplay.health && (m_shuriken.update(a), m_shuriken.render(m_fgObjectContext, 0, 0));
- m_notification.active && (m_notification.update(a), m_notification.render(m_fgObjectContext, 0, 0));
- m_button_start.active && (m_title.update(a), m_title.render(m_fgObjectContext, 0, 0), m_button_start.update(a), m_button_start.render(m_fgObjectContext, 0, 0), m_shurikenIcon.preUpdate(0.03), m_shurikenIcon.x = m_button_start.x - 9 - m_shurikenIcon.w, m_shurikenIcon.y = m_button_start.y + 6, m_shurikenIcon.render(m_fgObjectContext,
- 0, 0), m_shurikenIcon.x = m_button_start.x + m_button_start.w + 9, m_shurikenIcon.y = m_button_start.y + 6, m_shurikenIcon.render(m_fgObjectContext, 0, 0), m_button_start.justReleased && m_effect.finished && m_effect.reset(EFFECT_FADE_IN, 0.25, 3));
- m_effect.finished && (1 == m_effect.info ? (gameInit(), m_effect.reset(EFFECT_FADE_OUT, 0.25, 2)) : 3 == m_effect.info && (m_notification.reset(NOTIFY_READY), adRemove(), m_title.active = !1, m_title.visible = !1, m_button_start.active = !1, m_button_start.visible = !1, m_shuriken.reset(0.5 * (SCREEN_WIDTH -
- m_shuriken.w), SCREEN_HEIGHT - 2 * img_top.height), m_effect.reset(EFFECT_FADE_OUT, 0.25, 4)))
- };
- this.gameInit = function () {
- Ninja.prototype = new dot_Sprite;
- Ninja.prototype.constructor = Ninja;
- Samurai.prototype = new dot_Sprite;
- Samurai.prototype.constructor = Samurai;
- Shuriken.prototype = new dot_Sprite;
- Shuriken.prototype.constructor = Shuriken;
- m_scoreFont = new dot_NumberFont;
- m_scoreFont.load(img_number_score, 24, 30);
- m_scoreDisplay = new ScoreDisplay;
- m_scoreDisplay.visible = !0;
- m_scoreDisplay.score = 0;
- m_hitDisplay = new HitDisplay;
- m_hpDisplay = new HPDisplay;
- m_ninjaPool = new dot_ObjectPool;
- m_ninjaPool.create(Ninja, 30);
- m_ninjaPool.needUpdateReverse = !0;
- m_samurai = new Samurai;
- m_samurai.reset(0.5 * (SCREEN_WIDTH - m_samurai.w), -m_samurai.h);
- m_shuriken = new Shuriken;
- m_shuriken.reset(0.5 * (SCREEN_WIDTH - m_shuriken.w), SCREEN_HEIGHT - 2 * img_top.height);
- m_backgroundContext.drawImage(img_bg, 0, Math.floor(0.5 * (SCREEN_HEIGHT - img_bg.height)));
- m_notification = new Notification;
- m_button_ok = new dot_Button;
- m_button_ok.create(img_button_ok, img_button_ok.width, img_button_ok.height);
- m_button_start = new dot_Button;
- m_button_start.create(img_button_start,
- img_button_start.width, img_button_start.height);
- m_button_start.reset(SCREEN_WIDTH - m_button_start.w >> 1, SCREEN_HEIGHT - img_top.height - 60);
- m_button_start.visible = !0;
- m_title = new Title;
- m_title.reset();
- m_playing = !1;
- m_killCount = m_sumonTimer = 0;
- m_shurikenIcon = new dot_Sprite;
- m_shurikenIcon.load(img_shuriken, 27, 27, 0, 0, 27, 27);
- m_shurikenIcon.addAnim("spin", 240, !0, [0, 1, 2, 3]);
- m_shurikenIcon.play("spin", !0);
- m_shurikenIcon.reset(10, 10);
- m_fgObjectContext.fillStyle = "#000000"
- };
- this.touchPressed = function (a) {
- var b;
- 0 < a.targetTouches.length && (b = a.targetTouches[0].pageX - m_backgroundCanvas.offsetLeft, a = a.targetTouches[0].pageY - m_backgroundCanvas.offsetTop, m_shuriken.active && m_shuriken.moveTo(b, a), m_button_ok.active && b > m_button_ok.x && b < m_button_ok.x + m_button_ok.w && a > m_button_ok.y && a < m_button_ok.y + m_button_ok.h && (m_button_ok.pressing = !0), m_button_start.active && b > m_button_start.x && b < m_button_start.x + m_button_start.w && a > m_button_start.y && a < m_button_start.y + m_button_start.h && (m_button_start.pressing = !0))
- };
- this.touchReleased = function (a) {
- var b;
- 0 < a.changedTouches.length && (b = a.changedTouches[0].pageX - m_backgroundCanvas.offsetLeft, a = a.changedTouches[0].pageY - m_backgroundCanvas.offsetTop, m_shuriken && m_shuriken.active && m_shuriken.fireFrom(b, a), m_button_ok && m_button_ok.active && b > m_button_ok.x && b < m_button_ok.x + m_button_ok.w && a > m_button_ok.y && a < m_button_ok.y + m_button_ok.h && (m_button_ok.pressing = !1), m_button_start && m_button_start.active && b > m_button_start.x && b < m_button_start.x + m_button_start.w && a > m_button_start.y && a <
- m_button_start.y + m_button_start.h && (m_button_start.pressing = !1))
- };
- this.mousePressed = function (a) {
- var b;
- b = a.pageX - m_backgroundCanvas.offsetLeft;
- a = a.pageY - m_backgroundCanvas.offsetTop;
- m_shuriken && m_shuriken.active && m_shuriken.moveTo(b, a);
- m_button_ok && m_button_ok.active && b > m_button_ok.x && b < m_button_ok.x + m_button_ok.w && a > m_button_ok.y && a < m_button_ok.y + m_button_ok.h && (m_button_ok.pressing = !0);
- m_button_start && m_button_start.active && b > m_button_start.x && b < m_button_start.x + m_button_start.w && a > m_button_start.y && a < m_button_start.y + m_button_start.h && (m_button_start.pressing = !0)
- };
- this.mouseReleased = function (a) {
- var b;
- b = a.pageX - m_backgroundCanvas.offsetLeft;
- a = a.pageY - m_backgroundCanvas.offsetTop;
- m_shuriken && m_shuriken.active && m_shuriken.fireFrom(b, a);
- m_button_ok && m_button_ok.active && b > m_button_ok.x && b < m_button_ok.x + m_button_ok.w && a > m_button_ok.y && a < m_button_ok.y + m_button_ok.h && (m_button_ok.pressing = !1);
- m_button_start && m_button_start.active && b > m_button_start.x && b < m_button_start.x + m_button_start.w && a > m_button_start.y && a < m_button_start.y + m_button_start.h && (m_button_start.pressing = !1)
- };
|