Commit 5054d03f authored by 李维's avatar 李维

New pos for bubble

Align each other
parent 0a7191c4
...@@ -702,20 +702,25 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -702,20 +702,25 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
this.bubblePos = [ this.bubblePos = [
{x: centerX + 60 * sx, y: centerY + 78 * this.mapScale}, {x: centerX + 50 * sx, y: centerY + 78 * this.mapScale},
{x: centerX + 280 * sx, y: centerY + 70 * this.mapScale}, {x: centerX + 270 * sx, y: centerY + 78 * this.mapScale},
{x: centerX - 182 * sx, y: centerY + 78 * this.mapScale}, {x: centerX - 182 * sx, y: centerY + 78 * this.mapScale},
{x: centerX - 50 * sx, y: centerY + 178 * this.mapScale},
{x: centerX + 175 * sx, y: centerY + 178 * this.mapScale}, {x: centerX - 60 * sx, y: centerY + 178 * this.mapScale},
{x: centerX + 65 * sx, y: centerY + 278 * this.mapScale}, {x: centerX + 165 * sx, y: centerY + 178 * this.mapScale},
{x: centerX - 165 * sx, y: centerY + 278 * this.mapScale},
{x: centerX + 285 * sx, y: centerY + 278 * this.mapScale}, {x: centerX + 50 * sx, y: centerY + 278 * this.mapScale},
{x: centerX - 40 * sx, y: centerY - 40 * this.mapScale}, {x: centerX - 182 * sx, y: centerY + 278 * this.mapScale},
{x: centerX + 170 * sx, y: centerY - 40 * this.mapScale}, {x: centerX + 270 * sx, y: centerY + 278 * this.mapScale},
{x: centerX - 162 * sx, y: centerY - 150 * this.mapScale},
{x: centerX + 60 * sx, y: centerY - 150 * this.mapScale}, {x: centerX - 60 * sx, y: centerY - 40 * this.mapScale},
{x: centerX - 40 * sx, y: centerY - 260 * this.mapScale}, {x: centerX + 165 * sx, y: centerY - 40 * this.mapScale},
{x: centerX + 190 * sx, y: centerY - 270 * this.mapScale}
{x: centerX - 182 * sx, y: centerY - 150 * this.mapScale},
{x: centerX + 50 * sx, y: centerY - 150 * this.mapScale},
{x: centerX - 60 * sx, y: centerY - 270 * this.mapScale},
{x: centerX + 165 * sx, y: centerY - 270 * this.mapScale}
]; ];
} }
...@@ -821,22 +826,17 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -821,22 +826,17 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
private createGrid() { private createGrid() {
this.gridObj = {}; this.gridObj = {};
const len = 48; const len = 48;
const dis = 6; const dis = 6;
const baseX = -(len * 10 + dis * 9) / 2 + len / 2 - 15; const baseX = -(len * 10 + dis * 9) / 2 + len / 2 - 15;
let baseY = -(len * 10 + dis * 9) / 2 + len / 2 + 5; let baseY = -(len * 10 + dis * 9) / 2 + len / 2 + 5;
const grid = this.data.grid; const grid = this.data.grid;
for (let j = 0; j < 10; j++) { for (let j = 0; j < 10; j++) {
for (let i = 0; i < 10; i++) { for (let i = 0; i < 10; i++) {
if (!this.gridObj[i.toString()]) { if (!this.gridObj[i.toString()]) {
this.gridObj[i.toString()] = {}; this.gridObj[i.toString()] = {};
} }
const gridData = grid[i][j]; const gridData = grid[i][j];
const gridSpr = this.createGridRect(gridData, len); const gridSpr = this.createGridRect(gridData, len);
gridSpr.x = baseX + i * (len + dis); gridSpr.x = baseX + i * (len + dis);
...@@ -844,7 +844,6 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -844,7 +844,6 @@ export class PlayComponent implements OnInit, OnDestroy {
this.gridBg.addChild(gridSpr); this.gridBg.addChild(gridSpr);
gridSpr['logicX'] = i.toString(); gridSpr['logicX'] = i.toString();
gridSpr['logicY'] = j.toString(); gridSpr['logicY'] = j.toString();
this.gridObj[i.toString()][j.toString()] = gridSpr; this.gridObj[i.toString()][j.toString()] = gridSpr;
} }
baseY += (len + dis); baseY += (len + dis);
......
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