Archived

This topic is now archived and is closed to further replies.

griffenjam

Best way to move an object

Recommended Posts

I am currenty having problems moving an object I''m using this mothod to see how far to move the object. (cMissiles.fSpeed * (gametime - cMissiles[i].fTimeLastMove) It has a set speed to move each millisecond and computes the time since the last movement then multiplies that by the move speed. It works well but everytime there is a small processer hit the missile jumps. Also I have a particle engine placing a particle behind the missile every frame, so if the missile jumps there is a gap in the particles. I thought about only updating the missile every 5ms but then on slow systems it wouldn''t run right. Any suggestions? Jason Mickela ICQ : 873518 E-Mail: jmickela@sbcglobal.net ------------------------------ "Evil attacks from all sides but the greatest evil attacks from within." Me ------------------------------

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Try basing your movements off of FPS or some other timefactor variable instead of hard time data. Then you can calculate an ''averaged'' FPS or timefactor over some number of frames (I use about 10.) This will mimimize sudden speeding up and slowing down, while still adapting to the speed of the PC you''re running on.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Update it each frame, keeping in mind the amount that time has changed between each one. On slow computers this will cause the object to "jump" but it will be kept in sync.

Share this post


Link to post
Share on other sites