game: fix: 3d

This commit is contained in:
starnakin 2024-04-10 16:01:06 +00:00
parent 0b7e72d8e2
commit 7d251a7bc9
3 changed files with 6 additions and 6 deletions

View File

@ -67,12 +67,12 @@ export class PongConfig extends AExchangeable
/**
* @type {Number}
*/
this.CENTER_X;
this.MAP_CENTER_X;
/**
* @type {Number}
*/
this.CENTER_Y;
this.MAP_CENTER_Y;
}
async init()

View File

@ -58,8 +58,8 @@ class Segment extends AExchangeable
{
const size = this.game.config.BALL_SIZE * 2;
const sizex = this.len() / 2;
const posx = (this.start.x - this.game.config.CENTER_X);
const posy = (this.start.y - this.game.config.CENTER_Y);
const posx = (this.start.x - this.game.config.MAP_CENTER_X);
const posy = (this.start.y - this.game.config.MAP_CENTER_Y);
renderCube(ctx, posx, 0, posy, -this.angle(), sizex, size, size);
}
else

View File

@ -32,8 +32,8 @@ export class Wall extends Segment
{
const size = this.game.config.BALL_SIZE * 2;
const sizeX = this.len() / 2;
const posX = (this.start.x - this.game.config.CENTER_X);
const posY = (this.start.y - this.game.config.CENTER_Y);
const posX = (this.start.x - this.game.config.MAP_CENTER_X);
const posY = (this.start.y - this.game.config.MAP_CENTER_Y);
renderCube(ctx, posX, 0, posY, -this.angle(), sizeX, size, size);
}
else