This commit is contained in:
Killian Marty 2023-12-06 09:44:05 +01:00
parent b586b161a1
commit f0483bbff8

View file

@ -55,12 +55,12 @@ function generatePosition(){
}
}
//return x, y;
console.log(x, y);
return [500, 100];
}
function createNewPlayer(socket, name){
let pos = generatePosition();
console.log(pos)
var obj = {
id: playerCount,
x: pos[0],
@ -104,7 +104,6 @@ wss.on('connection', (socket, req) => {
} else if(message.type=="update") {
for (var i = players.length - 1; i >= 0; i--) {
if(players[i].id == message.data.id){
console.log(players[i].id);
players[i]=message.data;
}
}