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.
This diff is collapsed.
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