欢迎来到程序小院
果冻跳跃
玩法:点击果冻跳跃,果冻会消失掉,果冻只能跳一个果冻的距离高度,共36关卡,
不同关卡有不同的跳板,快去闯关吧^^。
开始游戏https://www.ormcc.com/play/gameStart/265
html
<canvas id="canvas" width="320" height="480"></canvas>
css
body {
background: #fff;
color:#cccccc;
margin: 0px;
padding: 0px;
border: 0px;
}
canvas {
image-rendering: optimizeSpeed;
-webkit-interpolation-mode: nearest-neighbor;
-ms-touch-action: none;
margin: 0px;
padding: 0px;
border: 0px;
}
js
var colourBackground = "#2a2a2a";
//This is your base colour
var colourText = shadeColor('#3796E3',70);
//This is calculated from your base colour (but can be a custom HEX)
var colourLoadingBack = "#ffffff";// shadeColor('#3796E3',-10);
//This is calculated from your base colour (but can be a custom HEX)
var colourLoadingFront = "#d40700"; //shadeColor('#3796E3',-10);
//This is calculated from your base colour (but can be a custom HEX)
//Create an image to be drawn
var loadingBarImage = new Image();
loadingBarImage.src = 'html5game/load.png';
loadingBarImage.width = 250;
loadingBarImage.height = 110;
loadingBarImage.x_offset = -(loadingBarImage.width/2);
loadingBarImage.y_offset = -(loadingBarImage.height/2);
if (typeof loading_bar_smoother === 'undefined') {
var loading_bar_smoother = 0;
}
// Full screen Loading Bar (WebGL OFF)
function jchtml5_fullscreen_loading_bar(_graphics, _width, _height, _total, _current,
_loadingscreen){
_width = window.innerWidth;
_height = window.innerHeight;
_canvas = document.getElementById("canvas");
if (_canvas.width !== _width || _canvas.height !== _height)
{
// Set the canvas size
_canvas.width = _width;
_canvas.height = _height;
// Fill entire screen with colour
_graphics.fillStyle = colourBackground;
_graphics.fillRect(0, 0, _width, _height);
}
_graphics = _canvas.getContext("2d");
// Fill entire screen with colour
_graphics.fillStyle = colourBackground;
_graphics.fillRect(0, 0, _width, _height);
/*
//Draw the loading text
_graphics.fillStyle = colourText;
_graphics.font = "20px Arial";
_graphics.textAlign="center";
_graphics.fillText(toString(fillW)."%",_width / 2,(_height / 2) - 30);
*/
// Calculate loading bar position and size
var barW = Math.round(_width / 4);
var barH = Math.max(Math.round(_height / 40), 4);
var barX = Math.round((_width - barW) / 2);
var barY = Math.round((_height - barH) / 1.75);
// Draw the loading bar (full)
_graphics.fillStyle = colourLoadingBack;
_graphics.fillRect(barX, barY, barW, barH);
// Work out the completion status
var fillW = Math.round((barW / _total) * _current);
//Make the loading bar smooth
if (loading_bar_smoother < fillW){
loading_bar_smoother += 1;
}
// Draw the loading bar (current) if something has loaded
if (_current !== 0){
_graphics.fillStyle = colourLoadingFront;
_graphics.fillRect(barX, barY, loading_bar_smoother, barH);
}
//Draw the image onto the loding bar
_graphics.drawImage(loadingBarImage,_width/2+loadingBarImage.x_offset,_height/2.5+
loadingBarImage.y_offset);
}
function shadeColor(color, percent) {
var num = parseInt(color.slice(1),16), amt = Math.round(2.55 * percent), R =
(num >> 16) + amt, G = (num >> 8 & 0x00FF) + amt, B = (num & 0x0000FF) + amt;
return "#" + (0x1000000 + (R<255?R<1?0:R:255)*0x10000 + (G<255?G<1?0:G:255)*0x100 +
(B<255?B<1?0:B:255)).toString(16).slice(1);
}
function _D1(_X5, _Y5) {
global._76 = _86();
_96(global._76, "w", 11);
_96(global._76, "u", 18);
_96(global._76, "p", 3);
_96(global._76, "W", 19);
_96(global._76, "v", 13);
_96(global._76, "x", 22);
_96(global._76, "b", 23);
_96(global._76, "g", 7);
_96(global._76, "G", 15);
_96(global._76,
"o", 24);
global._a6 = 36;
global._b6 = 1;
if (!(global._c6 instanceof Array)) {
global._c6 = [];
global._c6._f1 = 1355860334
} else if (global._c6._f1 !== 1355860334) {
global._c6 = global._c6.slice(0);
global._c6._f1 = 1355860334
}
global._c6[1] = " p www www w ";
global._c6[2] = " p www WWWw w ";
global._c6[3] = " p wvvvvw wvvvw ";
global._c6[4] = " p w www w w wu wwwu ";
global._c6[5] = " b p vvvwwx x x ww ";
global._c6[6] = " p g wwww G wWw ";
global._c6[7] = " g wwbG p vvvvvu xxxwWWwww ";
global._c6[8] = " pwwww w u ww ww u wwwwwu";
global._c6[9] = " p wwWwb bvwWW v xxxx w w ";
global._c6[10] = " wwwwwW uwxwWu xxxxwu p uwwww ";
global._c6[11] = " gg Gwwvv G u p WWwu w ";
global._c6[12] = " p w wwwww wwww ww ";
global._c6[13] = " p wWvW x WWw w ";
global._c6[14] = " p v vvv v vu uvuvuv ";
global._c6[15] = " p w WWw vxv vx v ww wwv";
global._c6[16] = " p vv xx wWWWw ";
global._c6[17] = " p v g v vvGv b vvvGvu x ww ";
global._c6[18] = " p WWg wWWWWW uwww wwG w ";
global._c6[19] = " ggg www p wwwu Gvvw GG wWwww ";
global._c6[20] = " WWwWw p uWWwwb xxvvvvxx ww ";
_E1(_X5, _Y5);
}
function _E1(_X5, _Y5) {
if (!(global._c6 instanceof Array)) {
global._c6 = [];
global._c6._f1 = 1355860334
} else if (global._c6._f1 !== 1355860334) {
global._c6 = global._c6.slice(0);
global._c6._f1 = 1355860334
}
global._c6[21] = " o o w p uwWww ";
global._c6[22] = " o b wwvw xx u p owwwu ";
global._c6[23] = " WWWw pwu uwW wWw xb b wwvvv ";
global._c6[24] = " o p ww w WWW uWWw o ";
global._c6[25] = " xx bxx wvvvvw pb uvvWw w w uwww ";
global._c6[26] = " p wwwwwwg ovvvuvv oG ww ";
global._c6[27] = " o p wwwwwwwwo uwwww uwWw w ";
global._c6[28] = " g G p wwww wuwWwu wwu ";
global._c6[29] = " p wWW xxwbWWvwvv uwww ";
global._c6[30] = "o vvvWWW vuwwup vuwwwu o u ";
global._c6[31] = " x pbxb wvvvW xxxxx x wWwww ";
global._c6[32] = "o vv p GG wvvvvG gowvwwW gg wvWu ";
global._c6[33] = "o bG vwvvwvxxxxxx p gWWw wwwW wwwwo";
global._c6[34] = " p wWww wWbvxvvvv u WW wwww ";
global._c6[35] = " p wwww wwwW o o uvvvvv o o WWWWw ";
global._c6[36] = "p o wwg G vvwWw x wWw wwww Ggb wwvvo ";
}
function _F1(_X5, _Y5) {
var _d6, _e6, _f6, _g6;
_d6 = global._c6[global._b6];
_e6 = 1;
_X5._h6(global._i6);
_X5._j6(global._k6);
for (var _l6 = 0, _m6 = ~~ (48); _l6 < _m6; _l6++) {
{
_f6 = _n6(_d6, _e6);
if ((_f6 != " ")) {
{
_g6 = _o6(global._76, _f6);
_p6((_X5._w2 + 24), (_X5._x2 + 24), _g6);
}
};
_X5._h6(_X5._w2 + 48);
if ((_X5._w2 > 257)) {
{
_X5._h6(global._i6);
_X5._j6(_X5._x2 + 48);
}
};
_e6 += 1;
}
};
}
function _WK(e) {
if (_Gm != _Hm) return;
var targetid = e.target.targetid;
debug("error loading sound" + targetid);
if (targetid == undefined) {} else {
debug("AudioError: " + this.URL);
this.completed = !1;
_XK++;
ClearEventListeners(this)
}
}
function _YK(e) {
if (_Gm != _Hm) return;
var targetid = e.target.targetid;
if (_ZK) debug("sound loaded" + targetid);
if (targetid == undefined) {} else {
this.completed = !0;
ClearEventListeners(this);
try {
g_WebAudioContext.decodeAudioData(e.target.response, function(buffer) {
var __K = audio_sampledata[targetid];
__K.buffer = buffer;
_XK++
}, function(err) {
debug("error decoding audio data:" + err);
_XK++
})
} catch (_0L) {
debug("error decoding audio data: " + _0L.message);
_XK++
}
}
}
function _1L(_uC, _dn, _2L) {
var __K = audio_sampledata[_dn];
__K.buffer = null
}
function _3L(_uC, _dn, _2L, _4L) {
_uC = _5L(_uC);
if ((_Gm != _Hm) || (_6L == !1)) {
return undefined
}
var _7L;
var index;
index = _uC.indexOf(_2L);
if (index >= 0) {
_uC = _uC.substr(0, index)
}
if (_8L) {
_2L = "ogg"
} else if (_9L) {
_2L = "mp3"
} else {
_2L = "ogg"
}
_uC = _uC + "." + _2L;
var __D = new XMLHttpRequest();
__D.open('GET', _uC, !0);
__D.responseType = 'arraybuffer';
__D.targetid = _dn;
__D.URL = _uC;
__D.completed = !1;
if (_4L != undefined) {
__D.targetid = {
_aL: _4L,
_bL: _dn
};
__D.onload = _cL;
__D.onerror = _dL
} else {
__D.onload = _YK;
__D.onerror = _WK
}
__D.send();
_eL[_dn] = __D;
return _dn
}
var _fL = "Unloaded";
var _gL = "Loading";
var _hL = "Loaded";
var _iL = "Unloading";
var _jL = 0;
var _kL = [];
function _lL(_OK) {
this._3K = _OK;
this._mL = _fL;
this._nL = 0;
this._oL = 0;
this._pL = []
}
_lL.prototype._qL = function(_rL) {
this._pL.push(_rL)
};
_lL.prototype._sL = function(_tL) {
if (this._mL != _tL) {
this._mL = _tL;
debug("Audio Group " + this._3K + "-> " + this._mL);
if (_tL == _hL) {
var map = _86();
_O7._uL = map;
_96(map, "type", "audiogroup_load");
_96(map, "group_id", this._3K);
_cy._vL(_wL, 0)
}
}
};
function _cL(e) {
var targetid = this.targetid._bL;
var _xL = this.targetid._aL;
if (_ZK) debug("sound loaded " + targetid);
if (targetid != undefined) {
e.target.completed = !0;
ClearEventListeners(this);
try {
g_WebAudioContext.decodeAudioData(e.target.response, function(buffer) {
var __K = audio_sampledata[targetid];
__K.buffer = buffer;
_xL._yL()
}, function(err) {
debug("error decoding audio data:" + err);
_xL._yL()
})
} catch (_0L) {
debug("error decoding audio data: " + _0L.message);
_xL._yL()
}
}
}
function _dL(e) {
var targetid = this.targetid._bL;
var _xL = this.targetid._aL;
debug("error loading sound" + targetid);
if (targetid != undefined) {
debug("AudioError: " + this.URL);
this.completed = !1;
ClearEventListeners(this);
_xL._yL()
}
}
_lL.prototype._yL = function() {
this._nL--;
if (this._pL.length > 0) {
this._oL = ((this._pL.length - this._nL) * 100) / (this._pL.length)
}
if (this._nL <= 0) {
this._sL(_hL)
}
};
_lL.prototype._jg = function() {
if (this._mL != _fL) {
return 0
}
if (this._pL.length == 0) {
return 0
}
this._sL(_gL);
this._nL = this._pL.length;
this._oL = 0;
var _u2;
for (_u2 = 0; _u2 < this._pL.length; ++_u2) {
var index = this._pL[_u2];
if (_cv._j1[index]._Zh == 0) {
var id = _3L(_sg + _cv._j1[index]._zL, index, _cv._j1[index]._AL, this);
if (id === undefined) this._yL()
} else {
this._yL()
}
}
};
function _YJ() {
var index;
var _BL = 1;
for (index = 0; index < _cv._j1.length; index++) {
if (_cv._j1[index] !== null) {
var __K = new __J();
audio_sampledata[index] = __K;
__K.buffer = null;
var _CL = _cv._j1[index].volume;
__K.gain = _CL;
__K._0K = _CL;
__K._1K = 1.0;
__K._Zh = _cv._j1[index]._Zh;
if (_cv._j1[index].duration != undefined) {
__K.duration = _cv._j1[index].duration
}
__K._3K = 0;
var _3K = _cv._j1[index]._3K;
if (_3K != undefined) {
__K._3K = _3K
}
}
}
}
源码
需要源码请关注添加好友哦^ ^
转载:欢迎来到本站,转载请注明文章出处
https://ormcc.com/