game: fix: 3d
This commit is contained in:
parent
0b7e72d8e2
commit
7d251a7bc9
@ -67,12 +67,12 @@ export class PongConfig extends AExchangeable
|
|||||||
/**
|
/**
|
||||||
* @type {Number}
|
* @type {Number}
|
||||||
*/
|
*/
|
||||||
this.CENTER_X;
|
this.MAP_CENTER_X;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Number}
|
* @type {Number}
|
||||||
*/
|
*/
|
||||||
this.CENTER_Y;
|
this.MAP_CENTER_Y;
|
||||||
}
|
}
|
||||||
|
|
||||||
async init()
|
async init()
|
||||||
|
@ -58,8 +58,8 @@ class Segment extends AExchangeable
|
|||||||
{
|
{
|
||||||
const size = this.game.config.BALL_SIZE * 2;
|
const size = this.game.config.BALL_SIZE * 2;
|
||||||
const sizex = this.len() / 2;
|
const sizex = this.len() / 2;
|
||||||
const posx = (this.start.x - this.game.config.CENTER_X);
|
const posx = (this.start.x - this.game.config.MAP_CENTER_X);
|
||||||
const posy = (this.start.y - this.game.config.CENTER_Y);
|
const posy = (this.start.y - this.game.config.MAP_CENTER_Y);
|
||||||
renderCube(ctx, posx, 0, posy, -this.angle(), sizex, size, size);
|
renderCube(ctx, posx, 0, posy, -this.angle(), sizex, size, size);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -32,8 +32,8 @@ export class Wall extends Segment
|
|||||||
{
|
{
|
||||||
const size = this.game.config.BALL_SIZE * 2;
|
const size = this.game.config.BALL_SIZE * 2;
|
||||||
const sizeX = this.len() / 2;
|
const sizeX = this.len() / 2;
|
||||||
const posX = (this.start.x - this.game.config.CENTER_X);
|
const posX = (this.start.x - this.game.config.MAP_CENTER_X);
|
||||||
const posY = (this.start.y - this.game.config.CENTER_Y);
|
const posY = (this.start.y - this.game.config.MAP_CENTER_Y);
|
||||||
renderCube(ctx, posX, 0, posY, -this.angle(), sizeX, size, size);
|
renderCube(ctx, posX, 0, posY, -this.angle(), sizeX, size, size);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user