Results 1 to 1 of 1
- 08-23-2010, 03:06 PM #1Member
- Join Date
- Aug 2010
- Rep Power
Distance, Speed, Acceleration, Friction + Networking!
Sorry I'm not sure where to post this it is really more of a Maths questions.
I have a ball. It likes to accelerate and decelerate in a non-constant way :)
I have friction (which makes my life hell)!!!
My client moves the ball and the server also predicts the position of the ball every 500ms. At the moment this is working beautifully WITHOUT friction.
Both the client and server code are working with time, but the server usually has a longer time period between working out positions than the client.
This is working perfectly on client + server:
x += 0.5 * vx * time; vx += accel * time; x += 0.5 * vx * time;
vx *= Math.pow(fric, time);
Thanks for reading and your help,
- By sfaiz in forum Java AppletsReplies: 2Last Post: 04-14-2009, 11:01 PM
- By busdude in forum New To JavaReplies: 0Last Post: 04-02-2009, 10:00 PM
- By rdoane in forum New To JavaReplies: 11Last Post: 04-01-2009, 04:43 AM
- By nidhirastogi in forum Java 2DReplies: 5Last Post: 08-18-2008, 11:24 PM
- By Az.Sanders in forum Advanced JavaReplies: 0Last Post: 07-27-2008, 08:56 PM