I would put the count-= 1; part in a separate function, and then once the counter reaches 17, use break to stop the current function and run it.

Code:

function count_back()
{
while(count<= 17)
{
count-= 1;
wait(1);
}
}

...

in your counting up function:

if(count== 17)
{
break;
count_back();
}



Of course in Lite-C this could easily be done with for loops:

Code:

#include <acknex.h>

var count;

PANEL* num_display=
{
digits (320,240,"%1.0f",_a4font,1,count);
flags= VISIBLE;
}

void main()
{
screen_color.blue= 1;
for(count; count < 17; count+= 1 * time_step) wait(1);
for(count= 17; count <= 17; count -= 1 * time_step) wait(1);
}



This will actually make the number go negative when it's counting down, but it works.

Last edited by MrCode; 07/22/07 06:45.

Code:
void main()
{
    cout << "I am MrCode,";
    cout << "hear me roar!";
    system("PAUSE");
}