K
Kindred
Guest
Hi, so I'm relatively new to game development and I'm currently developing an MMO and so far have multiple clients successfully connecting to my server. My local player object moves correctly and has the correct sprite movements (up,down,left,right). but I'm having a little difficulty in making my network players sprites change.
I'm sending positional data back to my server from my local player object so I'm assuming i need to also send sprite indexes as well so that my network player also has the correct sprite movements.
So should i assign numbers to my 4 sprite indexes and then write them to a buffer as integers and send them to my server along with the positional packet I'm sending?
something like buffer_write(pos_packet,buffer_u8,spriteNumber) ?
Also does that mean the userSchema on my server side would look something like this:
var userSchema = new mongoose.Schema({
username: {type: String, unique: true},
password: String,
sprite: Number,
current_room: String,
pos_x: Number,
pos_y: Number
});
Any help would be much appreciated!
I'm sending positional data back to my server from my local player object so I'm assuming i need to also send sprite indexes as well so that my network player also has the correct sprite movements.
So should i assign numbers to my 4 sprite indexes and then write them to a buffer as integers and send them to my server along with the positional packet I'm sending?
something like buffer_write(pos_packet,buffer_u8,spriteNumber) ?
Also does that mean the userSchema on my server side would look something like this:
var userSchema = new mongoose.Schema({
username: {type: String, unique: true},
password: String,
sprite: Number,
current_room: String,
pos_x: Number,
pos_y: Number
});
Any help would be much appreciated!