Archived

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

shoryuken

velocities

Recommended Posts

Hi guys. Some quick advice needed. I am still working on that tank game. Been on hold, just got back into it. For the velocity, do you guys usually use velocity as a vector? Or do you guys implement it just as a normal float or int value? Because the tank can only move forward or backward, implementing only negative and positive values for a velocity. I mean, in physics, velocity, acceleration, and position are all vectors. But in game such as mine, wouldn''t velocity only serve as a int or float value, since direction is already taken care of by the rotation functions? And if velocity should still be implemented as a Vector, why would this be favorable? Any help would be very much appreciated. Thank you. Jeff

Share this post


Link to post
Share on other sites
Sometimes it''s nice to precalculate the velocity vector because it might help with collision detection routines.

Also, you never know when your tank might fall off a cliff or something, and in that case your vector of travel may be somewhat different from the direction you''re facing

Share this post


Link to post
Share on other sites