|
-
Oct 30th, 2004, 02:14 PM
#1
Thread Starter
Hyperactive Member
my brain isn't working today folks, need help with a math formula
Alrighty, I am trying to:
I have a float data type, Misc, that starts at a predetermined value...in this case 0.0.
My program loops it in increments of 0.1 until 2.5 is met, at which point it starts over at 0.0. How can I have it count backwards in increments of 0.1 during execution when it reaches 2.5? (So I can get a swing effect instead of start to finish~
Code:
static int Counter;
FLOAT fAngle = Misc += 0.1f;
while (Misc == 0){
for ( Counter = 1; Counter <= 25; Counter++ ){
Misc = Misc + 0.1;
}
}
while (Misc == 25){
for ( int Counter = 25; Counter >= 1; Counter-- ){
Misc = Misc - 0.1;
}
}
This isn't working. There is a flaw somewhere I guess. Anyways, help me if you can.:afrog:
Last edited by KodeShark; Oct 30th, 2004 at 03:02 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|