name_here___ wrote:
If distance moved per frame is relatively constant, you can probably use a system something like the following (definitely slower, but avoids doing a square root for distance):

  • Per tank, keep track of x and y (separately) moved since the last tread mark was placed
  • Each frame, check if the sum of the squares of the x and y counters is over some value. If so, place a tread mark
  • Reset x and y movement counters every time a tread mark is placed

Oh, that's really smart! I'll be sure to add that next time I work on the game.
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 4 of 4
» All times are GMT - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum