- force ball pos reset
This commit is contained in:
Kum1ta
2024-11-15 15:41:25 +01:00
parent f838b82f0d
commit e9970bc0b2
2 changed files with 5 additions and 3 deletions

View File

@ -6,7 +6,7 @@
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/09/13 13:59:46 by edbernar #+# #+# */
/* Updated: 2024/11/15 15:08:44 by edbernar ### ########.fr */
/* Updated: 2024/11/15 15:26:47 by edbernar ### ########.fr */
/* */
/* ************************************************************************** */

View File

@ -6,7 +6,7 @@
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/20 17:02:47 by edbernar #+# #+# */
/* Updated: 2024/11/13 22:16:05 by edbernar ### ########.fr */
/* Updated: 2024/11/15 15:41:01 by edbernar ### ########.fr */
/* */
/* ************************************************************************** */
@ -135,6 +135,8 @@ class Ball
let gameTime = performance.now() - this.start
if(content.game_time > gameTime)
this.start -= content.game_time - gameTime
if (content.velocity[0] == 0 && content.velocity[1] == 0)
this.object.position.set(content.pos[0], this.limits.down, content.pos[1]);
this.srvPos = {
time : content.game_time,
pos : [content.pos[0], content.pos[1]],