Site/Game

- fix somes bugs
This commit is contained in:
Kum1ta
2024-10-06 16:25:45 +02:00
parent 58ae534e57
commit bcb10e8a36
8 changed files with 48 additions and 47 deletions

View File

@ -3,10 +3,10 @@
/* ::: :::::::: */
/* Ball.js :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: madegryc <madegryc@student.42.fr> +#+ +:+ +#+ */
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/20 17:02:47 by edbernar #+# #+# */
/* Updated: 2024/09/30 19:17:05 by madegryc ### ########.fr */
/* Updated: 2024/10/06 15:57:46 by edbernar ### ########.fr */
/* */
/* ************************************************************************** */
@ -44,17 +44,10 @@ class Ball
{
this.object = this.#createBall();
this.centerPos = map.centerPos;
this.centerPos.y += this.object.geometry.parameters.radius;
this.centerPos.y = this.object.geometry.parameters.radius;
this.limits = map.playerLimits;
this.resetPosBall();
scene.add(this.object);
// this.world = new CANNON.World();
// this.ballBody = new CANNON.Body({
// shape: new CANNON.Sphere(0.15),
// mass: 10,
// });
// this.ballBody.position.copy(this.object.position);
// this.world.addBody(this.ballBody);
}
#createBall()
@ -71,7 +64,7 @@ class Ball
resetPosBall()
{
this.setPosition(this.centerPos.x, this.centerPos.y, this.centerPos.z);
this.setPosition(this.centerPos.x, this.object.geometry.parameters.radius * 2, this.centerPos.z);
}
resetScaleBall()