java Posted February 23, 2010 Author Share Posted February 23, 2010 Hey guysBasically i'm having some real issues making a perfect system for movement. I can do all the coding fine, i'm just having problems with the logic/theory…Basically this is how i want it to work:-User presses buttons, moves the character on screen and sends packets to the serverHow will i coordinate the movement?Will there be a timer when the user presses the button detecting how long and then send packets accordingly? If so then how will other clients move the character which moved?I can't remember how i did it in vb couple years ago..thanks guys Link to comment Share on other sites More sharing options...
Marsh Posted February 23, 2010 Share Posted February 23, 2010 You could simple have the person move 1 pixel and have it wait a set amount of time before moving another. Or just cap your FPS and let it be based on the loop time, though speed hacks would have a fun time.The packet of your movement (not every pixel, also use UDP if you can) will get sent to the other players and then make there sprites move based on that. Link to comment Share on other sites More sharing options...
java Posted February 23, 2010 Author Share Posted February 23, 2010 so..```while(keydown) {timer.start;}```timer tick:```move;send(moved);```something like that? and i have packet flood protection on the server which will be set up differently for each type of packet received to detect speedhacks and the like :) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now