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 @@
},
{
"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')
......@@ -55,38 +55,39 @@ export default class GameView extends engine.Container {
a.drawRect(0,0,750,1624)
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 countDown = this._countDown = new engine.Sprite(getTextureByName('倒计时'));
let gameData = this._gameData = new GameData(gameNode,resData.color);
gameNode.addChild(gameData);
//倒计时 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