Commit 7dc16f58 authored by lujinlei's avatar lujinlei

-a

parent f3ed9fcd
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -13,6 +13,7 @@
LabelType["egg"] = "egg";
})(LabelType || (LabelType = {}));
var LabelType$1 = LabelType;
//# sourceMappingURL=LabelType.js.map
var props = {};
function prepareProps() {
......@@ -22,6 +23,7 @@
function injectProps(p) {
engine.injectProp(props, p);
}
//# sourceMappingURL=props.js.map
var levels;
var setlevelData = function () {
......@@ -38,6 +40,7 @@
var setTouchEnabled = function (b) {
touchEnabled = b;
};
//# sourceMappingURL=GoldData.js.map
function getTexture(uuid) {
return engine.Texture.from(getAssetByUUID(uuid).uuid);
......@@ -45,6 +48,7 @@
function getTextureByName(name) {
return getTexture(engine.getAssetByName(name).uuid);
}
//# sourceMappingURL=utils.js.map
var Tool = (function () {
function Tool() {
......@@ -67,6 +71,7 @@
};
return Tool;
}());
//# sourceMappingURL=Tools.js.map
var curScore;
function getScore() {
......@@ -119,6 +124,7 @@
}
return getLevelData().max;
};
//# sourceMappingURL=goldData.js.map
var GameData = (function (_super) {
tslib.__extends(GameData, _super);
......@@ -138,32 +144,32 @@
scorelabel.y = 56;
this.addChild(scorelabel);
var progress = new engine.Sprite(getTextureByName('进度'));
progress.x = 212;
progress.x = 253;
progress.y = 8;
this.addChild(progress);
var progressMask = this._progressMask = new engine.Rect();
progressMask.fillColor = 0x000000;
progressMask.width = 245;
progressMask.height = 100;
progressMask.x = 213;
progressMask.x = 253;
progressMask.y = 5;
progressMask.scaleX = 0;
this.addChild(progressMask);
progress.mask = progressMask;
var star1 = new engine.Sprite(getTextureByName('点亮'));
star1.x = 270;
star1.x = 310;
star1.y = 6;
star1.visible = false;
this.addChild(star1);
this.starList.push(star1);
var star2 = new engine.Sprite(getTextureByName('点亮'));
star2.x = 365;
star2.x = 405;
star2.y = 6;
star2.visible = false;
this.addChild(star2);
this.starList.push(star2);
var star3 = new engine.Sprite(getTextureByName('点亮'));
star3.x = 435;
star3.x = 475;
star3.y = 50;
star3.visible = false;
this.addChild(star3);
......@@ -177,13 +183,13 @@
};
GameData.prototype.scorePosUpdate = function () {
this._scoreCount.text = getScore();
this._scoreCount.x = (this._parentNode.width - this._scoreCount.width - this._scorelabel.width - 5) / 2;
this._scoreCount.x = (750 - this._scoreCount.width - this._scorelabel.width - 5) / 2;
this._scorelabel.x = this._scoreCount.x + this._scoreCount.width + 5;
this.updateProgressMask();
};
GameData.prototype.levelUpdate = function (color) {
this._levelLabel.text = "\u7B2C" + getCurLevel() + "/3\u5173";
this._levelLabel.x = (this._parentNode.width - this._levelLabel.width) / 2;
this._levelLabel.x = (750 - this._levelLabel.width) / 2;
};
GameData.prototype.updateProgressMask = function () {
var ratio = getScore() / getlevelMax();
......@@ -205,6 +211,7 @@
};
return GameData;
}(engine.Container));
//# sourceMappingURL=gameData.js.map
var BaseItem = (function (_super) {
tslib.__extends(BaseItem, _super);
......@@ -229,6 +236,7 @@
});
return BaseItem;
}(engine.Sprite));
//# sourceMappingURL=BaseItem.js.map
var EgretRender = (function () {
function EgretRender(root, engine) {
......@@ -312,6 +320,7 @@
};
return EgretRender;
}());
//# sourceMappingURL=EgretRender.js.map
var wall = 1;
var basket = 2;
......@@ -325,6 +334,7 @@
var awardMask = wall + basket + bubble;
var bubbleMask = wall + basket + award;
var bubbleStandbyMask = wall + basket;
//# sourceMappingURL=collisionConfig.js.map
var vibrate = (function (view, count, strength) {
if (count === void 0) { count = 2; }
......@@ -362,6 +372,7 @@
}
});
});
//# sourceMappingURL=vibrate.js.map
var MovieClip = (function (_super) {
tslib.__extends(MovieClip, _super);
......@@ -450,12 +461,14 @@
});
return MovieClip;
}(engine.Image));
//# sourceMappingURL=MovieClip.js.map
var wait = function (duration) { return tslib.__awaiter(void 0, void 0, void 0, function () {
return tslib.__generator(this, function (_a) {
return [2, new Promise(function (resolve) { return setTimeout(resolve, duration); })];
});
}); };
//# sourceMappingURL=wait.js.map
var josnData = {};
function getJsonAsset(name) {
......@@ -488,6 +501,7 @@
function getJosnData(jsonName) {
return josnData[jsonName] || null;
}
//# sourceMappingURL=JsonTools.js.map
function createTextureSheet(baseTexture, altaData) {
var frames = altaData;
......@@ -516,6 +530,7 @@
}
return textures;
}
//# sourceMappingURL=createTextureSheet.js.map
function playMovieClip(parent, key, frames, frameInterval) {
if (frameInterval === void 0) { frameInterval = 5; }
......@@ -600,6 +615,7 @@
var playSuccess = function (parent) {
return playMovieClip(parent, 'success', ['success1.png', 'success2.png', 'success3.png', 'success4.png', 'success5.png', 'success6.png', 'success7.png', 'success8.png', 'success9.png'], 5);
};
//# sourceMappingURL=playMovieClip.js.map
var createCoin = function (scale) {
var josnData = getJosnData('coin');
......@@ -626,6 +642,7 @@
});
return movieclip;
};
//# sourceMappingURL=createCoin.js.map
var createBoom = function (scale) {
var josnData = getJosnData('boom');
......@@ -652,6 +669,7 @@
});
return movieclip;
};
//# sourceMappingURL=createBoom.js.map
var createGift = function (scale) {
var josnData = getJosnData('gift');
......@@ -678,6 +696,7 @@
});
return movieclip;
};
//# sourceMappingURL=createGift.js.map
var createCandy = function (scale) {
var josnData = getJosnData('candy');
......@@ -704,6 +723,7 @@
});
return movieclip;
};
//# sourceMappingURL=createCandy.js.map
var createEgg = function (scale) {
var josnData = getJosnData('egg');
......@@ -730,6 +750,7 @@
});
return movieclip;
};
//# sourceMappingURL=createEgg.js.map
var createItem = function (scale, type) {
var funcs = {
......@@ -742,6 +763,7 @@
var func = funcs[type];
return func(scale);
};
//# sourceMappingURL=createItem.js.map
var createBubble = function (_this, type, x, y, force, density) {
if (force === void 0) { force = { x: 0, y: 0 }; }
......@@ -790,6 +812,7 @@
}
}, 100);
});
//# sourceMappingURL=createItems.js.map
var clear = function (that) {
TextList.forEach(function (i) {
......@@ -836,6 +859,7 @@
});
}); };
var TextList = ['great', 'cool', 'perfect', 'awesome', 'unbelievable'];
//# sourceMappingURL=playTextAni.js.map
function check(_this) {
var egretRenderContainer = _this.egretRenderContainer;
......@@ -883,6 +907,7 @@
}
});
}
//# sourceMappingURL=check.js.map
var createBox = function (_this) {
var path1 = Matter.Vertices.fromPath('385 370 630 380 670 728 620 1080 370 1100 109 1090 57 728 108 370 0 370 0 1624 750 1624 750 0', null);
......@@ -909,6 +934,7 @@
var h2 = 10;
var rect3 = _this._egretRender.rectangle(375, 1100, w2, h2, null, { isStatic: true, collisionFilter: { group: wall, category: wall, mask: wallMask } });
};
//# sourceMappingURL=createBox.js.map
var createBubblePic = function (r) {
var bubbleTexture = getTextureByName('bubble');
......@@ -916,6 +942,7 @@
bubblePic.scaleX = bubblePic.scaleY = r * 2 / 100;
return bubblePic;
};
//# sourceMappingURL=createBubblePic.js.map
var timerLeft;
var timerRight;
......@@ -963,6 +990,7 @@
var n = end - start;
return Math.random() * n + start;
};
//# sourceMappingURL=standbyBubbles.js.map
var createBtns = (function (that) {
var createShape = function () {
......@@ -1006,6 +1034,7 @@
that._rightBtn.addChild(shapeR);
shapeLeft.alpha = shapeR.alpha = 0;
});
//# sourceMappingURL=createBtns.js.map
var GameView = (function (_super) {
tslib.__extends(GameView, _super);
......@@ -1018,11 +1047,8 @@
_this._frameCount = 0;
return _this;
}
GameView.prototype.start = function (color) {
return tslib.__awaiter(this, void 0, void 0, function () {
var a, gameNode, contPng, leftBtn, rightBtn, light, basket_bottom, tmpRect, gameData, countDown, countDownLabel, basket_top, glass;
return tslib.__generator(this, function (_a) {
a = new engine.Shape();
GameView.prototype.start = function (resData) {
var a = new engine.Shape();
this.addChild(a);
engine.globalLoader.loadImage('//yun.duiba.com.cn/aurora/assets/66ab48ff49a741f0c93335d4eb0c9e50b7ab6e1e.png', 'bg_dot')
.then(function (img) {
......@@ -1030,64 +1056,53 @@
a.drawRect(0, 0, 750, 1624);
a.endFill();
});
gameNode = this._gameNode = new engine.Sprite(getTextureByName('机子'));
gameNode.y = 260;
var gameNode = this._gameNode = new engine.Sprite(engine.Texture.fromImage(resData.gameBackgroundImage));
gameNode.y = 215;
this.addChild(gameNode);
contPng = new engine.Image(getTextureByName('contPng'));
contPng.x = (750 - contPng.width) / 2;
contPng.y = 215;
this.addChild(contPng);
leftBtn = this._leftBtn = new engine.Sprite(getTextureByName('左按钮'));
var leftBtn = this._leftBtn = new engine.Sprite(engine.Texture.fromImage(resData.leftButtonImage));
leftBtn.anchorY = leftBtn.height - 50;
leftBtn.x = 83;
leftBtn.y = 920;
leftBtn.y = 965;
gameNode.addChild(leftBtn);
rightBtn = this._rightBtn = new engine.Sprite(getTextureByName('右按钮'));
var rightBtn = this._rightBtn = new engine.Sprite(engine.Texture.fromImage(resData.rightButtonImage));
rightBtn.anchorY = rightBtn.height - 50;
rightBtn.x = 400;
rightBtn.y = 920;
rightBtn.y = 965;
gameNode.addChild(rightBtn);
light = this._light = new engine.Sprite(getTextureByName('灯'));
light.x = 12;
light.y = 44;
gameNode.addChild(light);
basket_bottom = this._basket_bottom = new engine.Sprite(getTextureByName('basket_bottom'));
basket_bottom.x = (contPng.width - basket_bottom.width) / 2;
var basket_bottom = this._basket_bottom = new engine.Sprite(getTextureByName('basket_bottom'));
basket_bottom.x = 286.5;
basket_bottom.y = 85;
contPng.addChild(basket_bottom);
tmpRect = new engine.Rect();
gameNode.addChild(basket_bottom);
var tmpRect = new engine.Rect();
tmpRect.x = 230;
tmpRect.y = 372;
tmpRect.width = 300;
tmpRect.height = 300;
this.addChild(tmpRect);
basket_bottom.mask = tmpRect;
gameData = this._gameData = new GameData(contPng, color);
contPng.addChild(gameData);
countDown = this._countDown = new engine.Sprite(getTextureByName('倒计时'));
var gameData = this._gameData = new GameData(gameNode, resData.color);
gameNode.addChild(gameData);
var countDown = this._countDown = new engine.Sprite(engine.Texture.fromImage(resData.gameCountdownImage));
countDown.x = 5;
countDown.y = 180;
this.addChild(countDown);
this._curLevelTime = getlevelTime();
countDownLabel = this._countDownLabel = Tool.getLabel(this._curLevelTime, 48, "#ffffff", false, engine.TEXT_ALIGN.CENTER);
var countDownLabel = this._countDownLabel = Tool.getLabel(this._curLevelTime, 48, "#ffffff", false, engine.TEXT_ALIGN.CENTER);
countDownLabel.width = 160;
countDownLabel.x = 0;
countDownLabel.y = (countDown.height - countDownLabel.height) / 2 - 5;
countDownLabel.y = 50;
countDown.addChild(countDownLabel);
this.initGameHint();
this.startHandle();
basket_top = this._basket_top = new engine.Sprite(getTextureByName('basket_top'));
var basket_top = this._basket_top = new engine.Sprite(getTextureByName('basket_top'));
basket_top.x = 287;
basket_top.y = 485;
this.addChild(basket_top);
glass = this._basket_top = new engine.Sprite(getTextureByName('玻璃'));
var glass = this._basket_top = new engine.Sprite(getTextureByName('玻璃'));
glass.x = (750 - glass.width) / 2;
glass.y = 340;
this.addChild(glass);
this.levelHint();
return [2];
});
});
};
GameView.prototype.levelHint = function () {
var lvBg = this._lvbg = new engine.Rect();
......@@ -1172,6 +1187,8 @@
this.runEngine();
};
GameView.prototype.themeChange = function (data) {
this._gameNode.texture = engine.Texture.fromImage(data.gameBackgroundImage);
this._gameData.scorePosUpdate();
this._countDown.texture = engine.Texture.fromImage(data.gameCountdownImage);
this._leftBtn.texture = engine.Texture.fromImage(data.leftButtonImage);
this._leftBtn.anchorY = this._leftBtn.height - 50;
......@@ -1354,6 +1371,7 @@
};
return GameView;
}(engine.Container));
//# sourceMappingURL=GameView.js.map
var GameWrapper = (function (_super) {
tslib.__extends(GameWrapper, _super);
......@@ -1370,7 +1388,7 @@
GameWrapper.prototype.start = function (event) {
setlevelData();
this.initData();
this._gameView.start(event.data.color);
this._gameView.start(event.data.resData);
['coin', 'boom', 'fail', 'success'].forEach(function (element) {
getJsonAsset(element);
});
......@@ -1388,10 +1406,10 @@
this._gameView.revive();
};
GameWrapper.prototype.themeChange = function (event) {
this._gameView.themeChange(event.data.resData);
};
return GameWrapper;
}(engine.Container));
//# sourceMappingURL=GameWrapper.js.map
function index (props) {
prepareProps();
......@@ -1399,6 +1417,7 @@
var instance = new GameWrapper();
return instance;
}
//# sourceMappingURL=index.js.map
return index;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -148,8 +148,8 @@
},
{
"name": "玻璃",
"url": "//yun.duiba.com.cn/aurora/assets/90edb55a1c5fb4b7baf689144b7c1f3508ecb7ff.png",
"uuid": "92d1a3d4-256b-467b-a9a2-4820c2c2c718",
"url": "//yun.duiba.com.cn/aurora/assets/5bbd9279bc22988b86470100521f4cacd414b333.png",
"uuid": "79edafc6-1cb9-4b28-8d8f-b77e49fc5599",
"ext": ".png"
},
{
......@@ -247,6 +247,12 @@
"url": "//yun.duiba.com.cn/aurora/assets/b39a88200f27f65e9d8d3f2a98a671de979f3027.png",
"uuid": "b8acc117-7d3c-4bcb-aff9-b5f42b901edf",
"ext": ".png"
},
{
"name": "mainBody",
"url": "//yun.duiba.com.cn/aurora/assets/bcc14f1fbbe3ff478b23ca854071002a34a4d725.png",
"uuid": "3d6a81d0-e2c3-4a2f-9215-c8bff01fec07",
"ext": ".png"
}
......
......@@ -37,7 +37,7 @@ export default class GameData extends engine.Container {
this.addChild(scorelabel);
let progress = new engine.Sprite(getTextureByName('进度'));
progress.x = 212;
progress.x = 253;
progress.y = 8;
this.addChild(progress);
......@@ -45,7 +45,7 @@ export default class GameData extends engine.Container {
progressMask.fillColor = 0x000000
progressMask.width = 245;
progressMask.height = 100;
progressMask.x = 213;
progressMask.x = 253;
progressMask.y = 5;
//0.35 0.75 1
progressMask.scaleX = 0;
......@@ -54,21 +54,21 @@ export default class GameData extends engine.Container {
progress.mask = progressMask;
let star1 = new engine.Sprite(getTextureByName('点亮'));
star1.x = 270;
star1.x = 310;
star1.y = 6;
star1.visible = false;
this.addChild(star1);
this.starList.push(star1);
let star2 = new engine.Sprite(getTextureByName('点亮'));
star2.x = 365;
star2.x = 405;
star2.y = 6;
star2.visible = false;
this.addChild(star2);
this.starList.push(star2);
let star3 = new engine.Sprite(getTextureByName('点亮'));
star3.x = 435;
star3.x = 475;
star3.y = 50;
star3.visible = false;
this.addChild(star3);
......@@ -87,14 +87,14 @@ export default class GameData extends engine.Container {
scorePosUpdate(){
this._scoreCount.text = getScore()
this._scoreCount.x = (this._parentNode.width - this._scoreCount.width - this._scorelabel.width - 5)/2
this._scoreCount.x = (750 - this._scoreCount.width - this._scorelabel.width - 5)/2
this._scorelabel.x = this._scoreCount.x + this._scoreCount.width + 5;
this.updateProgressMask();
}
levelUpdate(color?){
this._levelLabel.text = `第${getCurLevel()}/3关`
this._levelLabel.x = (this._parentNode.width-this._levelLabel.width)/2;
this._levelLabel.x = (750-this._levelLabel.width)/2;
}
updateProgressMask(){
......
......@@ -24,7 +24,7 @@ import { playBoom } from "./playMovieClip";
export default class GameView extends engine.Container {
private _bg;
private _gameNode;
private _gameNode:engine.Sprite;
public _leftBtn;
public _rightBtn;
private _light;
......@@ -46,7 +46,7 @@ export default class GameView extends engine.Container {
super();
}
async start(color) {
start(resData) {
let a = new engine.Shape()
this.addChild(a)
engine.globalLoader.loadImage('//yun.duiba.com.cn/aurora/assets/66ab48ff49a741f0c93335d4eb0c9e50b7ab6e1e.png', 'bg_dot')
......@@ -56,37 +56,38 @@ export default class GameView extends engine.Container {
a.endFill()
});
let gameNode = this._gameNode = new engine.Sprite(getTextureByName('机子'));
gameNode.y = 260;
//getTextureByName('mainBody')
let gameNode = this._gameNode = new engine.Sprite(engine.Texture.fromImage(resData.gameBackgroundImage));
gameNode.y = 215;
this.addChild(gameNode);
let contPng = new engine.Image(getTextureByName('contPng'));
contPng.x = (750-contPng.width)/2
contPng.y = 215;
this.addChild(contPng);
let leftBtn = this._leftBtn = new engine.Sprite(getTextureByName('左按钮'));
// let contPng = new engine.Image(getTextureByName('contPng'));
// contPng.x = (750-contPng.width)/2
// contPng.y = 215;
// this.addChild(contPng);
//getTextureByName('左按钮')
let leftBtn = this._leftBtn = new engine.Sprite(engine.Texture.fromImage(resData.leftButtonImage));
leftBtn.anchorY = leftBtn.height-50
leftBtn.x = 83;
leftBtn.y = 920;
leftBtn.y = 965;
gameNode.addChild(leftBtn);
let rightBtn = this._rightBtn = new engine.Sprite(getTextureByName('右按钮'));
//getTextureByName('右按钮')
let rightBtn = this._rightBtn = new engine.Sprite(engine.Texture.fromImage(resData.rightButtonImage));
rightBtn.anchorY = rightBtn.height-50
rightBtn.x = 400;
rightBtn.y = 920;
rightBtn.y = 965;
gameNode.addChild(rightBtn);
let light = this._light = new engine.Sprite(getTextureByName('灯'));
light.x = 12;
light.y = 44;
gameNode.addChild(light);
// let light = this._light = new engine.Sprite(getTextureByName('灯'));
// light.x = 12;
// light.y = 44;
// gameNode.addChild(light);
let basket_bottom = this._basket_bottom = new engine.Sprite(getTextureByName('basket_bottom'));
basket_bottom.x = (contPng.width - basket_bottom.width)/2;
basket_bottom.x = 286.5;
basket_bottom.y = 85;
contPng.addChild(basket_bottom);
gameNode.addChild(basket_bottom);
let tmpRect = new engine.Rect();
tmpRect.x = 230
tmpRect.y = 372
......@@ -98,11 +99,12 @@ export default class GameView extends engine.Container {
let gameData = this._gameData = new GameData(contPng,color);
contPng.addChild(gameData);
let gameData = this._gameData = new GameData(gameNode,resData.color);
gameNode.addChild(gameData);
//倒计时
let countDown = this._countDown = new engine.Sprite(getTextureByName('倒计时'));
//倒计时 getTextureByName('倒计时')
let countDown = this._countDown = new engine.Sprite(engine.Texture.fromImage(resData.gameCountdownImage));
countDown.x = 5;
countDown.y = 180;
this.addChild(countDown);
......@@ -112,7 +114,7 @@ export default class GameView extends engine.Container {
countDownLabel.width = 160
countDownLabel.x = 0
countDownLabel.y = (countDown.height-countDownLabel.height)/2 - 5
countDownLabel.y = 50
countDown.addChild(countDownLabel);
this.initGameHint();
......@@ -248,6 +250,9 @@ export default class GameView extends engine.Container {
this.runEngine();
}
themeChange(data){
this._gameNode.texture = engine.Texture.fromImage(data.gameBackgroundImage);
this._gameData.scorePosUpdate();
this._countDown.texture = engine.Texture.fromImage(data.gameCountdownImage);
this._leftBtn.texture = engine.Texture.fromImage(data.leftButtonImage);
......
......@@ -35,7 +35,7 @@ export class GameWrapper extends engine.Container {
start(event: engine.Event) {
setlevelData();
this.initData();
this._gameView.start(event.data.color);
this._gameView.start(event.data.resData);
['coin','boom','fail','success'].forEach(element => {
getJsonAsset(element);
});
......@@ -56,6 +56,6 @@ export class GameWrapper extends engine.Container {
this._gameView.revive();
}
themeChange(event: engine.Event){
this._gameView.themeChange(event.data.resData);
//this._gameView.themeChange(event.data.resData);
}
}
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