I'm making an online game where users have different ID's.
Here's the client code for creating a new player:
var newPlayer = function(id){
return player[player.length]={
x:0,
y:0,
id:id
}
}
newPlayer(50) would create a player with the ID 50.
How do I select that player based on its id variable?
Thanks