From dd3ec0316cbfdb033fae9d6a52b957eb1196e20f Mon Sep 17 00:00:00 2001 From: Atsuyo-INSA Date: Wed, 6 Dec 2023 10:19:54 +0100 Subject: [PATCH] bullet Paquet Name --- js/network.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/network.js b/js/network.js index 6904ab0..4f1b0d6 100644 --- a/js/network.js +++ b/js/network.js @@ -35,7 +35,7 @@ class Network{ this.playersToRemove.push(data.data.id); break; case "newBullet": - this.bulletsToAdd.push(new Bullet(data.x,data.y,data.dx,data.dy)); + this.bulletsToAdd.push(new Bullet(data.data.x,data.data.y,data.data.dx,data.data.dy)); break; default: break; @@ -61,7 +61,7 @@ class Network{ newBullet(x_,y_,dx_,dy_) { - this.socket.send(JSON.stringify({type:"newBullet",x: x_,y: y_,dx: dx_,dy: dy_})); + this.socket.send(JSON.stringify({type:"newBullet",data:{x: x_,y: y_,dx: dx_,dy: dy_}})); } getPlayersToAdd(){ //returns the list of new players