忍者切水果

欢迎来到程序小院

忍者切水果

玩法:点击鼠标划线切水果,避开炸弹,30秒内切开水果+10、+30,快去切水果吧^^。

开始游戏icon-default.png?t=N7T8https://www.ormcc.com/play/gameStart/273

html

<div id="fb-root"></div>
<img id="rotation" src="images/rotate.png" />
<div id="c2canvasdiv">
  <canvas style="background-image: none;" id="c2canvas" width="320"
    height="480"></canvas>
</div>

css

#sg-loadscrn{
    position:fixed; top:0;left:0;width:100%; height:100%; background-color:#fff;
    z-index:9999;
}

#sg-spinner{
	position: absolute; width: 150px; height: 50px; top:50%; left:50%; margin-top:-25px; 
  margin-left:-75px;
	background-image: url('sg-loader.gif');
}

#sg-spinner.no-img{
    background: #ffffff;
}

#sg-loadtext{
    position:absolute;
    font-family: sans-serif;
    top:50%; left:50%;
    width: 250px;
    margin-left:-125px;
    margin-top:-125px;
    text-align:center;
    line-height:150%;
    font-size:16px;
}

js

function logW() {
 console.log("window.c2_score =" + window.c2_score)
}
function isMobile() {
 if (navigator.appName == "Microsoft Internet Explorer") return true;
 var e = window.orientation;
 return e == null || e == undefined ? false : true
}
function getHighScore() {
 var e = localStorage[gameID + "high_score"];
 if ("" + e == "undefined") return "0";
 return e
}
function orientationListener() {
 if (!isMobile()) return;
 var e = window.innerWidth;
 var t = window.innerHeight;
 var n = e > t * 1.1 ? 0 : 1;
 if (n == 1) {
  document.getElementById("rotation").style.display = "none";
  document.getElementById("c2canvasdiv").style.display = "block"
 } else {
  document.getElementById("rotation").style.display = "block";
  document.getElementById("c2canvasdiv").style.display = "none"
 }
}
function easeOutBounce(e, t, n, r) {
 if ((e /= r) < 1 / 2.75) {
  return n * 7.5625 * e * e + t
 } else if (e < 2 / 2.75) {
  return n * (7.5625 * (e -= 1.5 / 2.75) * e + .75) + t
 } else if (e < 2.5 / 2.75) {
  return n * (7.5625 * (e -= 2.25 / 2.75) * e + .9375) + t
 } else {
  return n * (7.5625 * (e -= 2.625 / 2.75) * e + .984375) + t
 }
}
function integerize(e, t) {
 return Math.round(e / t * litetween_precision)
}
function easeFunc(e, t, n, r, i) {
 switch (e) {
 case 0:
  return r * t / i + n;
 case 1:
  return r * (t /= i) * t + n;
 case 2:
  return -r * (t /= i) * (t - 2) + n;
 case 3:
  if ((t /= i / 2) < 1) return r / 2 * t * t + n;
  return -r / 2 * (--t * (t - 2) - 1) + n;
 case 4:
  return r * (t /= i) * t * t + n;
 case 5:
  return r * ((t = t / i - 1) * t * t + 1) + n;
 case 6:
  if ((t /= i / 2) < 1) return r / 2 * t * t * t + n;
  return r / 2 * ((t -= 2) * t * t + 2) + n;
 case 7:
  return r * (t /= i) * t * t * t + n;
 case 8:
  return -r * ((t = t / i - 1) * t * t * t - 1) + n;
 case 9:
  if ((t /= i / 2) < 1) return r / 2 * t * t * t * t + n;
  return -r / 2 * ((t -= 2) * t * t * t - 2) + n;
 case 10:
  return r * (t /= i) * t * t * t * t + n;
 case 11:
  return r * ((t = t / i - 1) * t * t * t * t + 1) + n;
 case 12:
  if ((t /= i / 2) < 1) return r / 2 * t * t * t * t * t + n;
  return r / 2 * ((t -= 2) * t * t * t * t + 2) + n;
 case 13:
  return easeInCircle[integerize(t, i)];
 case 14:
  return easeOutCircle[integerize(t, i)];;
 case 15:
  return easeInOutCircle[integerize(t, i)];;
 case 16:
  var s = 0;
  if (s == 0) s = 1.70158;
  return r * (t /= i) * t * ((s + 1) * t - s) + n;
 case 17:
  return easeOutBack[integerize(t, i)];
 case 18:
  return easeInOutBack[integerize(t, i)];
 case 19:
  return easeInElasticArray[integerize(t, i)];
 case 20:
  return easeOutElasticArray[integerize(t, i)];
 case 21:
  return easeInOutElasticArray[integerize(t, i)];
 case 22:
  return r - easeOutBounceArray[integerize(i - t, i)] + n;
 case 23:
  return easeOutBounceArray[integerize(t, i)];
 case 24:
  if (t < i / 2) return (r - easeOutBounceArray[integerize(i - t * 2, i)] + n) * 
    .5 + n;
  else return easeOutBounceArray[integerize(t * 2 - i, i)] * .5 + r * .5 + n;
 case 25:
  var o = t / i / 2;
  return 2 * o * o * (3 - 2 * o);
 case 26:
  var o = (t / i + 1) / 2;
  return 2 * o * o * (3 - 2 * o) - 1;
 case 27:
  var o = t / i;
  return o * o * (3 - 2 * o)
 }
 return 0
}
function trim(e) {
 return e.replace(/^\s\s*/, "").replace(/\s\s*$/, "")
}
function startCutting() {
 kye();
}
function kye() {
 function t() {
  if (document.hidden || document.mozHidden || document.webkitHidden ||
    document.msHidden) cr_setSuspended(true);
  else cr_setSuspended(false)
 }
 var e = function() {
   cr_sizeCanvas(jQuery(window).width(), jQuery(window).height())
  };
 jQuery(window).resize(e);
 SG.setOrientationHandler(e);
 SG.setResizeHandler(e);
 cr_createRuntime("c2canvas");
 document.addEventListener("visibilitychange", t, false);
 document.addEventListener("mozvisibilitychange", t, false);
 document.addEventListener("webkitvisibilitychange", t, false);
 document.addEventListener("msvisibilitychange", t, false)
}
var gameID = "fruit_cut_ninja_";
document.getElementById("rotation").style.display = "none";
var cr = {};
cr.plugins_ = {};
cr.behaviors = {};
if (typeof Object.getPrototypeOf !== "function") {
 if (typeof "test".__proto__ === "object") {
  Object.getPrototypeOf = function(e) {
   return e.__proto__
  }
 } else {
  Object.getPrototypeOf = function(e) {
   return e.constructor.prototype
  }
 }
}(function() {
 function e(e, t) {
  this.x = e;
  this.y = t;
  cr.seal(this)
 }
 function t(e, t, n, r) {
  this.set(e, t, n, r);
  cr.seal(this)
 }
 function n() {
  this.tlx = 0;
  this.tly = 0;
  this.trx = 0;
  this.try_ = 0;
  this.brx = 0;
  this.bry = 0;
  this.blx = 0;
  this.bly = 0;
  cr.seal(this)
 }
 function s() {
  if (i) {
   this.s = new Set
  } else {
   this.items = {};
   this.item_count = 0
  }
  this.values_cache = [];
  this.cache_valid = true;
  cr.seal(this)
 }
 function a(e) {
  o[u++] = e
 }
 function f() {
  this.c = 0;
  this.y = 0;
  this.t = 0;
  this.sum = 0;
  cr.seal(this)
 }
 function l(e) {
  this.pts_cache = [];
  this.set_pts(e);
  cr.seal(this)
 }
 cr.logexport = function(e) {
  if (window.console && window.console.log) window.console.log(e)
 };
 cr.seal = function(e) {
  return e
 };
 cr.freeze = function(e) {
  return e
 };
 cr.is_undefined = function(e) {
  return typeof e === "undefined"
 };
 cr.is_number = function(e) {
  return typeof e === "number"
 };
 cr.is_string = function(e) {
  return typeof e === "string"
 };
 cr.isPOT = function(e) {
  return e > 0 && (e - 1 & e) === 0
 };
 cr.abs = function(e) {
  return e < 0 ? -e : e
 };
 cr.max = function(e, t) {
  return e > t ? e : t
 };
 cr.min = function(e, t) {
  return e < t ? e : t
 };
 cr.PI = Math.PI;
 cr.round = function(e) {
  return e + .5 | 0
 };
 cr.floor = function(e) {
  return e | 0
 };
 e.prototype.offset = function(e, t) {
  this.x += e;
  this.y += t;
  return this
 };
 e.prototype.mul = function(e, t) {
  this.x *= e;
  this.y *= t;
  return this
 };
 cr.vector2 = e;
 cr.segments_intersect = function(e, t, n, r, i, s, o, u) {
  if (cr.max(e, n) < cr.min(i, o) || cr.min(e, n) > cr.max(i, o) || cr.max(t, r)
    < cr.min(s, u) || cr.min(t, r) > cr.max(s, u)) {
   return false
  }
  var a = i - e + o - n;
  var f = s - t + u - r;
  var l = n - e;
  var c = r - t;
  var h = o - i;
  var p = u - s;
  var d = cr.abs(c * h - p * l);
  var v = h * f - p * a;
  var m = l * f - c * a;
  return cr.abs(v) <= d && cr.abs(m) <= d
 };
 t.prototype.set = function(e, t, n, r) {
  this.left = e;
  this.top = t;
  this.right = n;
  this.bottom = r
 };
 t.prototype.width = function() {
  return this.right - this.left
 };
 t.prototype.height = function() {
  return this.bottom - this.top
 };
 t.prototype.offset = function(e, t) {
  this.left += e;
  this.top += t;
  this.right += e;
  this.bottom += t;
  return this
 };
 t.prototype.intersects_rect = function(e) {
  return !(e.right < this.left || e.bottom < this.top || e.left > this.right || 
    e.top > this.bottom)
 };
 t.prototype.contains_pt = function(e, t) {
  return e >= this.left && e <= this.right && t >= this.top && t <= this.bottom
 };
 cr.rect = t;
 n.prototype.set_from_rect = function(e) {
  this.tlx = e.left;
  this.tly = e.top;
  this.trx = e.right;
  this.try_ = e.top;
  this.brx = e.right;
  this.bry = e.bottom;
  this.blx = e.left;
  this.bly = e.bottom
 };
 n.prototype.set_from_rotated_rect = function(e, t) {
  if (t === 0) {
   this.set_from_rect(e)
  } else {
   var n = Math.sin(t);
   var r = Math.cos(t);
   var i = e.left * n;
   var s = e.top * n;
   var o = e.right * n;
   var u = e.bottom * n;
   var a = e.left * r;
   var f = e.top * r;
   var l = e.right * r;
   var c = e.bottom * r;
   this.tlx = a - s;
   this.tly = f + i;
   this.trx = l - s;
   this.try_ = f + o;
   this.brx = l - u;
   this.bry = c + o;
   this.blx = a - u;
   this.bly = c + i
  }
 };
 n.prototype.offset = function(e, t) {
  this.tlx += e;
  this.tly += t;
  this.trx += e;
  this.try_ += t;
  this.brx += e;
  this.bry += t;
  this.blx += e;
  this.bly += t;
  return this
 };
 n.prototype.bounding_box = function(e) {
  e.left = cr.min(cr.min(this.tlx, this.trx), cr.min(this.brx, this.blx));
  e.top = cr.min(cr.min(this.tly, this.try_), cr.min(this.bry, this.bly));
  e.right = cr.max(cr.max(this.tlx, this.trx), cr.max(this.brx, this.blx));
  e.bottom = cr.max(cr.max(this.tly, this.try_), cr.max(this.bry, this.bly))
 };
 n.prototype.contains_pt = function(e, t) {
  var n = this.trx - this.tlx;
  var r = this.try_ - this.tly;
  var i = this.brx - this.tlx;
  var s = this.bry - this.tly;
  var o = e - this.tlx;
  var u = t - this.tly;
  var a = n * n + r * r;
  var f = n * i + r * s;
  var l = n * o + r * u;
  var c = i * i + s * s;
  var h = i * o + s * u;
  var p = 1 / (a * c - f * f);
  var d = (c * l - f * h) * p;
  var v = (a * h - f * l) * p;
  if (d >= 0 && v > 0 && d + v < 1) return true;
  n = this.blx - this.tlx;
  r = this.bly - this.tly;
  var a = n * n + r * r;
  var f = n * i + r * s;
  var l = n * o + r * u;
  p = 1 / (a * c - f * f);
  d = (c * l - f * h) * p;
  v = (a * h - f * l) * p;
  return d >= 0 && v > 0 && d + v < 1
 };
 n.prototype.at = function(e, t) {
  switch (e) {
  case 0:
   return t ? this.tlx : this.tly;
  case 1:
   return t ? this.trx : this.try_;
  case 2:
   return t ? this.brx : this.bry;
  case 3:
   return t ? this.blx : this.bly;
  case 4:
   return t ? this.tlx : this.tly;
  default:
   return t ? this.tlx : this.tly
  }
 };
 n.prototype.midX = function() {
  return (this.tlx + this.trx + this.brx + this.blx) / 4
 };
 n.prototype.midY = function() {
  return (this.tly + this.try_ + this.bry + this.bly) / 4
 };
 n.prototype.intersects_segment = function(e, t, n, r) {
  if (this.contains_pt(e, t) || this.contains_pt(n, r)) return true;
  var i, s, o, u;
  var a;
  for (a = 0; a < 4; a++) {
   i = this.at(a, true);
   s = this.at(a, false);
   o = this.at(a + 1, true);
   u = this.at(a + 1, false);
   if (cr.segments_intersect(e, t, n, r, i, s, o, u)) return true
  }
  return false
 };
 n.prototype.intersects_quad = function(e) {
  var t = e.midX();
  var n = e.midY();
  if (this.contains_pt(t, n)) return true;
  t = this.midX();
  n = this.midY();
  if (e.contains_pt(t, n)) return true;
  var r, i, s, o, u, a, f, l;
  var c, h;
  for (c = 0; c < 4; c++) {
   for (h = 0; h < 4; h++) {
    r = this.at(c, true);
    i = this.at(c, false);
    s = this.at(c + 1, true);
    o = this.at(c + 1, false);
    u = e.at(h, true);
    a = e.at(h, false);
    f = e.at(h + 1, true);
    l = e.at(h + 1, false);
    if (cr.segments_intersect(r, i, s, o, u, a, f, l)) return true
   }
  }
  return false
 };
 cr.quad = n;
 cr.RGB = function(e, t, n) {
  return Math.max(Math.min(e, 255), 0) | Math.max(Math.min(t, 255), 0) << 8 | 
    Math.max(Math.min(n, 255), 0) << 16
 };
 cr.GetRValue = function(e) {
  return e & 255
 };
 cr.GetGValue = function(e) {
  return (e & 65280) >> 8
 };
 cr.GetBValue = function(e) {
  return (e & 16711680) >> 16
 };
 cr.shallowCopy = function(e, t, n) {
  var r;
  for (r in t) {
   if (t.hasOwnProperty(r)) {
    e[r] = t[r]
   }
  }
  return e
 };
 cr.arrayRemove = function(e, t) {
  var n, r;
  t = cr.floor(t);
  if (t < 0 || t >= e.length) return;
  if (t === 0) e.shift();
  else if (t === e.length - 1) e.pop();
  else {
   for (n = t, r = e.length - 1; n < r; n++) e[n] = e[n + 1];
   e.length = r
  }
 };
 cr.shallowAssignArray = function(e, t) {
  e.length = t.length;
  var n, r;
  for (n = 0, r = t.length; n < r; n++) e[n] = t[n]
 };
 cr.arrayFindRemove = function(e, t) {
  var n = e.indexOf(t);
  if (n !== -1) cr.arrayRemove(e, n)
 };
 cr.clamp = function(e, t, n) {
  if (e < t) return t;
  else if (e > n) return n;
  else return e
 };
 cr.to_radians = function(e) {
  return e / (180 / cr.PI)
 };
 cr.to_degrees = function(e) {
  return e * (180 / cr.PI)
 };
 cr.clamp_angle_degrees = function(e) {
  e %= 360;
  if (e < 0) e += 360;
  return e
 };
 cr.clamp_angle = function(e) {
  e %= 2 * cr.PI;
  if (e < 0) e += 2 * cr.PI;
  return e
 };
 cr.to_clamped_degrees = function(e) {
  return cr.clamp_angle_degrees(cr.to_degrees(e))
 };
 cr.to_clamped_radians = function(e) {
  return cr.clamp_angle(cr.to_radians(e))
 };
 cr.angleTo = function(e, t, n, r) {
  var i = n - e;
  var s = r - t;
  return Math.atan2(s, i)
 };
 cr.angleDiff = function(e, t) {
  if (e === t) return 0;
  var n = Math.sin(e);
  var r = Math.cos(e);
  var i = Math.sin(t);
  var s = Math.cos(t);
  var o = n * i + r * s;
  if (o >= 1) return 0;
  if (o <= -1) return cr.PI;
  return Math.acos(o)
 };
 cr.angleRotate = function(e, t, n) {
  var r = Math.sin(e);
  var i = Math.cos(e);
  var s = Math.sin(t);
  var o = Math.cos(t);
  if (Math.acos(r * s + i * o) > n) {
   if (i * s - r * o > 0) return cr.clamp_angle(e + n);
   else return cr.clamp_angle(e - n)
  } else return cr.clamp_angle(t)
 };
 cr.angleClockwise = function(e, t) {
  var n = Math.sin(e);
  var r = Math.cos(e);
  var i = Math.sin(t);
  var s = Math.cos(t);
  return r * i - n * s <= 0
 };

源码

需要源码请关注添加好友哦^ ^

转载:欢迎来到本站,转载请注明文章出处https://ormcc.com/

  • 17
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值