bullet fix
This commit is contained in:
parent
da44834191
commit
7411743481
2 changed files with 2 additions and 1 deletions
|
@ -28,7 +28,7 @@ class Input {
|
|||
let b = new Bullet(player.x,player.y,dx/norm,dy/norm,player.id);
|
||||
bullets.push(b);
|
||||
|
||||
net.newBullet(b.x,b.y,b.dx,b.dy,b.parentId);
|
||||
net.newBullet(b.x,b.y,b.dx,b.dy,b.shooterId);
|
||||
});
|
||||
|
||||
window.addEventListener("keydown", (e)=>{
|
||||
|
|
|
@ -72,6 +72,7 @@ class Network{
|
|||
|
||||
newBullet(x,y,dx,dy,parentId)
|
||||
{
|
||||
console.log(parentId)
|
||||
this.socket.send(JSON.stringify({type:"newBullet",data:{x: x,y: y,dx: dx,dy: dy,id:parentId}}));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue