floating point variables

Blitz3D Forums/Blitz3D Beginners Area/floating point variables

chwaga(Posted 2007) [#1]
I'm trying to have a gravity velocity variable that decrements every loop when an entity is not colliding with something. How can I have a floating variable that decrements somewhere along the lines of -.2 per loop while not colliding, then have a translateentity called upon the entity?? Mainly, How do I make a variable, that stays a float?


H&K(Posted 2007) [#2]
If its a Float, then it always a float. Even if it equals 0


chwaga(Posted 2007) [#3]
I know, how do I make something a float?


H&K(Posted 2007) [#4]
You allocate it to a Float


chwaga(Posted 2007) [#5]
...how :D using n = float n doesn't work for me...


H&K(Posted 2007) [#6]
If what you are asking is "How can I make a variable that is now an int, into a float" Then the answer is you cannot.
If you are asking is how do I make a float, then its Global n# = 0.0
If you are asking how do I give an int value to a float then its N#= 9

If you want n (say) to be a float, then it has to have always been a float


chwaga(Posted 2007) [#7]
hehe, it turns out I was forgetting the #, thanks!