Commit 7ebfecde authored by 张超's avatar 张超 🎱

lishuo libs hitbubble circle turncard

parent 745825d1
/**
* Created by renjianfeng on 2020-03-13.
*/
const customId = 'circle';
(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.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',
properties: {
x: 0,
y: 0,
}
}],
}, null, function () {
setTimeout(() => {
engine.addCustomModule(customId, engine.gameStage.sceneContainer.getChildAt(0));
}, 100);
setTimeout(() => {
engine.globalEvent.dispatchEvent('food-fell-reset', {
"goodsProbability": [0.8,0.1,0.1],
"countDown": 30,
"acceleratedSpeed":0.1
});
engine.globalEvent.dispatchEvent('food-fell-start');
}, 500);
});
engine.globalEvent.addEventListener('food-fell-time-update', (e) => {
console.log(e.type, e.data);
});
engine.globalEvent.addEventListener('food-fell-score-update', (e) => {
console.log(e.type, e.data);
});
engine.globalEvent.addEventListener('food-fell-game-over', (e) => {
console.log(e.type, e.data);
});
}
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: grey;
}
</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.ebc906f6b50b8da0a669f77027981d5f3cb560ce.js"></script> -->
<!-- <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
/**
* Created by rockyl on 2020-01-21.
*/
const assets = [
{
"name": "玩家icon",
"url": "//yun.duiba.com.cn/aurora/assets/1cd03de560966bebafcee0b54a046b16fff52517.png",
"uuid": "66f23d13-82a5-4cec-9496-301ec240d087",
"ext": ".png"
},
{
"name": "雨滴",
"url": "//yun.duiba.com.cn/aurora/assets/1cd03de560966bebafcee0b54a046b16fff52517.png",
"uuid": "264a6192-d7bf-45e8-8f15-6ba2c439a532",
"ext": ".png"
},
{
"name": "炸弹",
"url": "//yun.duiba.com.cn/aurora/assets/1cd03de560966bebafcee0b54a046b16fff52517.png",
"uuid": "eb88b42d-e151-4c1b-94b9-7c16f7bfac29",
"ext": ".png"
},
{
"name": "石块",
"url": "//yun.duiba.com.cn/aurora/assets/1cd03de560966bebafcee0b54a046b16fff52517.png",
"uuid": "ab1bdabc-21ba-46bf-9299-6c638f766c88",
"ext": ".png"
},
{
"name": "水花",
"url": "//yun.duiba.com.cn/aurora/assets/93d37b4a0e367e80e375308a6b4414d72d7666fc.svga",
"uuid": "b521bf94-20e1-44dd-8eca-d24996cbaeae",
"ext": ".svga"
},
{
"name": "炸弹",
"url": "//yun.duiba.com.cn/aurora/assets/4dd18f0689c663bbcf710a7afc4d929084d97d36.svga",
"uuid": "322edf39-805b-4e84-9d07-5573dfeebc0e",
"ext": ".svga"
},
{
"name": "玩家",
"url": "//yun.duiba.com.cn/aurora/assets/b66300c5d4f27134b0aac3dc90a3220e8ae572eb.svga",
"uuid": "71d8dcbc-3931-471a-b585-b3ae01b25aa6",
"ext": ".svga"
}
];
function loadAssets(customModuleAssets, onProgress, onComplete){
return engine.loadAssets(assets.concat(...customModuleAssets), onProgress, onComplete);
}
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('tslib')) :
typeof define === 'function' && define.amd ? define(['tslib'], factory) :
(global = global || self, global.circle = factory(global.tslib));
}(this, (function (tslib) { 'use strict';
function getTexture(uuid) {
return engine.Texture.from(getAssetByUUID(uuid).uuid);
}
function getTextureByName(name) {
console.log('name', engine.getAssetByName(name));
return getTexture(engine.getAssetByName(name).uuid);
}
function createSvga(name, anchorName) {
var inst = new svga.Svga();
inst.source = 'asset://' + engine.getAssetByName(name).uuid;
return inst;
}
//# sourceMappingURL=utils.js.map
var props = {};
function prepareProps() {
var metaProps = getProps();
engine.injectProp(props, metaProps);
}
function injectProps(p) {
engine.injectProp(props, p);
}
//# sourceMappingURL=props.js.map
var Gameinit = (function (_super) {
tslib.__extends(Gameinit, _super);
function Gameinit() {
var _this = _super.call(this) || this;
_this._isSetUp = false;
_this.totleY = 1200;
_this.isMove = false;
_this.isChoose = true;
_this.isDid = true;
_this.listGift = [];
console.log("11111111111111");
_this.once(engine.Event.ADDED_TO_STAGE, _this.setup, _this);
return _this;
}
Gameinit.prototype.setup = function () {
console.log("初始化加载000000000000000000000000!");
if (this._isSetUp) {
return;
}
else {
this.loadThings();
console.log("this._isSetUp=", this._isSetUp, '<<<<');
}
};
Gameinit.prototype.loadThings = function () {
var self = this;
var body;
body = this._body = new engine.Rect;
body.width = 0.0001;
body.height = 0.0001;
this.addChild(body);
var gift0 = this.addRes(body, '礼盒', 250, 100, 247, 188);
var gift1 = this.addRes(body, '礼盒', 485, 85, 247, 190);
var gift2 = this.addRes(body, '礼盒', 385, -15, 222, 170);
var gift3 = this.addRes(body, '礼盒', 165, -15, 222, 170);
var gift4 = this.addRes(body, '礼盒', 20, 85, 247, 190);
this.listGift = [gift0, gift1, gift2, gift3, gift4];
var circle = this.addRes(body, '圈', 260, 350, 240, 80);
var giftSvga = createSvga("套中动效");
giftSvga.visible = false;
body.addChild(giftSvga);
var _a = props.ferruleModuleGlobalPosition, v2X = _a[0], v2Y = _a[1];
body.x = v2X;
body.y = v2Y;
engine.globalEvent.addEventListener("circle-game-start", function () {
self.isMove = true;
console.log('this.isMove===', self.isMove);
}, this);
engine.globalEvent.addEventListener("circle-game-init", function () {
self.isChoose = true;
giftSvga.visible = false;
body.children[self.num].visible = true;
circle.x = 260;
circle.y = 350;
circle.width = 240;
circle.height = 80;
circle.visible = true;
}, this);
circle.addEventListener(engine.Event.ENTER_FRAME, function () {
if (self.isMove) {
console.log("物体移动");
if (self.isChoose) {
self.num = Math.floor(Math.random() * self.listGift.length);
self.isChoose = false;
}
self.nodeMove(circle, self.listGift[self.num], giftSvga);
}
});
};
Gameinit.prototype.aniPlay = function (node0, targetNode, bool) {
node0.scaleX = this.currentScale(targetNode.y, this.totleY) - 0.05 * this.currentScale(targetNode.y, this.totleY);
node0.scaleY = this.currentScale(targetNode.y, this.totleY) - 0.05 * this.currentScale(targetNode.y, this.totleY);
node0.x = targetNode.x;
node0.y = targetNode.y;
node0.visible = true;
node0.play(false, false);
node0.addEventListener(engine.Event.END_FRAME, function () {
console.log("播放到最后一帧", bool, '<<<');
engine.globalEvent.dispatchEvent("circle-game-end");
bool = false;
});
};
Gameinit.prototype.addRes = function (fatherNode, resName, v2X, v2Y, resW, resH) {
console.log("进行资源的添加");
var thing = new engine.Sprite(getTextureByName(resName));
thing.x = v2X;
thing.y = v2Y;
thing.width = resW;
thing.height = resH;
return fatherNode.addChild(thing);
};
Gameinit.prototype.nodeMove = function (moveNode, targetNode, nodePlay) {
console.log("moveNode.x=", moveNode.x, "targetNode.x=", targetNode.x);
var moveX = targetNode.x - moveNode.x;
var moveY = targetNode.y - moveNode.y;
console.log('moveX=', moveX, 'moveY=', moveY);
if (this.isDid) {
if (Math.abs(moveX) > 2) {
moveNode.x += moveX / Math.abs(moveX) * 5;
}
if (Math.abs(moveY) > 2) {
moveNode.y += moveY / Math.abs(moveY) * 5;
moveNode.scaleX = this.currentScale(moveNode.y, this.totleY) + 0.2;
moveNode.scaleY = moveNode.scaleX;
}
if (Math.abs(moveX) < 3 && Math.abs(moveY) < 3) {
targetNode.visible = false;
moveNode.visible = false;
this.aniPlay(nodePlay, targetNode, this.isDid);
this.isMove = false;
}
}
};
Gameinit.prototype.currentScale = function (currentY, totoleDisY) {
return (currentY + 830) / totoleDisY;
};
return Gameinit;
}(engine.Container));
function index (props) {
prepareProps();
injectProps(props);
var instance = new Gameinit();
return instance;
}
//# sourceMappingURL=index.js.map
return index;
})));
//# sourceMappingURL=main.js.map
\ No newline at end of file
{"version":3,"file":"index.js","sources":["src/custom/circle/src/game/utils.ts","src/custom/circle/src/props.ts","src/custom/circle/src/game/Gameinit.ts","src/custom/circle/src/index.ts"],"sourcesContent":["/**\r\n * Created by rockyl on 2020-01-21.\r\n */\r\n\r\nexport function getTexture(uuid) {\r\n\treturn engine.Texture.from(getAssetByUUID(uuid).uuid);\r\n}\r\n\r\nexport function getTextureByName(name) {\r\n\tconsole.log('name',engine.getAssetByName(name));\r\n\treturn getTexture(engine.getAssetByName(name).uuid);\r\n}\r\n\r\nexport function playSound(name) {\r\n\tengine.playSound(engine.getAssetByName(name).uuid, {keep: true});\r\n}\r\nexport function createSvga(name, anchorName?) {\r\n\tlet inst = new svga.Svga();\r\n\tinst.source = 'asset://' + engine.getAssetByName(name).uuid;\r\n\treturn inst;\r\n}\r\n","/**\r\n * Created by rockyl on 2020-01-21.\r\n */\r\n\r\nexport let props: any = {};\r\n\r\nexport function prepareProps() {\r\n\tlet metaProps = getProps();\r\n\tengine.injectProp(props, metaProps);\r\n\r\n}\r\n\r\nexport function injectProps(p) {\r\n\tengine.injectProp(props, p);\r\n}\r\n","\r\nimport { getTextureByName, createSvga } from './utils';\r\nimport { props } from \"../props\";\r\n\r\nexport default class Gameinit extends engine.Container {\r\n\r\n private _isSetUp = false;\r\n private totleY = 1200;\r\n _body: engine.Rect;\r\n isMove = false;\r\n isChoose = true;\r\n isDid = true;\r\n num;\r\n listGift = [];\r\n constructor() {\r\n super();\r\n console.log(\"11111111111111\");\r\n this.once(engine.Event.ADDED_TO_STAGE, this.setup, this);\r\n }\r\n /**首页加载 */\r\n setup() {\r\n console.log(\"初始化加载000000000000000000000000!\");\r\n if (this._isSetUp) {\r\n return;\r\n }\r\n else {\r\n this.loadThings();\r\n console.log(\"this._isSetUp=\", this._isSetUp, '<<<<');\r\n }\r\n }\r\n /**套圈资源加载 */\r\n loadThings() {\r\n let self = this;\r\n let body;\r\n body = this._body = new engine.Rect;\r\n body.width = 0.0001;\r\n body.height = 0.0001;\r\n this.addChild(body);\r\n // let gift4 = this.addRes(body, '礼盒', 35, 115, 215, 122);\r\n let gift0 = this.addRes(body, '礼盒', 250, 100, 247, 188);\r\n let gift1 = this.addRes(body, '礼盒', 485, 85, 247, 190);\r\n let gift2 = this.addRes(body, '礼盒', 385, -15, 222, 170);\r\n let gift3 = this.addRes(body, '礼盒', 165, -15, 222, 170);\r\n let gift4 = this.addRes(body, '礼盒', 20, 85, 247, 190);\r\n this.listGift = [gift0, gift1, gift2, gift3, gift4];\r\n let circle = this.addRes(body, '圈', 260, 350, 240, 80);\r\n let giftSvga = createSvga(\"套中动效\");\r\n giftSvga.visible = false;\r\n body.addChild(giftSvga);\r\n let [v2X, v2Y] = props.ferruleModuleGlobalPosition;\r\n body.x = v2X;\r\n body.y = v2Y;\r\n /* VVVVVVVVVVVVVVVV */\r\n // let btn = this.addRes(body, '礼盒', 300, 900, 150, 150);\r\n // btn.addEventListener(engine.MouseEvent.MOUSE_DOWN, function () {\r\n // self.isMove = true;\r\n // }, this);\r\n // let btn1 = this.addRes(body, '礼盒', 500, 900, 200, 200);\r\n // btn1.addEventListener(engine.MouseEvent.MOUSE_DOWN, function () {\r\n // self.isChoose = true;\r\n // giftSvga.visible = false;\r\n // console.log(body.children[0], body.children[1], body.children[2], body.children[3], body.children[4], body.children[5]);\r\n // body.children[self.num].visible = true;\r\n // circle.x = 260; circle.y = 350; circle.width = 240; circle.height = 80;\r\n // circle.visible = true;\r\n // }, this);\r\n /* AAAAAAAAAAAAAAAAA */\r\n engine.globalEvent.addEventListener(\"circle-game-start\", function () {\r\n self.isMove = true;\r\n console.log('this.isMove===', self.isMove);\r\n }, this);\r\n engine.globalEvent.addEventListener(\"circle-game-init\", function () {\r\n self.isChoose = true;\r\n giftSvga.visible = false;\r\n // console.log(body.children[0], body.children[1], body.children[2], body.children[3], body.children[4], body.children[5]);\r\n body.children[self.num].visible = true;\r\n circle.x = 260; circle.y = 350; circle.width = 240; circle.height = 80;\r\n circle.visible = true;\r\n }, this);\r\n\r\n circle.addEventListener(engine.Event.ENTER_FRAME, function () {\r\n if (self.isMove) {\r\n console.log(\"物体移动\");\r\n if (self.isChoose) {\r\n self.num = Math.floor(Math.random() * self.listGift.length);\r\n self.isChoose = false;\r\n }\r\n self.nodeMove(circle, self.listGift[self.num], giftSvga);\r\n }\r\n });\r\n }\r\n /**套中动画播放 */\r\n aniPlay(node0, targetNode, bool) {\r\n node0.scaleX = this.currentScale(targetNode.y, this.totleY) - 0.05 * this.currentScale(targetNode.y, this.totleY);\r\n node0.scaleY = this.currentScale(targetNode.y, this.totleY) - 0.05 * this.currentScale(targetNode.y, this.totleY);\r\n // node0.anchor.x = node0.width / 2;\r\n // node0.anchor.y = node0.height / 2;\r\n node0.x = targetNode.x;\r\n node0.y = targetNode.y;\r\n node0.visible = true;\r\n node0.play(false, false);\r\n /**动画播放完毕,派发(执行)一个事件 */\r\n node0.addEventListener(engine.Event.END_FRAME, function () {\r\n console.log(\"播放到最后一帧\", bool, '<<<');\r\n engine.globalEvent.dispatchEvent(\"circle-game-end\");\r\n bool = false;\r\n })\r\n }\r\n /**给场景添加图片,resName:资源名字,v2X:资源X位置, v2Y:资源Y位置, resW:资源Width, resH:资源Height */\r\n addRes(fatherNode, resName, v2X, v2Y, resW, resH) {\r\n console.log(\"进行资源的添加\");\r\n let thing = new engine.Sprite(getTextureByName(resName));\r\n thing.x = v2X;\r\n thing.y = v2Y;\r\n thing.width = resW;\r\n thing.height = resH;\r\n return fatherNode.addChild(thing);\r\n }\r\n /** circle move */\r\n nodeMove(moveNode, targetNode, nodePlay) {\r\n console.log(\"moveNode.x=\", moveNode.x, \"targetNode.x=\", targetNode.x);\r\n let moveX = targetNode.x - moveNode.x;\r\n let moveY = targetNode.y - moveNode.y;\r\n console.log('moveX=', moveX, 'moveY=', moveY);\r\n if (this.isDid) {\r\n if (Math.abs(moveX) > 2) {\r\n moveNode.x += moveX / Math.abs(moveX) * 5;\r\n }\r\n if (Math.abs(moveY) > 2) {\r\n moveNode.y += moveY / Math.abs(moveY) * 5;\r\n moveNode.scaleX = this.currentScale(moveNode.y, this.totleY) + 0.2;\r\n moveNode.scaleY = moveNode.scaleX;\r\n }\r\n if (Math.abs(moveX) < 3 && Math.abs(moveY) < 3) {\r\n targetNode.visible = false;\r\n moveNode.visible = false;\r\n this.aniPlay(nodePlay, targetNode, this.isDid);\r\n this.isMove = false;\r\n }\r\n }\r\n }\r\n /**当前位置应该的尺寸大小 */\r\n currentScale(currentY, totoleDisY) {\r\n return (currentY + 830) / totoleDisY;\r\n }\r\n}\r\n","/**\r\n * Created by rockyl on 2019-11-20.\r\n */\r\n\r\nimport Gameinit from \"./game/Gameinit\";\r\nimport { injectProps, prepareProps } from \"./props\";\r\n\r\nexport default function (props) {\r\n\tprepareProps();\r\n\tinjectProps(props);\r\n\tlet instance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"alias": "套圈模块的位置",
"type": "array<number>",
"default": "0,0"
},
"ferruleModuleWidthHeight": {
"alias": "套圈模块的宽高",
"type": "array<number>",
"default": "750,450"
}
},
"assets": [
{
"name": "圈",
"url": "//yun.duiba.com.cn/aurora/assets/668313c9b296603cbfd24f92c3683c41df0aa1e9.png",
"uuid": "c1fc9984-900f-44e0-87e5-128e7ccdfb62",
"ext": ".png"
},
{
"name": "礼盒",
"url": "//yun.duiba.com.cn/aurora/assets/3b13cb2a324c05e3bef2c27f1fd27b5fe49a0ea3.png",
"uuid": "e3ee8791-880f-4408-9f31-2f5faa75d044",
"ext": ".png"
},
{
"name": "套中动效",
"url": "//yun.duiba.com.cn/aurora/assets/8b650dd07a82a1357f0572e1201a9834e8b7d302.svga",
"uuid": "5e569c9c-a1e4-44df-83eb-9249e00e228b",
"ext": ".svga"
}
],
"events": {
"in": {
"circle-game-start": {
"alias": "开始"
},
"circle-game-init": {
"alias": "初始化"
}
},
"out": {
"circle-game-end": {
"alias": "套圈完毕",
"data": {
"reason": "套圈结束,执行抽奖"
}
}
}
}
}
\ No newline at end of file
import { getTextureByName, createSvga } from './utils';
import { props } from "../props";
export default class Gameinit extends engine.Container {
private _isSetUp = false;
private totleY = 1200;
_body: engine.Rect;
isMove = false;
isChoose = true;
isDid = true;
num;
listGift = [];
constructor() {
super();
console.log("11111111111111");
this.once(engine.Event.ADDED_TO_STAGE, this.setup, this);
}
/**首页加载 */
setup() {
console.log("初始化加载000000000000000000000000!");
if (this._isSetUp) {
return;
}
else {
this.loadThings();
console.log("this._isSetUp=", this._isSetUp, '<<<<');
}
}
/**套圈资源加载 */
loadThings() {
let self = this;
let body;
body = this._body = new engine.Rect;
body.width = 0.0001;
body.height = 0.0001;
this.addChild(body);
// let gift4 = this.addRes(body, '礼盒', 35, 115, 215, 122);
let gift0 = this.addRes(body, '礼盒', 250, 100, 247, 188);
let gift1 = this.addRes(body, '礼盒', 485, 85, 247, 190);
let gift2 = this.addRes(body, '礼盒', 385, -15, 222, 170);
let gift3 = this.addRes(body, '礼盒', 165, -15, 222, 170);
let gift4 = this.addRes(body, '礼盒', 20, 85, 247, 190);
this.listGift = [gift0, gift1, gift2, gift3, gift4];
let circle = this.addRes(body, '圈', 260, 350, 240, 80);
let giftSvga = createSvga("套中动效");
giftSvga.visible = false;
body.addChild(giftSvga);
let [v2X, v2Y] = props.ferruleModuleGlobalPosition;
body.x = v2X;
body.y = v2Y;
/* VVVVVVVVVVVVVVVV */
// let btn = this.addRes(body, '礼盒', 300, 900, 150, 150);
// btn.addEventListener(engine.MouseEvent.MOUSE_DOWN, function () {
// self.isMove = true;
// }, this);
// let btn1 = this.addRes(body, '礼盒', 500, 900, 200, 200);
// btn1.addEventListener(engine.MouseEvent.MOUSE_DOWN, function () {
// self.isChoose = true;
// giftSvga.visible = false;
// console.log(body.children[0], body.children[1], body.children[2], body.children[3], body.children[4], body.children[5]);
// body.children[self.num].visible = true;
// circle.x = 260; circle.y = 350; circle.width = 240; circle.height = 80;
// circle.visible = true;
// }, this);
/* AAAAAAAAAAAAAAAAA */
engine.globalEvent.addEventListener("circle-game-start", function () {
self.isMove = true;
console.log('this.isMove===', self.isMove);
}, this);
engine.globalEvent.addEventListener("circle-game-init", function () {
self.isChoose = true;
giftSvga.visible = false;
// console.log(body.children[0], body.children[1], body.children[2], body.children[3], body.children[4], body.children[5]);
body.children[self.num].visible = true;
circle.x = 260; circle.y = 350; circle.width = 240; circle.height = 80;
circle.visible = true;
}, this);
circle.addEventListener(engine.Event.ENTER_FRAME, function () {
if (self.isMove) {
console.log("物体移动");
if (self.isChoose) {
self.num = Math.floor(Math.random() * self.listGift.length);
self.isChoose = false;
}
self.nodeMove(circle, self.listGift[self.num], giftSvga);
}
});
}
/**套中动画播放 */
aniPlay(node0, targetNode, bool) {
node0.scaleX = this.currentScale(targetNode.y, this.totleY) - 0.05 * this.currentScale(targetNode.y, this.totleY);
node0.scaleY = this.currentScale(targetNode.y, this.totleY) - 0.05 * this.currentScale(targetNode.y, this.totleY);
// node0.anchor.x = node0.width / 2;
// node0.anchor.y = node0.height / 2;
node0.x = targetNode.x;
node0.y = targetNode.y;
node0.visible = true;
node0.play(false, false);
/**动画播放完毕,派发(执行)一个事件 */
node0.addEventListener(engine.Event.END_FRAME, function () {
console.log("播放到最后一帧", bool, '<<<');
engine.globalEvent.dispatchEvent("circle-game-end");
bool = false;
})
}
/**给场景添加图片,resName:资源名字,v2X:资源X位置, v2Y:资源Y位置, resW:资源Width, resH:资源Height */
addRes(fatherNode, resName, v2X, v2Y, resW, resH) {
console.log("进行资源的添加");
let thing = new engine.Sprite(getTextureByName(resName));
thing.x = v2X;
thing.y = v2Y;
thing.width = resW;
thing.height = resH;
return fatherNode.addChild(thing);
}
/** circle move */
nodeMove(moveNode, targetNode, nodePlay) {
console.log("moveNode.x=", moveNode.x, "targetNode.x=", targetNode.x);
let moveX = targetNode.x - moveNode.x;
let moveY = targetNode.y - moveNode.y;
console.log('moveX=', moveX, 'moveY=', moveY);
if (this.isDid) {
if (Math.abs(moveX) > 2) {
moveNode.x += moveX / Math.abs(moveX) * 5;
}
if (Math.abs(moveY) > 2) {
moveNode.y += moveY / Math.abs(moveY) * 5;
moveNode.scaleX = this.currentScale(moveNode.y, this.totleY) + 0.2;
moveNode.scaleY = moveNode.scaleX;
}
if (Math.abs(moveX) < 3 && Math.abs(moveY) < 3) {
targetNode.visible = false;
moveNode.visible = false;
this.aniPlay(nodePlay, targetNode, this.isDid);
this.isMove = false;
}
}
}
/**当前位置应该的尺寸大小 */
currentScale(currentY, totoleDisY) {
return (currentY + 830) / totoleDisY;
}
}
/**
* Created by rockyl on 2020-01-21.
*/
export function getTexture(uuid) {
return engine.Texture.from(getAssetByUUID(uuid).uuid);
}
export function getTextureByName(name) {
console.log('name',engine.getAssetByName(name));
return getTexture(engine.getAssetByName(name).uuid);
}
export function playSound(name) {
engine.playSound(engine.getAssetByName(name).uuid, {keep: true});
}
export function createSvga(name, anchorName?) {
let inst = new svga.Svga();
inst.source = 'asset://' + engine.getAssetByName(name).uuid;
return inst;
}
/**
* Created by rockyl on 2019-11-20.
*/
import Gameinit from "./game/Gameinit";
import { injectProps, prepareProps } from "./props";
export default function (props) {
prepareProps();
injectProps(props);
let instance = new Gameinit();
return instance;
}
/**
* Created by rockyl on 2020-01-21.
*/
export let props: any = {};
export function prepareProps() {
let metaProps = getProps();
engine.injectProp(props, metaProps);
}
export function injectProps(p) {
engine.injectProp(props, p);
}
/**
* Created by renjianfeng on 2020-03-13.
*/
const customId = 'hit-bubble';
(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.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',
properties: {
x: 0,
y: 0,
}
}],
}, null, function () {
setTimeout(() => {
engine.addCustomModule(customId, engine.gameStage.sceneContainer.getChildAt(0));
}, 100);
setTimeout(() => {
engine.globalEvent.dispatchEvent('food-fell-reset', {
"goodsProbability": [0.8,0.1,0.1],
"countDown": 30,
"acceleratedSpeed":0.1
});
engine.globalEvent.dispatchEvent('food-fell-start');
}, 500);
});
engine.globalEvent.addEventListener('food-fell-time-update', (e) => {
console.log(e.type, e.data);
});
engine.globalEvent.addEventListener('food-fell-score-update', (e) => {
console.log(e.type, e.data);
});
engine.globalEvent.addEventListener('food-fell-game-over', (e) => {
console.log(e.type, e.data);
});
}
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: rgb(42, 167, 189);
}
</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.ebc906f6b50b8da0a669f77027981d5f3cb560ce.js"></script> -->
<!-- <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
/**
* Created by rockyl on 2020-01-21.
*/
const assets = [
];
function loadAssets(customModuleAssets, onProgress, onComplete){
return engine.loadAssets(assets.concat(...customModuleAssets), onProgress, onComplete);
}
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('tslib')) :
typeof define === 'function' && define.amd ? define(['tslib'], factory) :
(global = global || self, global['hit-bubble'] = factory(global.tslib));
}(this, (function (tslib) { 'use strict';
var props = {};
function prepareProps() {
var metaProps = getProps();
engine.injectProp(props, metaProps);
}
function injectProps(p) {
engine.injectProp(props, p);
}
//# sourceMappingURL=props.js.map
function getTexture(uuid) {
return engine.Texture.from(getAssetByUUID(uuid).uuid);
}
function getTextureByName(name) {
return getTexture(engine.getAssetByName(name).uuid);
}
function createSvga(name, anchorName) {
var inst = new svga.Svga();
inst.source = 'asset://' + engine.getAssetByName(name).uuid;
return inst;
}
//# sourceMappingURL=utils.js.map
var Gameinit = (function (_super) {
tslib.__extends(Gameinit, _super);
function Gameinit() {
var _this = _super.call(this) || this;
_this._isSetUp = false;
_this.once(engine.Event.ADDED_TO_STAGE, _this.setup, _this);
return _this;
}
Gameinit.prototype.setup = function () {
console.log("初始化加载000000000000000000000000!");
if (this._isSetUp) {
return;
}
else {
this.loadThings();
console.log("this._isSetUp=", this._isSetUp, '<<<<');
}
};
Gameinit.prototype.loadThings = function () {
var self = this;
var body;
body = this._body = new engine.Rect;
body.width = 0.0001;
body.width = 0.0001;
this.addChild(body);
var bubble = createSvga("打气球");
body.addChild(bubble);
var _a = props.hitbubbleModuleGlobalPosition, v2X = _a[0], v2Y = _a[1];
body.x = v2X;
body.y = v2Y;
console.log(">>>>>>", bubble.width, bubble.height, "<<<<<<", "》》》》", body.width, body.height, '《《《《');
engine.globalEvent.addEventListener("hit-bubble-game-start", function () {
self.aniPlay(bubble, 0, 0);
}, this);
engine.globalEvent.addEventListener("hit-bubble-game-init", function () {
bubble.addEventListener(engine.Event.END_FRAME, function () {
console.log(1000000000000);
bubble.gotoAndStop(1);
});
}, this);
};
Gameinit.prototype.aniPlay = function (node0, vX, vY) {
console.log("播放动画!!!");
node0.x = vX;
node0.y = vY;
node0.play(false, false);
node0.addEventListener(engine.Event.END_FRAME, function () {
console.log("最后一帧");
engine.globalEvent.dispatchEvent("hit-bubble-game-end");
});
};
Gameinit.prototype.addRes = function (fatherNode, resName, v2X, v2Y, resW, resH) {
console.log("进行资源的添加");
var thing = new engine.Sprite(getTextureByName(resName));
thing.x = v2X;
thing.y = v2Y;
thing.width = resW;
thing.height = resH;
return fatherNode.addChild(thing);
};
return Gameinit;
}(engine.Container));
//# sourceMappingURL=Gameinit.js.map
function index (props) {
prepareProps();
injectProps(props);
var instance = new Gameinit();
return instance;
}
//# sourceMappingURL=index.js.map
return index;
})));
//# sourceMappingURL=main.js.map
\ No newline at end of file
{"version":3,"file":"index.js","sources":["src/custom/hit-bubble/src/props.ts","src/custom/hit-bubble/src/game/utils.ts","src/custom/hit-bubble/src/game/Gameinit.ts","src/custom/hit-bubble/src/index.ts"],"sourcesContent":["/**\r\n * Created by rockyl on 2020-01-21.\r\n */\r\n\r\nexport let props: any = {};\r\n\r\nexport function prepareProps() {\r\n\tlet metaProps = getProps();\r\n\tengine.injectProp(props, metaProps);\r\n\r\n}\r\nexport function injectProps(p) {\r\n\tengine.injectProp(props, p);\r\n}\r\n","/**\r\n * Created by rockyl on 2020-01-21.\r\n */\r\n\r\nexport function getTexture(uuid) {\r\n\treturn engine.Texture.from(getAssetByUUID(uuid).uuid);\r\n}\r\nexport function getTextureByName(name) {\r\n\treturn getTexture(engine.getAssetByName(name).uuid);\r\n}\r\nexport function playSound(name) {\r\n\tengine.playSound(engine.getAssetByName(name).uuid, { keep: true });\r\n}\r\nexport function createSvga(name, anchorName?) {\r\n\tlet inst = new svga.Svga();\r\n\tinst.source = 'asset://' + engine.getAssetByName(name).uuid;\r\n\treturn inst;\r\n}\r\n","\r\nimport { getTextureByName, createSvga } from './utils';\r\nimport { props } from \"../props\";\r\n\r\nexport default class Gameinit extends engine.Container {\r\n\r\n private _isSetUp = false;\r\n _body: engine.Rect;\r\n constructor() {\r\n super();\r\n this.once(engine.Event.ADDED_TO_STAGE, this.setup, this);\r\n }\r\n /**首页加载 */\r\n setup() {\r\n console.log(\"初始化加载000000000000000000000000!\");\r\n if (this._isSetUp) {\r\n return;\r\n }\r\n else {\r\n this.loadThings();\r\n console.log(\"this._isSetUp=\", this._isSetUp, '<<<<');\r\n }\r\n }\r\n /**套圈资源加载 */\r\n loadThings() {\r\n let self = this;\r\n let body;\r\n body = this._body = new engine.Rect;\r\n body.width = 0.0001;\r\n body.width = 0.0001;\r\n this.addChild(body);\r\n let bubble = createSvga(\"打气球\");\r\n body.addChild(bubble);\r\n let [v2X, v2Y] = props.hitbubbleModuleGlobalPosition;\r\n body.x = v2X;\r\n body.y = v2Y;\r\n console.log(\">>>>>>\", bubble.width, bubble.height, \"<<<<<<\", \"》》》》\", body.width, body.height, '《《《《');\r\n // self.aniPlay(bubble, 0, 0);\r\n engine.globalEvent.addEventListener(\"hit-bubble-game-start\", function () {\r\n self.aniPlay(bubble, 0, 0);\r\n }, this);\r\n engine.globalEvent.addEventListener(\"hit-bubble-game-init\", function () {\r\n bubble.addEventListener(engine.Event.END_FRAME, function () {\r\n console.log(1000000000000);\r\n bubble.gotoAndStop(1);\r\n })\r\n }, this);\r\n }\r\n /**动画播放 */\r\n aniPlay(node0, vX, vY) {\r\n console.log(\"播放动画!!!\");\r\n node0.x = vX;\r\n node0.y = vY;\r\n node0.play(false, false);\r\n node0.addEventListener(engine.Event.END_FRAME, function () {\r\n console.log(\"最后一帧\");\r\n engine.globalEvent.dispatchEvent(\"hit-bubble-game-end\");\r\n })\r\n /**动画播放完毕,派发(执行)一个事件 */\r\n }\r\n /**给场景添加图片,resName:资源名字,v2X:资源X位置, v2Y:资源Y位置, resW:资源Width, resH:资源Height */\r\n addRes(fatherNode, resName, v2X, v2Y, resW, resH) {\r\n console.log(\"进行资源的添加\");\r\n let thing = new engine.Sprite(getTextureByName(resName));\r\n thing.x = v2X;\r\n thing.y = v2Y;\r\n thing.width = resW;\r\n thing.height = resH;\r\n return fatherNode.addChild(thing);\r\n }\r\n}\r\n","/**\r\n * Created by rockyl on 2019-11-20.\r\n */\r\n\r\nimport { injectProps, prepareProps } from \"./props\";\r\nimport Gameinit from './game/Gameinit';\r\nexport default function (props) {\r\n\tprepareProps();\r\n\tinjectProps(props);\r\n\tlet instance = new Gameinit();\r\n\treturn instance;\r\n}\r\n"],"names":["__extends"],"mappings":";;;;;;CAIO,IAAI,KAAK,GAAQ,EAAE,CAAC;UAEX,YAAY;KAC3B,IAAI,SAAS,GAAG,QAAQ,E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,GAAG,EAAE,CAAC;SACb,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;SACzB,KAAK,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE;aAC3C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;aACpB,MAAM,CAAC,WAAW,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC;UAC3D,CAAC,CAAA;MAEL;KAED,yBAAM,GAAN,UAAO,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI;SAC5C,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;SACvB,IAAI,KAAK,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;SACzD,KAAK,CAAC,CAAC,GAAG,GAAG,CAAC;SACd,KAAK,CAAC,CAAC,GAAG,GAAG,CAAC;SACd,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC;SACnB,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;SACpB,OAAO,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;MACrC;KACL,eAAC;CAAD,CAAC,CAlEqC,MAAM,CAAC,SAAS,GAkErD;;;iBChEwB,KAAK;KAC7B,YAAY,EAAE,CAAC;KACf,WAAW,CAAC,KAAK,CAAC,CAAC;KACnB,IAAI,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;KAC9B,OAAO,QAAQ,CAAC;CACjB,CAAC;;;;;;;;;"}
\ No newline at end of file
/**
* Created by rockyl on 2020-01-21.
*/
let customModuleProps = {
};
{
"name": "打气球",
"desc": "打气球模块",
"props": {
"hitbubbleModuleGlobalPosition": {
"alias": "打气球模块的位置",
"type": "array<number>",
"default": "0,0"
},
"hitbubbleModuleWidth": {
"alias": "打气球模块宽度",
"type": "number",
"default": 687
},
"hitbubbleModuleHeight": {
"alias": "打气球模块高度",
"type": "number",
"default": 489
}
},
"assets": [
{
"name": "打气球",
"url": "//yun.duiba.com.cn/aurora/assets/0d17c66ca5d38b3eaf86f3e69e991232820abe26.svga",
"uuid": "4c3dda0f-bd15-43a8-bf69-38f0a734357b",
"ext": ".svga"
}
],
"events": {
"in": {
"hit-bubble-game-start": {
"alias": "开始"
},
"hit-bubble-game-init": {
"alias": "初始化"
}
},
"out": {
"hit-bubble-game-end": {
"alias": "打气球结束",
"data": {
"reason": "打气球结束,执行抽奖"
}
}
}
}
}
\ No newline at end of file
import { getTextureByName, createSvga } from './utils';
import { props } from "../props";
export default class Gameinit extends engine.Container {
private _isSetUp = false;
_body: engine.Rect;
constructor() {
super();
this.once(engine.Event.ADDED_TO_STAGE, this.setup, this);
}
/**首页加载 */
setup() {
console.log("初始化加载000000000000000000000000!");
if (this._isSetUp) {
return;
}
else {
this.loadThings();
console.log("this._isSetUp=", this._isSetUp, '<<<<');
}
}
/**套圈资源加载 */
loadThings() {
let self = this;
let body;
body = this._body = new engine.Rect;
body.width = 0.0001;
body.width = 0.0001;
this.addChild(body);
let bubble = createSvga("打气球");
body.addChild(bubble);
let [v2X, v2Y] = props.hitbubbleModuleGlobalPosition;
body.x = v2X;
body.y = v2Y;
console.log(">>>>>>", bubble.width, bubble.height, "<<<<<<", "》》》》", body.width, body.height, '《《《《');
// self.aniPlay(bubble, 0, 0);
engine.globalEvent.addEventListener("hit-bubble-game-start", function () {
self.aniPlay(bubble, 0, 0);
}, this);
engine.globalEvent.addEventListener("hit-bubble-game-init", function () {
bubble.addEventListener(engine.Event.END_FRAME, function () {
console.log(1000000000000);
bubble.gotoAndStop(1);
})
}, this);
}
/**动画播放 */
aniPlay(node0, vX, vY) {
console.log("播放动画!!!");
node0.x = vX;
node0.y = vY;
node0.play(false, false);
node0.addEventListener(engine.Event.END_FRAME, function () {
console.log("最后一帧");
engine.globalEvent.dispatchEvent("hit-bubble-game-end");
})
/**动画播放完毕,派发(执行)一个事件 */
}
/**给场景添加图片,resName:资源名字,v2X:资源X位置, v2Y:资源Y位置, resW:资源Width, resH:资源Height */
addRes(fatherNode, resName, v2X, v2Y, resW, resH) {
console.log("进行资源的添加");
let thing = new engine.Sprite(getTextureByName(resName));
thing.x = v2X;
thing.y = v2Y;
thing.width = resW;
thing.height = resH;
return fatherNode.addChild(thing);
}
}
/**
* Created by rockyl on 2020-01-21.
*/
export function getTexture(uuid) {
return engine.Texture.from(getAssetByUUID(uuid).uuid);
}
export function getTextureByName(name) {
return getTexture(engine.getAssetByName(name).uuid);
}
export function playSound(name) {
engine.playSound(engine.getAssetByName(name).uuid, { keep: true });
}
export function createSvga(name, anchorName?) {
let inst = new svga.Svga();
inst.source = 'asset://' + engine.getAssetByName(name).uuid;
return inst;
}
/**
* Created by rockyl on 2019-11-20.
*/
import { injectProps, prepareProps } from "./props";
import Gameinit from './game/Gameinit';
export default function (props) {
prepareProps();
injectProps(props);
let instance = new Gameinit();
return instance;
}
/**
* Created by rockyl on 2020-01-21.
*/
export let props: any = {};
export function prepareProps() {
let metaProps = getProps();
engine.injectProp(props, metaProps);
}
export function injectProps(p) {
engine.injectProp(props, p);
}
/**
* Created by renjianfeng on 2020-03-13.
*/
const customId = 'turn-card';
(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.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',
properties: {
x: 0,
y: 0,
}
}],
}, null, function () {
setTimeout(() => {
engine.addCustomModule(customId, engine.gameStage.sceneContainer.getChildAt(0));
}, 100);
setTimeout(() => {
engine.globalEvent.dispatchEvent('food-fell-reset', {
"goodsProbability": [0.8,0.1,0.1],
"countDown": 30,
"acceleratedSpeed":0.1
});
engine.globalEvent.dispatchEvent('food-fell-start');
}, 500);
});
engine.globalEvent.addEventListener('food-fell-time-update', (e) => {
console.log(e.type, e.data);
});
engine.globalEvent.addEventListener('food-fell-score-update', (e) => {
console.log(e.type, e.data);
});
engine.globalEvent.addEventListener('food-fell-game-over', (e) => {
console.log(e.type, e.data);
});
}
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: grey;
}
</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.ebc906f6b50b8da0a669f77027981d5f3cb560ce.js"></script> -->
<!-- <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
/**
* Created by rockyl on 2020-01-21.
*/
const assets = [
{
"name": "玩家icon",
"url": "//yun.duiba.com.cn/aurora/assets/1cd03de560966bebafcee0b54a046b16fff52517.png",
"uuid": "66f23d13-82a5-4cec-9496-301ec240d087",
"ext": ".png"
},
{
"name": "雨滴",
"url": "//yun.duiba.com.cn/aurora/assets/1cd03de560966bebafcee0b54a046b16fff52517.png",
"uuid": "264a6192-d7bf-45e8-8f15-6ba2c439a532",
"ext": ".png"
},
{
"name": "炸弹",
"url": "//yun.duiba.com.cn/aurora/assets/1cd03de560966bebafcee0b54a046b16fff52517.png",
"uuid": "eb88b42d-e151-4c1b-94b9-7c16f7bfac29",
"ext": ".png"
},
{
"name": "石块",
"url": "//yun.duiba.com.cn/aurora/assets/1cd03de560966bebafcee0b54a046b16fff52517.png",
"uuid": "ab1bdabc-21ba-46bf-9299-6c638f766c88",
"ext": ".png"
},
{
"name": "水花",
"url": "//yun.duiba.com.cn/aurora/assets/93d37b4a0e367e80e375308a6b4414d72d7666fc.svga",
"uuid": "b521bf94-20e1-44dd-8eca-d24996cbaeae",
"ext": ".svga"
},
{
"name": "炸弹",
"url": "//yun.duiba.com.cn/aurora/assets/4dd18f0689c663bbcf710a7afc4d929084d97d36.svga",
"uuid": "322edf39-805b-4e84-9d07-5573dfeebc0e",
"ext": ".svga"
},
{
"name": "玩家",
"url": "//yun.duiba.com.cn/aurora/assets/b66300c5d4f27134b0aac3dc90a3220e8ae572eb.svga",
"uuid": "71d8dcbc-3931-471a-b585-b3ae01b25aa6",
"ext": ".svga"
}
];
function loadAssets(customModuleAssets, onProgress, onComplete){
return engine.loadAssets(assets.concat(...customModuleAssets), onProgress, onComplete);
}
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('tslib')) :
typeof define === 'function' && define.amd ? define(['tslib'], factory) :
(global = global || self, global['turn-card'] = factory(global.tslib));
}(this, (function (tslib) { 'use strict';
function getTexture(uuid) {
return engine.Texture.from(getAssetByUUID(uuid).uuid);
}
function getTextureByName(name) {
console.log('name', engine.getAssetByName(name));
return getTexture(engine.getAssetByName(name).uuid);
}
//# sourceMappingURL=utils.js.map
var props = {};
function prepareProps() {
var metaProps = getProps();
engine.injectProp(props, metaProps);
}
function injectProps(p) {
engine.injectProp(props, p);
}
//# sourceMappingURL=props.js.map
var Gameinit = (function (_super) {
tslib.__extends(Gameinit, _super);
function Gameinit() {
var _this = _super.call(this) || this;
_this._isSetUp = false;
_this.isYes = true;
_this.num = -1;
_this.isDid = true;
_this.once(engine.Event.ADDED_TO_STAGE, _this.setup, _this);
return _this;
}
Gameinit.prototype.setup = function () {
if (this._isSetUp) {
return;
}
else {
this.loadinit();
}
};
Gameinit.prototype.loadinit = function () {
var self = this;
var body;
body = this._body = new engine.Rect;
body.width = 0.0001;
body.height = 0.0001;
this.addChild(body);
this.loadCard0(body, props.totleCardCount, props.eachLineCardCount, props.eachCardWidth, props.eachCardHeight, props.intervalX, props.inervalY);
var _a = props.turnCardModuleGlobalPosition, v2X = _a[0], v2Y = _a[1];
body.x = v2X;
body.y = v2Y;
console.log("*******", props.eachLineCardCount * (props.eachCardWidth + props.intervalX), props.totleCardCount / props.eachLineCardCount * (props.eachCardHeight + props.inervalY), "*********");
console.log('》》》》》', body.children.length, '《《《《《');
engine.globalEvent.addEventListener("turn-card-game-start", function () {
self.randomTurnCard(body);
});
engine.globalEvent.addEventListener("turn-card-game-init", function () {
console.log("000");
body.children[this.num].scaleX = 1;
self.isYes = true;
});
};
Gameinit.prototype.randomTurnCard = function (bodyNode) {
console.log("click");
if (this.isYes) {
this.num = Math.floor(Math.random() * (bodyNode.children.length));
console.log("num====", this.num, '=====');
console.log("fatherNode[num]==", bodyNode.children[this.num]);
this.aniCardTurn(bodyNode.children[this.num], this.isDid), this.isYes = false;
}
};
Gameinit.prototype.loadCard0 = function (fatherNode, count, eachLine, cardW, cardH, intervalX, intervalY) {
var card;
for (var j = 0; j < count / eachLine; j++) {
for (var i = 0; i < eachLine; i++) {
card = this.addRes(fatherNode, "牌子", (cardW + intervalX) * i, (cardH + intervalY) * j, cardW, cardH);
card.anchor.x = cardW / 2;
card.anchor.y = cardH / 2;
}
}
return card;
};
Gameinit.prototype.addRes = function (fatherNode, resName, v2X, v2Y, resW, resH) {
console.log("进行资源的添加");
var thing = new engine.Sprite(getTextureByName(resName));
thing.x = v2X;
thing.y = v2Y;
thing.width = resW;
thing.height = resH;
return fatherNode.addChild(thing);
};
Gameinit.prototype.aniCardTurn = function (turnNode, bool) {
turnNode.addEventListener(engine.Event.ENTER_FRAME, function () {
if (bool) {
if (turnNode.scaleX >= 0.1 && turnNode.scaleX <= 1) {
turnNode.scaleX -= 0.03;
console.log("动画未完成 bool==", bool);
}
else {
console.log("bool", bool);
console.log("00000000000000");
bool = false;
engine.globalEvent.dispatchEvent("turn-card-game-end");
}
}
});
};
return Gameinit;
}(engine.Container));
//# sourceMappingURL=Gameinit.js.map
function index (props) {
prepareProps();
injectProps(props);
var instance = new Gameinit();
return instance;
}
//# sourceMappingURL=index.js.map
return index;
})));
//# sourceMappingURL=main.js.map
\ No newline at end of file
{"version":3,"file":"index.js","sources":["src/custom/turn-card/src/game/utils.ts","src/custom/turn-card/src/props.ts","src/custom/turn-card/src/game/Gameinit.ts","src/custom/turn-card/src/index.ts"],"sourcesContent":["/**\r\n * Created by rockyl on 2020-01-21.\r\n */\r\n\r\nexport function getTexture(uuid) {\r\n\treturn engine.Texture.from(getAssetByUUID(uuid).uuid);\r\n}\r\n\r\nexport function getTextureByName(name) {\r\n\tconsole.log('name',engine.getAssetByName(name));\r\n\treturn getTexture(engine.getAssetByName(name).uuid);\r\n}\r\n\r\nexport function playSound(name) {\r\n\tengine.playSound(engine.getAssetByName(name).uuid, {keep: true});\r\n}\r\nexport function createSvga(name, anchorName?) {\r\n\tlet inst = new svga.Svga();\r\n\tinst.source = 'asset://' + engine.getAssetByName(name).uuid;\r\n\treturn inst;\r\n}\r\n","/**\r\n * Created by rockyl on 2020-01-21.\r\n */\r\n\r\nexport let props: any = {};\r\n\r\nexport function prepareProps() {\r\n\tlet metaProps = getProps();\r\n\tengine.injectProp(props, metaProps);\r\n\r\n}\r\n\r\nexport function injectProps(p) {\r\n\tengine.injectProp(props, p);\r\n}\r\n","\r\nimport { getTextureByName, createSvga } from './utils';\r\nimport { props } from \"../props\";\r\n\r\nexport default class Gameinit extends engine.Container {\r\n\r\n private _isSetUp = false;\r\n private isYes = true;\r\n private num = -1;\r\n private isDid = true;\r\n _body: engine.Rect;\r\n /**cardW,cardH,intervalX,intervalY */\r\n constructor() {\r\n super();\r\n this.once(engine.Event.ADDED_TO_STAGE, this.setup, this);\r\n }\r\n /**首页加载 */\r\n setup() {\r\n if (this._isSetUp) {\r\n return;\r\n }\r\n else {\r\n this.loadinit();\r\n }\r\n }\r\n /**套圈资源加载 */\r\n loadinit() {\r\n let self = this;\r\n let body;\r\n body = this._body = new engine.Rect;\r\n body.width = 0.0001;\r\n body.height = 0.0001;\r\n this.addChild(body);\r\n this.loadCard0(body, props.totleCardCount, props.eachLineCardCount, props.eachCardWidth, props.eachCardHeight, props.intervalX, props.inervalY);\r\n let [v2X, v2Y] = props.turnCardModuleGlobalPosition;\r\n body.x = v2X;\r\n body.y = v2Y;\r\n console.log(\"*******\", props.eachLineCardCount * (props.eachCardWidth + props.intervalX), props.totleCardCount / props.eachLineCardCount * (props.eachCardHeight + props.inervalY), \"*********\");\r\n console.log('》》》》》', body.children.length, '《《《《《');\r\n /********************************/\r\n // let btn = this.addRes(body, \"牌子\", 300, 800, 50, 50);\r\n // btn.addEventListener(engine.MouseEvent.MOUSE_DOWN, function () {\r\n // self.randomTurnCard(body);\r\n // }, this);\r\n // let btn1 = this.addRes(body, \"牌子\", 600, 800, 70, 70);\r\n // btn1.addEventListener(engine.MouseEvent.MOUSE_DOWN, function () {\r\n // // this.randomTurnCard(body);\r\n // console.log(\"000\");\r\n // body.children[this.num].scaleX = 1;\r\n // self.isYes = true;\r\n // // self.isDid = true;\r\n // }, this);\r\n /*********************************/\r\n engine.globalEvent.addEventListener(\"turn-card-game-start\", function () {\r\n self.randomTurnCard(body);\r\n });\r\n engine.globalEvent.addEventListener(\"turn-card-game-init\", function () {\r\n console.log(\"000\");\r\n body.children[this.num].scaleX = 1;\r\n self.isYes = true;\r\n });\r\n }\r\n /**随机进行翻牌子 */\r\n randomTurnCard(bodyNode) {\r\n console.log(\"click\");\r\n if (this.isYes) {\r\n this.num = Math.floor(Math.random() * (bodyNode.children.length));\r\n console.log(\"num====\", this.num, '=====');\r\n console.log(\"fatherNode[num]==\", bodyNode.children[this.num]);\r\n this.aniCardTurn(bodyNode.children[this.num], this.isDid), this.isYes = false;\r\n }\r\n }\r\n /** loading card */\r\n loadCard0(fatherNode, count, eachLine, cardW, cardH, intervalX, intervalY) {\r\n //let card0 = this.addRes(fatherNode, \"牌子\", 0, 0, 163, 184,30,10);\r\n let card;\r\n for (let j = 0; j < count / eachLine; j++) {\r\n for (let i = 0; i < eachLine; i++) {\r\n card = this.addRes(fatherNode, \"牌子\", (cardW + intervalX) * i, (cardH + intervalY) * j, cardW, cardH);\r\n card.anchor.x = cardW / 2;\r\n card.anchor.y = cardH / 2;\r\n //点击翻牌子的情况**************\r\n // card.addEventListener(engine.MouseEvent.MOUSE_DOWN, this.aniCardTurn)\r\n }\r\n }\r\n return card;\r\n }\r\n /**给场景添加图片,resName:资源名字,v2X:资源X位置, v2Y:资源Y位置, resW:资源Width, resH:资源Height */\r\n addRes(fatherNode, resName, v2X, v2Y, resW, resH) {\r\n console.log(\"进行资源的添加\");\r\n let thing = new engine.Sprite(getTextureByName(resName));\r\n thing.x = v2X;\r\n thing.y = v2Y;\r\n thing.width = resW;\r\n thing.height = resH;\r\n return fatherNode.addChild(thing);\r\n }\r\n /** card turn */\r\n aniCardTurn(turnNode, bool) {\r\n // console.log(']]]]]', turnNode);\r\n turnNode.addEventListener(engine.Event.ENTER_FRAME, function () {\r\n if (bool) {\r\n if (turnNode.scaleX >= 0.1 && turnNode.scaleX <= 1) {\r\n turnNode.scaleX -= 0.03;\r\n console.log(\"动画未完成 bool==\", bool);\r\n }\r\n else {\r\n console.log(\"bool\", bool);\r\n console.log(\"00000000000000\");\r\n bool = false;\r\n engine.globalEvent.dispatchEvent(\"turn-card-game-end\");\r\n }\r\n }\r\n });\r\n }\r\n}\r\n","/**\r\n * Created by rockyl on 2019-11-20.\r\n */\r\n\r\nimport Gameinit from \"./game/Gameinit\";\r\nimport { injectProps, prepareProps } from \"./props\";\r\n\r\nexport default function (props) {\r\n\tprepareProps();\r\n\tinjectProps(props);\r\n\tlet instance = new Gameinit();\r\n\treturn instance;\r\n}\r\n"],"names":["__extends"],"mappings":";;;;;;UAIgB,UAAU,CAAC,IAAI;KAC9B,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;CACvD,CAAC;UAEe,gBAAgB,CAAC,IAAI;KACpC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC;KAChD,OAAO,UAAU,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;CACrD,CAAC;;;CCPM,IAAI,KAAK,GAAQ,EAAE,CAAC;AAE3B,UAAgB,YAAY;KAC3B,IAAI,SAAS,GAAG,QAAQ,EAAE,CAAC;KAC3B,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;CAErC,CAAC;AAED,UAAgB,WAAW,CAAC,CAAC;KAC5B,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;CAC7B,CAAC;;;CCVD;KAAsCA,kCAAgB;KAQlD;SAAA,YACI,iBAAO,SAEV;SATO,cAAQ,GAAG,KAAK,CAAC;SACjB,WAAK,GAAG,IAAI,CAAC;SACb,SAAG,GAAG,CAAC,CAAC,CAAC;SACT,WAAK,GAAG,IAAI,CAAC;SAKjB,KA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IAAI,CAAC,CAAC;qBAC1B,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;qBAC9B,IAAI,GAAG,KAAK,CAAC;qBACb,MAAM,CAAC,WAAW,CAAC,aAAa,CAAC,oBAAoB,CAAC,CAAC;kBAC1D;cACJ;UACJ,CAAC,CAAC;MACN;KACL,eAAC;CAAD,CAAC,CA/GqC,MAAM,CAAC,SAAS,GA+GrD;;;iBC5GwB,KAAK;KAC7B,YAAY,EAAE,CAAC;KACf,WAAW,CAAC,KAAK,CAAC,CAAC;KACnB,IAAI,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;KAC9B,OAAO,QAAQ,CAAC;CACjB,CAAC;;;;;;;;;"}
\ No newline at end of file
/**
* Created by rockyl on 2020-01-21.
*/
let customModuleProps = {
};
{
"name": "翻牌子",
"desc": "翻牌子模块",
"props": {
"turnCardModuleGlobalPosition": {
"alias": "翻牌子模块的位置",
"type": "array<number>",
"default": "0,0"
},
"totleCardCount": {
"alias": "总的牌子的数量",
"type": "number",
"default": 6
},
"eachLineCardCount": {
"alias": "每行的牌子数量",
"type": "number",
"default": 3
},
"eachCardWidth": {
"alias": "每个牌子的宽度",
"type": "number",
"default": 163
},
"eachCardHeight": {
"alias": "每个牌子的高度",
"type": "number",
"default": 184
},
"intervalX": {
"alias": "同行牌子的间距",
"type": "number",
"default": 30
},
"inervalY": {
"alias": "同列牌子的间距",
"type": "number",
"default": 10
}
},
"assets": [
{
"name": "牌子",
"url": "//yun.duiba.com.cn/aurora/assets/400eb0c613d7cdd4cd4c1e561ad65a82bd834f80.png",
"uuid": "8494ba36-adee-4d0d-8d2c-f32354cd8bdc",
"ext": ".png"
}
],
"events": {
"in": {
"turn-card-game-start": {
"alias": "游戏开始"
},
"turn-card-game-init": {
"alias": "初始化"
}
},
"out": {
"turn-card-game-end": {
"alias": "翻牌子完毕",
"data": {
"reason": "套圈结束,执行抽奖"
}
}
}
}
}
\ No newline at end of file
import { getTextureByName, createSvga } from './utils';
import { props } from "../props";
export default class Gameinit extends engine.Container {
private _isSetUp = false;
private isYes = true;
private num = -1;
private isDid = true;
_body: engine.Rect;
/**cardW,cardH,intervalX,intervalY */
constructor() {
super();
this.once(engine.Event.ADDED_TO_STAGE, this.setup, this);
}
/**首页加载 */
setup() {
if (this._isSetUp) {
return;
}
else {
this.loadinit();
}
}
/**套圈资源加载 */
loadinit() {
let self = this;
let body;
body = this._body = new engine.Rect;
body.width = 0.0001;
body.height = 0.0001;
this.addChild(body);
this.loadCard0(body, props.totleCardCount, props.eachLineCardCount, props.eachCardWidth, props.eachCardHeight, props.intervalX, props.inervalY);
let [v2X, v2Y] = props.turnCardModuleGlobalPosition;
body.x = v2X;
body.y = v2Y;
console.log("*******", props.eachLineCardCount * (props.eachCardWidth + props.intervalX), props.totleCardCount / props.eachLineCardCount * (props.eachCardHeight + props.inervalY), "*********");
console.log('》》》》》', body.children.length, '《《《《《');
/********************************/
// let btn = this.addRes(body, "牌子", 300, 800, 50, 50);
// btn.addEventListener(engine.MouseEvent.MOUSE_DOWN, function () {
// self.randomTurnCard(body);
// }, this);
// let btn1 = this.addRes(body, "牌子", 600, 800, 70, 70);
// btn1.addEventListener(engine.MouseEvent.MOUSE_DOWN, function () {
// // this.randomTurnCard(body);
// console.log("000");
// body.children[this.num].scaleX = 1;
// self.isYes = true;
// // self.isDid = true;
// }, this);
/*********************************/
engine.globalEvent.addEventListener("turn-card-game-start", function () {
self.randomTurnCard(body);
});
engine.globalEvent.addEventListener("turn-card-game-init", function () {
console.log("000");
body.children[this.num].scaleX = 1;
self.isYes = true;
});
}
/**随机进行翻牌子 */
randomTurnCard(bodyNode) {
console.log("click");
if (this.isYes) {
this.num = Math.floor(Math.random() * (bodyNode.children.length));
console.log("num====", this.num, '=====');
console.log("fatherNode[num]==", bodyNode.children[this.num]);
this.aniCardTurn(bodyNode.children[this.num], this.isDid), this.isYes = false;
}
}
/** loading card */
loadCard0(fatherNode, count, eachLine, cardW, cardH, intervalX, intervalY) {
//let card0 = this.addRes(fatherNode, "牌子", 0, 0, 163, 184,30,10);
let card;
for (let j = 0; j < count / eachLine; j++) {
for (let i = 0; i < eachLine; i++) {
card = this.addRes(fatherNode, "牌子", (cardW + intervalX) * i, (cardH + intervalY) * j, cardW, cardH);
card.anchor.x = cardW / 2;
card.anchor.y = cardH / 2;
//点击翻牌子的情况**************
// card.addEventListener(engine.MouseEvent.MOUSE_DOWN, this.aniCardTurn)
}
}
return card;
}
/**给场景添加图片,resName:资源名字,v2X:资源X位置, v2Y:资源Y位置, resW:资源Width, resH:资源Height */
addRes(fatherNode, resName, v2X, v2Y, resW, resH) {
console.log("进行资源的添加");
let thing = new engine.Sprite(getTextureByName(resName));
thing.x = v2X;
thing.y = v2Y;
thing.width = resW;
thing.height = resH;
return fatherNode.addChild(thing);
}
/** card turn */
aniCardTurn(turnNode, bool) {
// console.log(']]]]]', turnNode);
turnNode.addEventListener(engine.Event.ENTER_FRAME, function () {
if (bool) {
if (turnNode.scaleX >= 0.1 && turnNode.scaleX <= 1) {
turnNode.scaleX -= 0.03;
console.log("动画未完成 bool==", bool);
}
else {
console.log("bool", bool);
console.log("00000000000000");
bool = false;
engine.globalEvent.dispatchEvent("turn-card-game-end");
}
}
});
}
}
/**
* Created by rockyl on 2020-01-21.
*/
export function getTexture(uuid) {
return engine.Texture.from(getAssetByUUID(uuid).uuid);
}
export function getTextureByName(name) {
console.log('name',engine.getAssetByName(name));
return getTexture(engine.getAssetByName(name).uuid);
}
export function playSound(name) {
engine.playSound(engine.getAssetByName(name).uuid, {keep: true});
}
export function createSvga(name, anchorName?) {
let inst = new svga.Svga();
inst.source = 'asset://' + engine.getAssetByName(name).uuid;
return inst;
}
/**
* Created by rockyl on 2019-11-20.
*/
import Gameinit from "./game/Gameinit";
import { injectProps, prepareProps } from "./props";
export default function (props) {
prepareProps();
injectProps(props);
let instance = new Gameinit();
return instance;
}
/**
* Created by rockyl on 2020-01-21.
*/
export let props: any = {};
export function prepareProps() {
let metaProps = getProps();
engine.injectProp(props, metaProps);
}
export function injectProps(p) {
engine.injectProp(props, p);
}
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