3D working
This commit is contained in:
@ -52,9 +52,10 @@ class Ball
|
||||
}
|
||||
else if(ctx instanceof WebGLRenderingContext)
|
||||
{
|
||||
const posx = (this.position.x - this.size / 2) / 2;
|
||||
const posy = (this.position.y - this.size / 2) / 2;
|
||||
renderCube(ctx, posx, 0, posy, 0, this.size * 5, this.size * 5, this.size * 5);
|
||||
const size = this.size * 3;
|
||||
const posx = (this.position.x - this.size / 2) - this.game.config.size_x / 2;
|
||||
const posy = (this.position.y - this.size / 2) - this.game.config.size_y / 2;
|
||||
renderCube(ctx, posx, 0, posy, 0, size, size, size);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -76,7 +77,7 @@ class Ball
|
||||
this.draw(ctx);
|
||||
}
|
||||
|
||||
from_json (data)
|
||||
from_json(data)
|
||||
{
|
||||
this.position = this.position.from_json(data.position);
|
||||
this.size = data.size;
|
||||
|
Reference in New Issue
Block a user