Time, distance, and speed
BlitzMax Forums/BlitzMax Beginners Area/Time, distance, and speed
| ||
I am trying to have an object move 311 pixels over a certain time period. I want to be able to determine the speed based on time and distance so that I can change the time limit, and still have it move exactly 311 pixels. I tryed to determine the speed with the basic 'rate = distance / time' formula. So if I want it to move 311 pixels over a ten minute timespan, I tried the following 'speed# = 311 / 600000' (10 minutes in milliseconds) The problem is, if I 'print speed#', it comes out to 0.000000000. If I do the same formula in visual basic or another language, speed comes out correctly to 0.0005183. Why does BMax return speed as 0, and how can I do this correctly? |
| ||
speed# = 311 / 600000.0or speed# = 311 / 600000#or speed# = 311 / 600000:Float |
| ||
Doh :) Everyone's allowed a few of these, right? |