bullet Paquet Name

This commit is contained in:
Atsuyo-INSA 2023-12-06 10:19:54 +01:00
parent aa4348c407
commit dd3ec0316c

View file

@ -35,7 +35,7 @@ class Network{
this.playersToRemove.push(data.data.id); this.playersToRemove.push(data.data.id);
break; break;
case "newBullet": 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; break;
default: default:
break; break;
@ -61,7 +61,7 @@ class Network{
newBullet(x_,y_,dx_,dy_) 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 getPlayersToAdd(){ //returns the list of new players