Open Alex3k opened 8 years ago
@Alex3k - it's a good starting point. Only one thing, should we have the users player as it's own attribute?
@sam-ac-dixon So my thought process was that if we put in the user player specifically in the data we would have to create a create a payload for each player. Alternatively by putting everyones id in the payload, the same payload could be sent to everyone.
Each client has to iterate over all players and bullets anyway to draw them so they can just check if their ID == the one they are currently iterating over then they know it themselves and (for example) focus the camera on themselves.
Long story short: generic broadcasted payload vs specific to player payload.
What are your thoughts?
@sam-ac-dixon from working on the server stub, it makes MUCH more sense to indeed have the players id in the payload. Therefore I propose the following:
{
id: "abc",
players: [{
id: "abc",
x: 0,
y: 0,
a: 0
},
{
id: "def",
x: 0,
y: 0,
a: 0
}],
bullets:[{
x: 0,
y: 0,
a: 0
},
{
x: 0,
y: 0,
a: 0
}]
}
Thoughts?
Thoughts? x = position.x y = position.y a = angle in degrees