Is there anything wrong with this code? (Its short)
Members - Reputation: 158
Posted 14 December 2001 - 08:17 AM
Posted 14 December 2001 - 08:26 AM
Members - Reputation: 122
Posted 15 December 2001 - 12:17 AM
You declare down with
static float down = 0.0f
What this does is ensure that down only gets initialized once in your entire program, so the second time you call this function down will start at 8.0f (0.0f + 0.1f*80)
You should just be using
float down - 0.0f
in these kinds of situations as that will ensure it gets set to zero every time you call the method.
Members - Reputation: 100
Posted 15 December 2001 - 03:40 AM
Original post by clrscr
BTW- How do you get code to have that white box with syntax highlighting and such.
"You can observe a lot just by watching."- Yogi Berra
You put the word "source" inside of the brackets. ] and [, or .
If that's what you meant. You can click "edit" on my post and see how I did it.
Edited by - Drizzt DoUrden on December 15, 2001 10:43:04 AM