update README
4
bounce/.gitignore
vendored
@@ -5,7 +5,7 @@
|
||||
library/
|
||||
temp/
|
||||
local/
|
||||
build/
|
||||
#build/
|
||||
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
# Logs and databases
|
||||
@@ -64,4 +64,4 @@ quick_gen_project_*_autogen.sh.meta
|
||||
# VS Code
|
||||
#//////////////////////////
|
||||
|
||||
.vscode/
|
||||
.vscode/
|
||||
|
||||
1
bounce/build/web-mobile/cocos2d-js-min.js
vendored
Normal file
54
bounce/build/web-mobile/index.html
Normal file
@@ -0,0 +1,54 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<title>Cocos Creator | PJGame</title>
|
||||
|
||||
<!--http://www.html5rocks.com/en/mobile/mobifying/-->
|
||||
<meta name="viewport"
|
||||
content="width=device-width,user-scalable=no,initial-scale=1, minimum-scale=1,maximum-scale=1"/>
|
||||
|
||||
<!--https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html-->
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||
<meta name="format-detection" content="telephone=no">
|
||||
|
||||
<!-- force webkit on 360 -->
|
||||
<meta name="renderer" content="webkit"/>
|
||||
<meta name="force-rendering" content="webkit"/>
|
||||
<!-- force edge on IE -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
|
||||
<meta name="msapplication-tap-highlight" content="no">
|
||||
|
||||
<!-- force full screen on some browser -->
|
||||
<meta name="full-screen" content="yes"/>
|
||||
<meta name="x5-fullscreen" content="true"/>
|
||||
<meta name="360-fullscreen" content="true"/>
|
||||
|
||||
<!-- force screen orientation on some browser -->
|
||||
<meta name="screen-orientation" content="portrait"/>
|
||||
<meta name="x5-orientation" content="portrait">
|
||||
|
||||
<!--fix fireball/issues/3568 -->
|
||||
<!--<meta name="browsermode" content="application">-->
|
||||
<meta name="x5-page-mode" content="app">
|
||||
|
||||
<!--<link rel="apple-touch-icon" href=".png" />-->
|
||||
<!--<link rel="apple-touch-icon-precomposed" href=".png" />-->
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="style-mobile.css"/>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<canvas id="GameCanvas" oncontextmenu="event.preventDefault()" tabindex="0"></canvas>
|
||||
<div id="splash">
|
||||
<div class="progress-bar stripes">
|
||||
<span style="width: 0%"></span>
|
||||
</div>
|
||||
</div>
|
||||
<script src="src/settings.js" charset="utf-8"></script>
|
||||
|
||||
<script src="main.js" charset="utf-8"></script>
|
||||
</body>
|
||||
</html>
|
||||
238
bounce/build/web-mobile/main.js
Normal file
@@ -0,0 +1,238 @@
|
||||
(function () {
|
||||
|
||||
function boot () {
|
||||
|
||||
var settings = window._CCSettings;
|
||||
window._CCSettings = undefined;
|
||||
|
||||
if ( !settings.debug ) {
|
||||
var uuids = settings.uuids;
|
||||
|
||||
var rawAssets = settings.rawAssets;
|
||||
var assetTypes = settings.assetTypes;
|
||||
var realRawAssets = settings.rawAssets = {};
|
||||
for (var mount in rawAssets) {
|
||||
var entries = rawAssets[mount];
|
||||
var realEntries = realRawAssets[mount] = {};
|
||||
for (var id in entries) {
|
||||
var entry = entries[id];
|
||||
var type = entry[1];
|
||||
// retrieve minified raw asset
|
||||
if (typeof type === 'number') {
|
||||
entry[1] = assetTypes[type];
|
||||
}
|
||||
// retrieve uuid
|
||||
realEntries[uuids[id] || id] = entry;
|
||||
}
|
||||
}
|
||||
|
||||
var scenes = settings.scenes;
|
||||
for (var i = 0; i < scenes.length; ++i) {
|
||||
var scene = scenes[i];
|
||||
if (typeof scene.uuid === 'number') {
|
||||
scene.uuid = uuids[scene.uuid];
|
||||
}
|
||||
}
|
||||
|
||||
var packedAssets = settings.packedAssets;
|
||||
for (var packId in packedAssets) {
|
||||
var packedIds = packedAssets[packId];
|
||||
for (var j = 0; j < packedIds.length; ++j) {
|
||||
if (typeof packedIds[j] === 'number') {
|
||||
packedIds[j] = uuids[packedIds[j]];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// init engine
|
||||
var canvas;
|
||||
|
||||
if (cc.sys.isBrowser) {
|
||||
canvas = document.getElementById('GameCanvas');
|
||||
}
|
||||
|
||||
if (false) {
|
||||
var ORIENTATIONS = {
|
||||
'portrait': 1,
|
||||
'landscape left': 2,
|
||||
'landscape right': 3
|
||||
};
|
||||
BK.Director.screenMode = ORIENTATIONS[settings.orientation];
|
||||
initAdapter();
|
||||
}
|
||||
|
||||
function setLoadingDisplay () {
|
||||
// Loading splash scene
|
||||
var splash = document.getElementById('splash');
|
||||
var progressBar = splash.querySelector('.progress-bar span');
|
||||
cc.loader.onProgress = function (completedCount, totalCount, item) {
|
||||
var percent = 100 * completedCount / totalCount;
|
||||
if (progressBar) {
|
||||
progressBar.style.width = percent.toFixed(2) + '%';
|
||||
}
|
||||
};
|
||||
splash.style.display = 'block';
|
||||
progressBar.style.width = '0%';
|
||||
|
||||
cc.director.once(cc.Director.EVENT_AFTER_SCENE_LAUNCH, function () {
|
||||
splash.style.display = 'none';
|
||||
});
|
||||
}
|
||||
|
||||
var onStart = function () {
|
||||
cc.view.resizeWithBrowserSize(true);
|
||||
|
||||
if (!false && !false) {
|
||||
// UC browser on many android devices have performance issue with retina display
|
||||
if (cc.sys.os !== cc.sys.OS_ANDROID || cc.sys.browserType !== cc.sys.BROWSER_TYPE_UC) {
|
||||
cc.view.enableRetina(true);
|
||||
}
|
||||
if (cc.sys.isBrowser) {
|
||||
setLoadingDisplay();
|
||||
}
|
||||
|
||||
if (cc.sys.isMobile) {
|
||||
if (settings.orientation === 'landscape') {
|
||||
cc.view.setOrientation(cc.macro.ORIENTATION_LANDSCAPE);
|
||||
}
|
||||
else if (settings.orientation === 'portrait') {
|
||||
cc.view.setOrientation(cc.macro.ORIENTATION_PORTRAIT);
|
||||
}
|
||||
cc.view.enableAutoFullScreen([
|
||||
cc.sys.BROWSER_TYPE_BAIDU,
|
||||
cc.sys.BROWSER_TYPE_WECHAT,
|
||||
cc.sys.BROWSER_TYPE_MOBILE_QQ,
|
||||
cc.sys.BROWSER_TYPE_MIUI,
|
||||
].indexOf(cc.sys.browserType) < 0);
|
||||
}
|
||||
|
||||
// Limit downloading max concurrent task to 2,
|
||||
// more tasks simultaneously may cause performance draw back on some android system / brwosers.
|
||||
// You can adjust the number based on your own test result, you have to set it before any loading process to take effect.
|
||||
if (cc.sys.isBrowser && cc.sys.os === cc.sys.OS_ANDROID) {
|
||||
cc.macro.DOWNLOAD_MAX_CONCURRENT = 2;
|
||||
}
|
||||
}
|
||||
|
||||
// init assets
|
||||
cc.AssetLibrary.init({
|
||||
libraryPath: 'res/import',
|
||||
rawAssetsBase: 'res/raw-',
|
||||
rawAssets: settings.rawAssets,
|
||||
packedAssets: settings.packedAssets,
|
||||
md5AssetsMap: settings.md5AssetsMap
|
||||
});
|
||||
|
||||
if (false) {
|
||||
cc.Pipeline.Downloader.PackDownloader._doPreload("WECHAT_SUBDOMAIN", settings.WECHAT_SUBDOMAIN_DATA);
|
||||
}
|
||||
|
||||
var launchScene = settings.launchScene;
|
||||
|
||||
// load scene
|
||||
cc.director.loadScene(launchScene, null,
|
||||
function () {
|
||||
if (cc.sys.isBrowser) {
|
||||
// show canvas
|
||||
canvas.style.visibility = '';
|
||||
var div = document.getElementById('GameDiv');
|
||||
if (div) {
|
||||
div.style.backgroundImage = '';
|
||||
}
|
||||
}
|
||||
cc.loader.onProgress = null;
|
||||
console.log('Success to load scene: ' + launchScene);
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
// jsList
|
||||
var jsList = settings.jsList;
|
||||
|
||||
if (false) {
|
||||
BK.Script.loadlib();
|
||||
}
|
||||
else
|
||||
{
|
||||
var bundledScript = settings.debug ? 'src/project.dev.js' : 'src/project.js';
|
||||
if (jsList) {
|
||||
jsList = jsList.map(function (x) {
|
||||
return 'src/' + x;
|
||||
});
|
||||
jsList.push(bundledScript);
|
||||
}
|
||||
else {
|
||||
jsList = [bundledScript];
|
||||
}
|
||||
}
|
||||
|
||||
// anysdk scripts
|
||||
if (cc.sys.isNative && cc.sys.isMobile) {
|
||||
jsList = jsList.concat(['src/anysdk/jsb_anysdk.js', 'src/anysdk/jsb_anysdk_constants.js']);
|
||||
}
|
||||
|
||||
var option = {
|
||||
//width: width,
|
||||
//height: height,
|
||||
id: 'GameCanvas',
|
||||
scenes: settings.scenes,
|
||||
debugMode: settings.debug ? cc.DebugMode.INFO : cc.DebugMode.ERROR,
|
||||
showFPS: (!false && !false) && settings.debug,
|
||||
frameRate: 60,
|
||||
jsList: jsList,
|
||||
groupList: settings.groupList,
|
||||
collisionMatrix: settings.collisionMatrix,
|
||||
renderMode: 0
|
||||
}
|
||||
|
||||
cc.game.run(option, onStart);
|
||||
}
|
||||
|
||||
if (false) {
|
||||
BK.Script.loadlib('GameRes://libs/qqplay-adapter.js');
|
||||
BK.Script.loadlib('GameRes://src/settings.js');
|
||||
BK.Script.loadlib();
|
||||
BK.Script.loadlib('GameRes://libs/qqplay-downloader.js');
|
||||
qqPlayDownloader.REMOTE_SERVER_ROOT = "";
|
||||
var prevPipe = cc.loader.md5Pipe || cc.loader.assetLoader;
|
||||
cc.loader.insertPipeAfter(prevPipe, qqPlayDownloader);
|
||||
// <plugin script code>
|
||||
boot();
|
||||
return;
|
||||
}
|
||||
|
||||
if (false) {
|
||||
require(window._CCSettings.debug ? 'cocos2d-js.js' : 'cocos2d-js-min.js');
|
||||
var prevPipe = cc.loader.md5Pipe || cc.loader.assetLoader;
|
||||
cc.loader.insertPipeAfter(prevPipe, wxDownloader);
|
||||
boot();
|
||||
return;
|
||||
}
|
||||
|
||||
if (window.jsb) {
|
||||
require('src/settings.js');
|
||||
require('src/jsb_polyfill.js');
|
||||
boot();
|
||||
return;
|
||||
}
|
||||
|
||||
if (window.document) {
|
||||
var splash = document.getElementById('splash');
|
||||
splash.style.display = 'block';
|
||||
|
||||
var cocos2d = document.createElement('script');
|
||||
cocos2d.async = true;
|
||||
cocos2d.src = window._CCSettings.debug ? 'cocos2d-js.js' : 'cocos2d-js-min.js';
|
||||
|
||||
var engineLoaded = function () {
|
||||
document.body.removeChild(cocos2d);
|
||||
cocos2d.removeEventListener('load', engineLoaded, false);
|
||||
window.eruda && eruda.init() && eruda.get('console').config.set('displayUnenumerable', false);
|
||||
boot();
|
||||
};
|
||||
cocos2d.addEventListener('load', engineLoaded, false);
|
||||
document.body.appendChild(cocos2d);
|
||||
}
|
||||
|
||||
})();
|
||||
1
bounce/build/web-mobile/res/import/0b/0b5feed4e.json
Normal file
BIN
bounce/build/web-mobile/res/raw-assets/bababa3.png
Executable file
|
After Width: | Height: | Size: 21 KiB |
BIN
bounce/build/web-mobile/res/raw-assets/ball.png
Executable file
|
After Width: | Height: | Size: 677 B |
BIN
bounce/build/web-mobile/res/raw-assets/ball_Boom.mp3
Normal file
BIN
bounce/build/web-mobile/res/raw-assets/bgView.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
bounce/build/web-mobile/res/raw-assets/boxBgView.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
bounce/build/web-mobile/res/raw-assets/circle_Boom.mp3
Normal file
BIN
bounce/build/web-mobile/res/raw-assets/groundBgView.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
bounce/build/web-mobile/res/raw-assets/lifeBox.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
bounce/build/web-mobile/splash.png
Normal file
|
After Width: | Height: | Size: 40 KiB |
1
bounce/build/web-mobile/src/project.js
Normal file
1
bounce/build/web-mobile/src/settings.js
Normal file
@@ -0,0 +1 @@
|
||||
window._CCSettings={platform:"web-mobile",groupList:["default","bgView","boll","box"],collisionMatrix:[[false,false,false,false],[false,false,true,true],[false,true,false,true],[false,true,true,false]],rawAssets:{assets:{"aa/aV4es1AdJlUA3gHsdCG":["bababa3.png",0],"4dtkUOdCtM76zN9MOSl+LS":["ball.png",0],"e8J8rdsf1CPI9+hUrT0ZpE":["ball_Boom.mp3",1],"4c+DAzRWZOUpEywAce7WPg":["bgView.png",0],"3fObasaRJLm6Uc1Z36fZ+7":["boxBgView.png",0],"32rPK1EDZPkZCDyz2qJu6B":["circle_Boom.mp3",1],"ddWi4ip+ZAkYr3U3SwW/8G":["groundBgView.png",0],"9cZX30zRxKQ4/wLm37XsrR":["lifeBox.png",0]}},assetTypes:["cc.Texture2D","cc.AudioClip"],launchScene:"db://assets/bounceGame.fire",scenes:[{url:"db://assets/bounceGame.fire",uuid:0}],packedAssets:{"0b5feed4e":["06SZlzMX9JzbgSJGMRioYE","16sRvk5jBGGqCKbzkJiw7t","1dWY0WNbZEfIhm1jk7tza5","3ayC2XrmpCzpOiZvavS65i","68btUeEPdKL5C2OhjnHP2+","83oRAJHONP4692DgfEbsjA","96TWNUYnxAy5TPj5Wd+Pa3",0,"eePPcWdl5AmLJ8hGsWEpmU","f0Hk2N+XFA9oJ/HrvegLw9"]},orientation:"portrait",uuids:["a0Sek3v0NEuY5P7t5wRjM0"]};
|
||||
117
bounce/build/web-mobile/style-desktop.css
Normal file
@@ -0,0 +1,117 @@
|
||||
body {
|
||||
cursor: default;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
margin: 0;
|
||||
|
||||
text-align: center;
|
||||
background-color: white;
|
||||
font-family: Helvetica, Verdana, Arial, sans-serif;
|
||||
}
|
||||
|
||||
body, canvas, div {
|
||||
outline: none;
|
||||
-moz-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-ms-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
/* Remove spin of input type number */
|
||||
input::-webkit-outer-spin-button,
|
||||
input::-webkit-inner-spin-button {
|
||||
/* display: none; <- Crashes Chrome on hover */
|
||||
-webkit-appearance: none;
|
||||
margin: 0; /* <-- Apparently some margin are still there even though it's hidden */
|
||||
}
|
||||
|
||||
#Cocos2dGameContainer {
|
||||
position: absolute;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
left: 0px;
|
||||
top: 0px;
|
||||
}
|
||||
|
||||
canvas {
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
a:link, a:visited {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
a:active, a:hover {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
p.header {
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
p.footer {
|
||||
font-size: x-small;
|
||||
}
|
||||
|
||||
#splash {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
background: #171717 url(./splash.png) no-repeat center;
|
||||
background-size: 40%;
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
background-color: #1a1a1a;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 80%;
|
||||
height: 26px;
|
||||
padding: 5px;
|
||||
width: 350px;
|
||||
margin: 0 -175px;
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 1px 5px #000 inset, 0 1px 0 #444;
|
||||
}
|
||||
|
||||
.progress-bar span {
|
||||
display: block;
|
||||
height: 100%;
|
||||
border-radius: 3px;
|
||||
box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset;
|
||||
transition: width .4s ease-in-out;
|
||||
background-color: #34c2e3;
|
||||
}
|
||||
|
||||
.stripes span {
|
||||
background-size: 30px 30px;
|
||||
background-image: linear-gradient(135deg, rgba(255, 255, 255, .15) 25%, transparent 25%,
|
||||
transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%,
|
||||
transparent 75%, transparent);
|
||||
|
||||
animation: animate-stripes 1s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes animate-stripes {
|
||||
0% {background-position: 0 0;} 100% {background-position: 60px 0;}
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #444;
|
||||
text-shadow: 3px 3px 15px;
|
||||
}
|
||||
|
||||
#GameDiv {
|
||||
width: 800px;
|
||||
height: 450px;
|
||||
margin: 0 auto;
|
||||
background: black;
|
||||
position:relative;
|
||||
border:5px solid black;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 5px 50px #333
|
||||
}
|
||||
122
bounce/build/web-mobile/style-mobile.css
Normal file
@@ -0,0 +1,122 @@
|
||||
html {
|
||||
-ms-touch-action: none;
|
||||
}
|
||||
|
||||
body, canvas, div {
|
||||
display: block;
|
||||
outline: none;
|
||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||
|
||||
-moz-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-ms-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
/* Remove spin of input type number */
|
||||
input::-webkit-outer-spin-button,
|
||||
input::-webkit-inner-spin-button {
|
||||
/* display: none; <- Crashes Chrome on hover */
|
||||
-webkit-appearance: none;
|
||||
margin: 0; /* <-- Apparently some margin are still there even though it's hidden */
|
||||
}
|
||||
|
||||
body {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
margin: 0;
|
||||
|
||||
cursor: default;
|
||||
color: #888;
|
||||
background-color: #333;
|
||||
|
||||
text-align: center;
|
||||
font-family: Helvetica, Verdana, Arial, sans-serif;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
#Cocos2dGameContainer {
|
||||
position: absolute;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
left: 0px;
|
||||
top: 0px;
|
||||
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: horizontal;
|
||||
-webkit-box-align: center;
|
||||
-webkit-box-pack: center;
|
||||
}
|
||||
|
||||
canvas {
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
a:link, a:visited {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
a:active, a:hover {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
p.header {
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
p.footer {
|
||||
font-size: x-small;
|
||||
}
|
||||
|
||||
#splash {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #171717 url(./splash.png) no-repeat center;
|
||||
background-size: 40%;
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
background-color: #1a1a1a;
|
||||
position: absolute;
|
||||
left: 25%;
|
||||
top: 80%;
|
||||
height: 15px;
|
||||
padding: 5px;
|
||||
width: 50%;
|
||||
/*margin: 0 -175px; */
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 1px 5px #000 inset, 0 1px 0 #444;
|
||||
}
|
||||
|
||||
.progress-bar span {
|
||||
display: block;
|
||||
height: 100%;
|
||||
border-radius: 3px;
|
||||
box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset;
|
||||
transition: width .4s ease-in-out;
|
||||
background-color: #34c2e3;
|
||||
}
|
||||
|
||||
.stripes span {
|
||||
background-size: 30px 30px;
|
||||
background-image: linear-gradient(135deg, rgba(255, 255, 255, .15) 25%, transparent 25%,
|
||||
transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%,
|
||||
transparent 75%, transparent);
|
||||
|
||||
animation: animate-stripes 1s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes animate-stripes {
|
||||
0% {background-position: 0 0;} 100% {background-position: 60px 0;}
|
||||
}
|
||||
3
index.html
Normal file
@@ -0,0 +1,3 @@
|
||||
<script language="javascript" type="text/javascript">
|
||||
window.location.href='./bounce/build/web-mobile/index.html ';
|
||||
</script>
|
||||