Brosser game JAVASCRIPT,HTML CANVAS, NODE.JS,SOCKET.IO
Posted: Fri May 01, 2015 8:39 pm
Dear all
I am currently building a browser based game and using html5 canvas, JavaScript, node.js and socket.io. I am currently building the multiplayer part and I have got a way of doing it but don't know the code. Please can someone write an, JavaScript file for client and a server file with socket.io, that follows this format.
When someone changes player location, client messages server to broadcast new location to all the other clients in same room
When someone joins room adds them to player list.
When someone changes their data number it broadcasts that to others in room to change the player list.
When some else leaves the room it tells client to remove them from player list
When you leave room it wipes the player list on client.
When the server is messaged with new players loc or stats it saves it in its own array or backs it up into a database
If you have any questions please let me know.
Here is an example of the array that stores player list of other players in room.
Players {
Name : "Username",
Locationx: 12, // limit of 40
Locationy: 6, // limit of 20
Stat1: 2,
Stat2: 7,
Stat3: 3,
Stat4: 9
}
Thanks for your time,
Thomas
I am currently building a browser based game and using html5 canvas, JavaScript, node.js and socket.io. I am currently building the multiplayer part and I have got a way of doing it but don't know the code. Please can someone write an, JavaScript file for client and a server file with socket.io, that follows this format.
When someone changes player location, client messages server to broadcast new location to all the other clients in same room
When someone joins room adds them to player list.
When someone changes their data number it broadcasts that to others in room to change the player list.
When some else leaves the room it tells client to remove them from player list
When you leave room it wipes the player list on client.
When the server is messaged with new players loc or stats it saves it in its own array or backs it up into a database
If you have any questions please let me know.
Here is an example of the array that stores player list of other players in room.
Players {
Name : "Username",
Locationx: 12, // limit of 40
Locationy: 6, // limit of 20
Stat1: 2,
Stat2: 7,
Stat3: 3,
Stat4: 9
}
Thanks for your time,
Thomas