srv
This commit is contained in:
parent
b586b161a1
commit
f0483bbff8
1 changed files with 1 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue