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 "hero avatar model" 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.
Help me here: As of now I have each of the clients successfully receiving the X and Y coordinates from the server of the positions of the other hero images. I simply don't understand the logic of painting those X and Y coordinate pairs to the client (I'm using drawImage for my paint canvas). I understand the images need to be updated based on their relation to the client, but I just can't see what math needs to be done to update the X and Y pairs to make it actually look like its supposed to.
Thanks for taking the time to read my post.