I’m currently developing a networked 2D MMO-style game in which several thin clients (ran in an applet) are able to connect to a server and well, do MMO-style “things”!
Some more background on the game: First of all, I’m using UDP to make this possible. There is a scrolling background whenever a user is moving up/down/left/right constantly, and each client has its own 2D avatar always centered in their screen.
My problem I’ve been facing these last three or so days is this: I guess I don’t understand the math really behind the process of updating the X,Y positions for each client, for all of the clients, because right now whenever a new client is connected, the first client that was running actually moves the latter client whenever it is “WSAD-ing”.
I guess I was hoping for some insight as to how I should approach this, with a scrolling background, and the individual client is always in the middle of the screen but updating with other clients moving around the world.
As you state, you need to place each user in the middle, they don’t need to move around.
You work out the relative location of other users compared with the user which is playing. If they are too far away, you don’t draw them at all.