Commit 77d9b53f authored by 任建锋's avatar 任建锋

叠叠高2

parent 63f612c5
/**
* Created by rockyl on 2019-12-16.
*/
const customId = 'jump-high';
(async function () {
let customModule = await fetch(`../meta.json`);
customModule = await customModule.json();
console.log(customModule);
await loadAssets(customModule.assets);
launchWithCustomModule(customModule);
})();
function launchWithCustomModule(customModule) {
engine.globalEvent.addEventListener('update-game-status', (e) => {
console.log(e.type, e.data);
});
//engine.registerCustomCodeModule(customModule);
engine.registerCustomModule(customId, window[customId]);
const {props: propsOption, assets} = customModule;
let props = engine.computeProps(customModuleProps, propsOption);
const customModuleIns = {
id: customId,
props,
assets,
};
engine.registerCustomModules([customModuleIns]);
engine.launchWithConfig({
options: {
entrySceneView: 'entry',
},
assets: [],
views: [{
name: 'entry',
type: 'node',
}],
}, null, function () {
setTimeout(() => {
engine.addCustomModule(customId, engine.gameStage.sceneContainer.getChildAt(0));
}, 100);
setTimeout(() => {
engine.globalEvent.dispatchEvent('jump-high-start', {level: 1});
}, 500);
});
}
function getAssetByUUID(uuid) {
return engine.resolveCustomAsset(customId, uuid);
}
function getProps() {
return engine.getProps(customId);
}
/**
* Created by rockyl on 2019-12-16.
*/
const customId = 'jump-high-2';
(async function () {
let customModule = await fetch(`../meta.json`);
customModule = await customModule.json();
console.log(customModule);
await loadAssets(customModule.assets);
launchWithCustomModule(customModule);
})();
function launchWithCustomModule(customModule) {
engine.globalEvent.addEventListener('update-game-status', (e) => {
console.log(e.type, e.data);
});
//engine.registerCustomCodeModule(customModule);
engine.registerCustomModule(customId, window[customId]);
const {props: propsOption, assets} = customModule;
let props = engine.computeProps(customModuleProps, propsOption);
const customModuleIns = {
id: customId,
props,
assets,
};
engine.registerCustomModules([customModuleIns]);
engine.launchWithConfig({
options: {
entrySceneView: 'entry',
},
assets: [],
views: [{
name: 'entry',
type: 'node',
}],
}, null, function () {
setTimeout(() => {
engine.addCustomModule(customId, engine.gameStage.sceneContainer.getChildAt(0));
}, 100);
setTimeout(() => {
engine.globalEvent.dispatchEvent('jump-high-start', {level: 1});
}, 500);
});
}
function getAssetByUUID(uuid) {
return engine.resolveCustomAsset(customId, uuid);
}
function getProps() {
return engine.getProps(customId);
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>叠叠高</title>
<meta name="viewport"
content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="full-screen" content="true"/>
<meta name="screen-orientation" content="portrait"/>
<meta name="x5-fullscreen" content="true"/>
<meta name="360-fullscreen" content="true"/>
<style>
html,
body {
padding: 0;
margin: 0;
border: 0;
width: 100%;
height: 100%;
overflow: hidden;
position: absolute;
background-color: transparent;
}
</style>
</head>
<body>
<div id="game-container" style="line-height:0;font-size:0"></div>
<script src="http://localhost:4002/debug/engine.js"></script>
<script src="http://localhost:4003/debug/engine-svga.js"></script>
<!--<script src="//yun.duiba.com.cn/editor/zeroing/libs/engine.9a9dbfda4cb2dd5508ecddfe3d95dfd88063f7b5.js"></script>-->
<script src="app.js"></script>
<script src="props.js"></script>
<script src="load-assets.js"></script>
<script src="main.js"></script>
<script>
</script>
</body>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>叠叠高</title>
<meta name="viewport"
content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="full-screen" content="true"/>
<meta name="screen-orientation" content="portrait"/>
<meta name="x5-fullscreen" content="true"/>
<meta name="360-fullscreen" content="true"/>
<style>
html,
body {
padding: 0;
margin: 0;
border: 0;
width: 100%;
height: 100%;
overflow: hidden;
position: absolute;
background-color: transparent;
}
</style>
</head>
<body>
<div id="game-container" style="line-height:0;font-size:0"></div>
<script crossorigin="anonymous" src="//yun.duiba.com.cn/editor/zeroing/libs/engine.50cdcef6ebe4e8c0fbc624f9d4fbf225102c5750.js"></script>
<script crossorigin="anonymous" src="//yun.duiba.com.cn/editor/zeroing/libs/svga.fd3923ae6e664251ca7981801a65809cc5f36bc3.js"></script>
<!--<script src="//yun.duiba.com.cn/editor/zeroing/libs/engine.9a9dbfda4cb2dd5508ecddfe3d95dfd88063f7b5.js"></script>-->
<script src="app.js"></script>
<script src="props.js"></script>
<script src="load-assets.js"></script>
<script src="main.js"></script>
<script>
</script>
</body>
\ No newline at end of file
/**
* Created by rockyl on 2020-01-21.
*/
const assets = [
{
"name": "方块素材0",
"url": "//yun.duiba.com.cn/aurora/assets/0307ca8906e9f553e6873c346ae5c6ec3655db59.svga",
"uuid": "4e31f5d7-bd03-41a3-873c-3755fe4862e6",
"ext": '.svga'
}
];
function loadAssets(customModuleAssets, onProgress, onComplete){
return engine.loadAssets(assets.concat(...customModuleAssets), onProgress, onComplete);
}
/**
* Created by rockyl on 2020-01-21.
*/
const assets = [
// {
// "name": "方块素材0",
// "url": "//yun.duiba.com.cn/aurora/assets/0307ca8906e9f553e6873c346ae5c6ec3655db59.svga",
// "uuid": "4e31f5d7-bd03-41a3-873c-3755fe4862e6",
// "ext": '.svga'
// }
];
function loadAssets(customModuleAssets, onProgress, onComplete){
return engine.loadAssets(assets.concat(...customModuleAssets), onProgress, onComplete);
}
/**
* Created by rockyl on 2020-01-21.
*/
const assets = [
{
"name": "方块素材0",
"url": "//yun.duiba.com.cn/aurora/assets/58b04890a7a33425e87845983268b0f689df67a7.svga",
"uuid": "c3e908ad-a895-4463-98a9-c78c19ba5e6b",
"ext": ".svga"
},
{
"name": "方块素材0_z",
"url": "//yun.duiba.com.cn/aurora/assets/655685bd37428fb7e8ff9353c78c1d8424882ab1.svga",
"uuid": "79cd10e7-67c4-4cb1-9e56-598100162a7c",
"ext": ".svga"
},
];
function loadAssets(customModuleAssets, onProgress, onComplete){
return engine.loadAssets(assets.concat(...customModuleAssets), onProgress, onComplete);
}
/**
* Created by rockyl on 2020-01-21.
*/
const assets = [
{
"name": "方块素材0",
"url": "//yun.duiba.com.cn/aurora/assets/58b04890a7a33425e87845983268b0f689df67a7.svga",
"uuid": "c3e908ad-a895-4463-98a9-c78c19ba5e6b",
"ext": ".svga"
},
{
"name": "方块素材0_hit",
"url": "//yun.duiba.com.cn/aurora/assets/655685bd37428fb7e8ff9353c78c1d8424882ab1.svga",
"uuid": "79cd10e7-67c4-4cb1-9e56-598100162a7c",
"ext": ".svga"
},
];
function loadAssets(customModuleAssets, onProgress, onComplete){
return engine.loadAssets(assets.concat(...customModuleAssets), onProgress, onComplete);
}
/**
* Created by rockyl on 2020-01-21.
*/
const assets = [
];
function loadAssets(customModuleAssets, onProgress, onComplete){
return engine.loadAssets(assets.concat(...customModuleAssets), onProgress, onComplete);
}
/**
* Created by rockyl on 2020-01-21.
*/
const assets = [
{
"name": "方块素材0",
"url": "//yun.duiba.com.cn/aurora/assets/58b04890a7a33425e87845983268b0f689df67a7.svga",
"uuid": "c3e908ad-a895-4463-98a9-c78c19ba5e6b",
"ext": ".svga"
},
{
"name": "方块素材0_hit",
"url": "//yun.duiba.com.cn/aurora/assets/655685bd37428fb7e8ff9353c78c1d8424882ab1.svga",
"uuid": "79cd10e7-67c4-4cb1-9e56-598100162a7c",
"ext": ".svga"
},
];
function loadAssets(customModuleAssets, onProgress, onComplete){
return engine.loadAssets(assets.concat(...customModuleAssets), onProgress, onComplete);
}
/**
* Created by rockyl on 2020-01-21.
*/
const assets = [
{
"name": "方块素材0",
"url": "//yun.duiba.com.cn/aurora/assets/58b04890a7a33425e87845983268b0f689df67a7.svga",
"uuid": "c3e908ad-a895-4463-98a9-c78c19ba5e6b",
"ext": ".svga"
},
{
"name": "方块素材0_hit",
"url": "//yun.duiba.com.cn/aurora/assets/655685bd37428fb7e8ff9353c78c1d8424882ab1.svga",
"uuid": "79cd10e7-67c4-4cb1-9e56-598100162a7c",
"ext": ".svga"
}
];
function loadAssets(customModuleAssets, onProgress, onComplete){
return engine.loadAssets(assets.concat(...customModuleAssets), onProgress, onComplete);
}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment