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