Commit db73236a authored by 汪欢's avatar 汪欢

Merge branch 'dev' of http://gitlab2.dui88.com/laoqifeng/zeroing-libs into dev

parents 24e624ed c8ec6a6a
No preview for this file type
No preview for this file type
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
{
"name": "大转盘",
"desc": "大转盘模块",
"props": {
"iconSize": {
"alias": "奖品图的大小",
"type": "array<number>",
"default": "80,80"
},
"diameter": {
"alias": "圆盘直径",
"type": "number",
"default": "600"
},
"prizesRadius": {
"alias": "奖品距离圆心的距离",
"type": "number",
"default": 250
},
"nameColor": {
"alias": "奖品名称的字体颜色",
"type": "string",
"default": "#444444"
},
"nameSize": {
"alias": "奖品名称的字体大小",
"type": "number",
"default": 20
},
"iconY": {
"alias": "奖品名称的Y轴偏移",
"type": "number",
"default": 30
},
"rotationBg": {
"alias": "背景旋转",
"type": "number",
"default": 30
}
},
"assets": [
{
"name": "大转盘背景",
"url": "//yun.duiba.com.cn/aurora/assets/559177b3c0d4245d245b5cdfa31ba9d9dc20223c.png",
"uuid": "d3ce99da-89e1-447d-8c52-b3f391925c3c",
"ext": ".png"
}
],
"events": {
"in": {
"turnplate-reset": {
"alias": "重置",
"data": {
"prizes": "所有奖品"
}
},
"turnplate-start": {
"alias": "开始",
"data": {
"prizeId": "中奖的奖品id"
}
}
},
"out": {
"turnplate-over": {
"alias": "转盘停止",
"data": {
"prizeId": "中奖的奖品id"
}
}
}
},
"id": "turnplate",
"code": "(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('tslib')) :\n\ttypeof define === 'function' && define.amd ? define(['tslib'], factory) :\n\t(global = global || self, global.turnplate = factory(global.tslib));\n}(this, (function (tslib) { 'use strict';\n\n\tvar props = {};\n\tfunction prepareProps() {\n\t var metaProps = getProps();\n\t engine.injectProp(props, metaProps);\n\t}\n\tfunction injectProps(p) {\n\t engine.injectProp(props, p);\n\t}\n\n\tfunction getTextureByName(name) {\n\t return engine.Texture.from(getAssetByName(name).uuid);\n\t}\n\n\tvar GameWrapper = (function (_super) {\n\t tslib.__extends(GameWrapper, _super);\n\t function GameWrapper() {\n\t var _this = _super.call(this) || this;\n\t _this.wheelPrizeRotation = [];\n\t _this.items = [];\n\t _this.itemsCon = [];\n\t _this.itemsLabel = [];\n\t _this.itemsIcon = [];\n\t _this.once(engine.Event.ADDED_TO_STAGE, _this.setup, _this);\n\t engine.globalEvent.addEventListener('turnplate-reset', _this.reset, _this);\n\t engine.globalEvent.addEventListener('turnplate-start', _this.start, _this);\n\t return _this;\n\t }\n\t GameWrapper.prototype.setup = function () {\n\t this.turnplate = new engine.Container();\n\t this.turnplate.x = 0;\n\t this.turnplate.y = 0;\n\t this.turnplate.rotation = -90;\n\t this.turnplate.width = props.diameter;\n\t this.turnplate.height = props.diameter;\n\t this.turnplate.anchorX = this.turnplate.width / 2;\n\t this.turnplate.anchorY = this.turnplate.height / 2;\n\t this.addChild(this.turnplate);\n\t this._turnplateBG = new engine.Container();\n\t this._turnplateBG.width = props.diameter;\n\t this._turnplateBG.height = props.diameter;\n\t this._turnplateBG.anchorX = this.turnplate.width / 2;\n\t this._turnplateBG.anchorY = this.turnplate.height / 2;\n\t this._turnplateBG.rotation = props.rotationBg;\n\t this.turnplate.addChild(this._turnplateBG);\n\t this.turnplateBg = new engine.Sprite(getTextureByName('大转盘背景'));\n\t this.turnplateBg.x = 0;\n\t this.turnplateBg.y = 0;\n\t this.turnplateBg.width = this.turnplate.width;\n\t this.turnplateBg.height = this.turnplate.height;\n\t this._turnplateBG.addChild(this.turnplateBg);\n\t };\n\t GameWrapper.prototype.reset = function (event) {\n\t injectProps(event.data);\n\t this.prizes = event.data.prizes;\n\t console.log(this.prizes);\n\t for (var i = 0; i < this.items.length; i++) {\n\t this.itemsCon[i].removeChild(this.itemsLabel[i]);\n\t this.itemsCon[i].removeChild(this.itemsIcon[i]);\n\t this.items[i].removeChild(this.itemsCon[i]);\n\t this.turnplate.removeChild(this.items[i]);\n\t }\n\t for (var i = 0; i < this.prizes.length; i++) {\n\t this.items[i] = new engine.Container();\n\t this.itemsCon[i] = new engine.Container();\n\t this.itemsCon[i].x = props.prizesRadius;\n\t this.itemsCon[i].rotation = 90;\n\t this.items[i].x = this.turnplate.width / 2;\n\t this.items[i].y = this.turnplate.height / 2;\n\t this.turnplate.addChild(this.items[i]);\n\t this.itemsLabel[i] = new engine.Label();\n\t this.itemsLabel[i].text = this.prizes[i].name;\n\t this.itemsLabel[i].width = 200;\n\t this.itemsLabel[i].x = -this.itemsLabel[i].width / 2;\n\t this.itemsLabel[i].textAlign = \"center\";\n\t this.itemsLabel[i].fillColor = props.nameColor;\n\t this.itemsLabel[i].size = props.nameSize;\n\t this.itemsIcon[i] = new engine.Sprite();\n\t this.itemsIcon[i].width = props.iconSize[0];\n\t this.itemsIcon[i].height = props.iconSize[1];\n\t this.itemsIcon[i].x = -this.itemsIcon[i].width / 2;\n\t this.itemsIcon[i].y = props.iconY;\n\t this.itemsIcon[i].texture = engine.Texture.from(this.prizes[i].icon);\n\t this.itemsCon[i].addChild(this.itemsLabel[i]);\n\t this.itemsCon[i].addChild(this.itemsIcon[i]);\n\t this.items[i].addChild(this.itemsCon[i]);\n\t var _rotation = (i) * (360 / this.prizes.length);\n\t this.items[i].rotation = _rotation;\n\t this.wheelPrizeRotation[this.prizes[i].prizeId] = _rotation;\n\t }\n\t this.turnplate.rotation = -90;\n\t engine.Tween.removeTweens(this.turnplate);\n\t engine.Tween.get(this.turnplate, { loop: true })\n\t .to({ rotation: 360 - 90 }, 5000);\n\t };\n\t GameWrapper.prototype.start = function (event) {\n\t var _this = this;\n\t injectProps(event.data);\n\t engine.Tween.removeTweens(this.turnplate);\n\t var prizeId = event.data.prizeId;\n\t engine.Tween.get(this.turnplate)\n\t .to({ rotation: 7200 - this.wheelPrizeRotation[prizeId] - 90 }, 8000, engine.Ease.circInOut)\n\t .wait(500)\n\t .call(function () {\n\t _this.turnplate.rotation = 360 - _this.wheelPrizeRotation[prizeId] + 0.001 - 90;\n\t engine.globalEvent.dispatchEvent('turnplate-over', {\n\t prizeId: prizeId\n\t });\n\t });\n\t };\n\t return GameWrapper;\n\t}(engine.Container));\n\n\tfunction index (props) {\n\t prepareProps();\n\t injectProps(props);\n\t var instance = new GameWrapper();\n\t return instance;\n\t}\n\n\treturn index;\n\n})));\n"
}
This diff is collapsed.
This diff is collapsed.
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
"typescript": "^3.7.2" "typescript": "^3.7.2"
}, },
"dependencies": { "dependencies": {
"cnpm": "^6.1.1",
"commander": "^4.1.0", "commander": "^4.1.0",
"watchr": "^5.6.0" "watchr": "^5.6.0"
} }
......
/**
* Created by rockyl on 2019-12-16.
*/
const customId = 'bjxd-game';
(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('bjxd-game-start', {guide: 1});
}, 500);
setTimeout(() => {
engine.globalEvent.dispatchEvent('bjxd-game-reset', {guide: 2});
}, 600);
});
engine.globalEvent.addEventListener('dxbcyj-game-result', (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: transparent;
}
</style>
</head>
<body>
<div id="game-container" style="line-height:0;font-size:0"></div>
<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/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 = [
];
function loadAssets(customModuleAssets, onProgress, onComplete){
return engine.loadAssets(assets.concat(...customModuleAssets), onProgress, onComplete);
}
This diff is collapsed.
This diff is collapsed.
/**
* Created by rockyl on 2020-01-21.
*/
let customModuleProps = {
};
{
"name": "北京现代出游季",
"desc": "北京现代出游记模块",
"props": {
"guideText1": {
"alias": "引导1的文本",
"type": "string",
"default": "长按屏幕\n杆子变长即可通过"
},
"guideText2": {
"alias": "引导2的文本",
"type": "string",
"default": "当度小宝获得金币时积分+5"
},
"pierMinDistance": {
"alias": "障碍物最小间距",
"type": "number",
"default": 350
},
"pierMaxDistance": {
"alias": "障碍物最大间距",
"type": "number",
"default": 500
},
"frontBGMoveSpeed": {
"alias": "前背影移动速度",
"type": "number",
"default": 0.5
},
"afterBGMoveSpeed": {
"alias": "后背影移动速度",
"type": "number",
"default": 0.2
},
"reward": {
"alias": "出现金币的概率(0-1区间 1为必出现 0为必不出现)",
"type": "number",
"default": 0
},
"pierCount": {
"alias": "一屏中最多出现的桥墩数量(最好默认为2)",
"type": "number",
"default": 2
},
"pierMoveTime": {
"alias": "一个周期内桥墩移动的总时长(毫秒)",
"type": "number",
"default": 1000
},
"strutUpSpeed": {
"alias": "撑杆上升速度(每帧上升增量,一秒60帧)",
"type": "number",
"default": 30
},
"strutWidth": {
"alias": "撑杆宽度",
"type": "number",
"default": 5
},
"strutColor": {
"alias": "撑杆颜色",
"type": "string",
"default": "#ffffff"
},
"strutRotationSpeed": {
"alias": "撑杆旋转总时长(毫秒)",
"type": "number",
"default": 300
},
"playerMoveSpeed": {
"alias": "人物移动总时长(毫秒)",
"type": "number",
"default": 1200
},
"singleScore": {
"alias": "每个桥墩分数",
"type": "number",
"default": 5
},
"goldScore": {
"alias": "每个金币分数",
"type": "number",
"default": 5
},
"bgFristScore": {
"alias": "第一张图的分数区间最大值(超过此值就更换第二张背景图)",
"type": "number",
"default": 30
},
"bgSecondScore": {
"alias": "第二张图的分数区间最大值(超过此值就更换第三张背景图)",
"type": "number",
"default": 80
}
},
"assets": [
{
"name": "bg1",
"url": "//yun.duiba.com.cn/aurora/assets/f3fda198741657d9cab9418bd5d47248af065487.jpg",
"uuid": "bg1",
"ext": ".jpg"
},
{
"name": "bg2",
"url": "//yun.duiba.com.cn/aurora/assets/8fa1de1570023f21b676a8602ec9315cee83a99b.jpg",
"uuid": "bg2",
"ext": ".jpg"
},
{
"name": "bg3",
"url": "//yun.duiba.com.cn/aurora/assets/517fc529c79b18ff4881d206c942c8f2888ad6fd.jpg",
"uuid": "bg3",
"ext": ".jpg"
},
{
"name": "car1",
"url": "//yun.duiba.com.cn/aurora/assets/c1e80aee4eee3665e0f0bce08233b05be4b4ee9c.png",
"uuid": "car1",
"ext": ".png"
},
{
"name": "yindao1",
"url": "//yun.duiba.com.cn/aurora/assets/4449285320882460ae0dd0b59b3c73e0bb92def6.png",
"uuid": "yindao1",
"ext": ".png"
},
{
"name": "yindao2",
"url": "//yun.duiba.com.cn/aurora/assets/1c914031834736b93e9b2a94a4e8a643871795f7.png",
"uuid": "yindao2",
"ext": ".png"
},
{
"name": "shouzhi",
"url": "//yun.duiba.com.cn/aurora/assets/fd62b438bfd67345fe441f5e68e4394d650fac8d.png",
"uuid": "shouzhi",
"ext": ".png"
},
{
"name": "zhuzi1",
"url": "//yun.duiba.com.cn/aurora/assets/cb779c9ebf4bfbd5bec1d817a6ef824d4ae5d751.png",
"uuid": "zhuzi1",
"ext": ".png"
},
{
"name": "zhuzi2",
"url": "//yun.duiba.com.cn/aurora/assets/c5187595bec08c211c8e45bf5f163ff02fd659ab.png",
"uuid": "zhuzi2",
"ext": ".png"
},
{
"name": "zhuzi3",
"url": "//yun.duiba.com.cn/aurora/assets/08dc255864c2af52dac7a993a4c62b1970dd6db4.png",
"uuid": "zhuzi3",
"ext": ".png"
},
{
"name": "person",
"url": "//yun.duiba.com.cn/aurora/assets/094526243496c8ebf1002f73f3cbbf3c9e12892a.png",
"uuid": "person",
"ext": ".png"
},
{
"name": "gold",
"url": "//yun.duiba.com.cn/aurora/assets/ae210ad26cee13f8fb6e69be62f7f5498be50a5b.png",
"uuid": "7f4e19f2-c80f-4a65-bec2-1f3c3dc6d210",
"ext": ".png"
},
{
"name": "walk",
"url": "//yun.duiba.com.cn/aurora/assets/5b31481f8d5669213da518b156aac7cadf5d9374",
"uuid": "10cd1fdd-4fd8-43cf-a1c7-6ff5846d8a91",
"ext": ".svga"
},
{
"name": "xiache",
"url": "//yun.duiba.com.cn/aurora/assets/57ad75aa036c04e13abcf32c464ff5ae37419495",
"uuid": "xiache",
"ext": ".svga"
},
{
"name": "ganzi",
"url": "//yun.duiba.com.cn/aurora/assets/501972d5960c29b7db1e476422e6fd3cb3a92c8f.png",
"uuid": "ganzi",
"ext": ".png"
}
],
"events": {
"in": {
"bjxd-game-start": {
"alias": "开始",
"data": {
}
},
"bjxd-game-revive": {
"alias": "复活",
"data": {
}
},
"bjxd-game-reset": {
"alias": "重置",
"data": {
}
},
"bjxd-game-change": {
"alias": "替换显示",
"data": {
"index":1
}
},
"bjxd-game-speed": {
"alias": "修改速度",
"data": {
"speed":10
}
}
},
"out": {
"bjxd-game-over": {
"alias": "游戏结束",
"data": {
"score":0
}
},
"bjxd-game-score": {
"alias": "分数",
"data": {
"score":0
}
},
"bjxd-game-inmove": {
"alias": "游戏进行状态",
"data": {
"canstop":false
}
}
}
}
}
\ No newline at end of file
import {getTextureByName} from "./utils";
import {getStage} from "./utils";
import {LoopComponent} from "./LoopComponent";
import { props } from './../props';
export class Background extends engine.Container{
partResHHL = ['bg1',''];
partResHB = ['bg2',''];
partResWH = ['bg3',''];
speeds = [];
resArray=[];
frameMovePos = 0;
frameIndex;
sumMovePos;
//需要的总帧数
needFrameSum;
initBg(){
this.sumMovePos = 0;
this.speeds.push(props.afterBGMoveSpeed);
this.speeds.push(props.frontBGMoveSpeed);
let bottomBg = new engine.Rect();
bottomBg.x = 0;
bottomBg.y = 0;
bottomBg.width = getStage().width;
bottomBg.height = 0;
bottomBg.fillColor = 0x75c9f5;
this.addChild(bottomBg);
this.resArray.push(this.partResHHL)
this.resArray.push(this.partResHB)
this.resArray.push(this.partResWH)
const parts = [];
for(let i = 0; i < 2; i++){
let part = new LoopComponent();
part.setupLoop([
this.resArray[0][i],
this.resArray[0][i],
]);
parts.push(part);
this.addChild(part);
}
//(height - parts[1].height) / 2 - 200
parts[1].y = 200;
}
setViewport(pos) {
this.needFrameSum = (props.pierMoveTime/1000)*60;
this.frameMovePos = pos/this.needFrameSum;
this.frameIndex = 0;
this.addEventListener(engine.Event.ENTER_FRAME,this.frameBack,this);
}
frameBack(){
if( this.frameIndex < this.needFrameSum){
for (let i = 0; i < 2; i++) {
const part = <LoopComponent>this.getChildAt(i + 1);
const speed = this.speeds[i];
let tmpPos = ((this.frameMovePos * this.frameIndex) + this.sumMovePos ) * speed;
part.setViewport(tmpPos)
}
this.frameIndex++
}else{
this.sumMovePos += this.frameMovePos * this.needFrameSum;
this.frameIndex = 0
this.removeEventListener(engine.Event.ENTER_FRAME,this.frameBack,this);
}
}
changeBg(index){
for (let i = 0; i < 2; i++) {
const part = <LoopComponent>this.getChildAt(i + 1);
part.changeBg(this.resArray[index][i]);
if(i == 1 && index ==1){
part.y = 400;
}
if(i == 1 && index ==2){
part.y = 250;
}
}
}
}
\ No newline at end of file
This diff is collapsed.
/**
* Created by rockyl on 2020-01-09.
*/
import GameView from "./GameView";
export class GameWrapper extends engine.Container {
private _gameView: GameView;
constructor() {
super();
engine.globalEvent.addEventListener('bjxd-game-start', this.start, this);
engine.globalEvent.addEventListener('bjxd-game-reset', this.reset, this);
engine.globalEvent.addEventListener('bjxd-game-revive',this.revive,this);
engine.globalEvent.addEventListener('bjxd-game-change',this.change,this);
engine.globalEvent.addEventListener('bjxd-game-speed',this.speed,this);
let gameView = this._gameView = new GameView();
this.addChild(gameView);
//this.once(engine.Event.ENTER_FRAME, this.onAddedToStage, this);
}
start(event: engine.Event) {
this._gameView.start(event.data.guide);
}
reset(){
this._gameView.reset();
}
revive(){
this._gameView.revive();
}
change(event:engine.Event){
// console.log("切换图片显示");
this._gameView.changeBg(event.data.index);
}
speed(event:engine.Event){
this._gameView.changeSpeed(event.data.speed);
}
}
/**
* Created by rockyl on 2020-01-30.
*/
import {props} from "../props";
import {getTextureByName} from "./utils";
export class GuideLayer extends engine.Container {
private guideMask: engine.Container;
guideImg:engine.Image;
shouzhi:engine.Image;
_options;
_callBack;
constructor() {
super();
this.setup();
}
private setup() {
}
show(id, options,callback?) {
this.visible = true;
this._callBack = callback?callback:null;
if (!this.guideMask) {
const {width, height} = this.stage;
this.guideMask = new engine.Container();
this.addChild(this.guideMask);
this.guideImg = new engine.Image();
this.guideMask.addChild(this.guideImg);
this.shouzhi = new engine.Image(getTextureByName("shouzhi"));
this.guideMask.addChild(this.shouzhi);
}
this.guideImg.texture = getTextureByName("yindao"+id);
this.guideStep(id);
this.once(engine.MouseEvent.CLICK, function(){
this.visible = false;
if(this._callBack){
this._callBack();
}
}, this);
}
guideStep(id){
if(id == 1){
this.shouzhi.x = 244;
this.shouzhi.y = 812;
}
if(id == 2){
this.shouzhi.x = 346;
this.shouzhi.y = 1108;
}
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/**
* Created by rockyl on 2018/9/10.
*
* 分数标签
*/
export class ScoreLabel extends engine.Label {
_value;
_tmp;
updateScore(score,animation = true) {
this._value = score;
if (animation && this._tmp) {
this.animationUpdate();
} else {
this.updateLocal(score);
}
}
animationUpdate(){
let tmpInterval = setInterval(()=>{
this._tmp += 1;
if(this._tmp <= this._value){
this.text = this._tmp
}else{
this._tmp = this._value;
clearInterval(tmpInterval);
}
},50)
}
updateLocal(v){
this._tmp = v;
this.text = v;
}
}
This diff is collapsed.
import { Pier } from './Pier';
/**
* Created by rockyl on 2020-02-03.
*/
import ObjectPool = engine.ObjectPool;
export const PoolName: string = 'pier';
ObjectPool.registerPool(PoolName, function () {
return new Pier();
}, function (item: Pier, data) {
item.init();
});
This diff is collapsed.
/**
* Created by rockyl on 2019-11-20.
*/
import {GameWrapper} from "./game/GameWrapper";
import {injectProps, prepareProps} from "./props";
export default function (props) {
prepareProps();
injectProps(props);
let instance = new GameWrapper();
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);
}
This diff is collapsed.
This diff is collapsed.
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
"strutUpSpeed": { "strutUpSpeed": {
"alias": "撑杆上升速度(每帧上升增量,一秒60帧)", "alias": "撑杆上升速度(每帧上升增量,一秒60帧)",
"type": "number", "type": "number",
"default": 10 "default": 30
}, },
"strutWidth": { "strutWidth": {
"alias": "撑杆宽度", "alias": "撑杆宽度",
......
This diff is collapsed.
This diff is collapsed.
...@@ -72,7 +72,7 @@ export class Turntable extends engine.Container{ ...@@ -72,7 +72,7 @@ export class Turntable extends engine.Container{
let titleLabel = new engine.Label(); let titleLabel = new engine.Label();
titleLabel.fillColor = props.prizeName_color; titleLabel.fillColor = props.prizeName_color;
titleLabel.size = props.prizeName_size; titleLabel.size = props.prizeName_size;
titleLabel.width = unchecked.width; titleLabel.width = tmpNode.width;
titleLabel.textAlign = engine.TEXT_ALIGN.CENTER; titleLabel.textAlign = engine.TEXT_ALIGN.CENTER;
titleLabel.x = 0; titleLabel.x = 0;
titleLabel.y = props.prizeName_Ypos; titleLabel.y = props.prizeName_Ypos;
......
...@@ -31,4 +31,4 @@ export function createSvga(name, anchorName) { ...@@ -31,4 +31,4 @@ export function createSvga(name, anchorName) {
export function playSound(name) { export function playSound(name) {
engine.playSound(getAssetByName(name).uuid, {keep: true}); engine.playSound(getAssetByName(name).uuid, {keep: true});
} }
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/**
* Created by rockyl on 2020-01-21.
*/
let customModuleProps = {
};
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/**
* 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);
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/**
* Created by rockyl on 2020-01-21.
*/
let customModuleProps = {
};
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -68,7 +68,7 @@ const getTargetName = (type: GarbageTypes) => { ...@@ -68,7 +68,7 @@ const getTargetName = (type: GarbageTypes) => {
break; break;
case GarbageTypes.wetWaste: case GarbageTypes.wetWaste:
return '湿垃圾' return '厨余垃圾'
break; break;
case GarbageTypes.dryWaste: case GarbageTypes.dryWaste:
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -29,13 +29,13 @@ export class GameWrapper extends engine.Container { ...@@ -29,13 +29,13 @@ export class GameWrapper extends engine.Container {
//this.start(null); //this.start(null);
// setTimeout(() => { // setTimeout(() => {
// engine.globalEvent.dispatchEvent('seabed-game-startNextLevel',{level:2}); // engine.globalEvent.dispatchEvent('seabed-game-startNextLevel',{level:1});
// }, 300); // }, 300);
} }
start(event: engine.Event) { start(event: engine.Event) {
setlevelData(); setlevelData();
this.initData(); this.initData();
this._gameView.start(event.data.color); this._gameView.start(event.data.resData);
['coin','boom','fail','success'].forEach(element => { ['coin','boom','fail','success'].forEach(element => {
getJsonAsset(element); getJsonAsset(element);
}); });
...@@ -56,6 +56,6 @@ export class GameWrapper extends engine.Container { ...@@ -56,6 +56,6 @@ export class GameWrapper extends engine.Container {
this._gameView.revive(); this._gameView.revive();
} }
themeChange(event: engine.Event){ themeChange(event: engine.Event){
this._gameView.themeChange(event.data.resData); //this._gameView.themeChange(event.data.resData);
} }
} }
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/**
* Created by rockyl on 2020-01-21.
*/
let customModuleProps = {
};
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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