更多益智类小游戏:http://www.sucaihuo.com/js/162-0-0-0
一款很欢快的html5小游戏,敲碎糖果包得到糖果去换更imba的工具,音乐和节奏会让你停不下来。
解压后直接双击打开index.html即可正常运行
游戏容器html代码
<div id="openfl-content"></div>
// Embed application, fit to best window size
var getSize = function() {
var orientation = "portrait";
var element = document.getElementById("openfl-content");
var clientWidth = element.clientWidth;
var clientHeight = element.clientHeight;
var minWidth = 320;
var minHeight = 480;
var finalWidth = minWidth;
var finalHeight = minHeight;
if (orientation == "portrait")
{
var currRatio = clientHeight / clientWidth;
var minRatio = minHeight / finalWidth;
var maxHeight = 568;
if (maxHeight == null)
maxHeight = finalHeight;
var maxRatio = maxHeight / finalWidth;
if (currRatio <= minRatio)
{
finalHeight = minHeight;
}
else if (currRatio >= maxRatio)
{
finalHeight = maxHeight;
}
else
{
finalHeight = Math.floor(finalWidth * currRatio);
}
}
else if (orientation == "landscape")
{
var currRatio = clientWidth / clientHeight;
var minRatio = minWidth / finalHeight;
var maxWidth = null;
console.log(maxWidth);
if (maxWidth == null)
maxWidth = finalWidth;
var maxRatio = maxWidth / finalHeight;
if (currRatio <= minRatio)
{
finalWidth = minWidth;
}
else if (currRatio >= maxRatio)
{
finalWidth = maxWidth;
}
else
{
finalWidth = Math.floor(finalHeight * currRatio);
}
}
return {width: finalWidth, height: finalHeight};
}
var size = getSize();
lime.embed("openfl-content", size.width, size.height, "000000");
// Resize document width to fix Samsung Galaxy stock-browser render freeze on touch bug:
if (/Android/.test(navigator.userAgent) && !(/Chrome/.test(navigator.userAgent)))
{
var ds = document.documentElement.style;
var origW = ds.width;
ds.width = "101%";
setTimeout(function() {
ds.width = origW;
}, 500);
}
系统已开启自动识别垃圾评论机制,识别到的自动封号,下载出错或者资源有问题请联系全栈客服QQ 1915635791