Results 1 to 19 of 19

Thread: my brain isn't working today folks, need help with a math formula

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2004
    Posts
    281

    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
  •  



Click Here to Expand Forum to Full Width