ok, these are the two sets of code:
Code:
if(7500 - (GetTickCount() - timeCreated) <= 0)
return false;
else
return true;
Code:
int x = GetTickCount();
x -= timeCreated;
if(7500 - (x) <= 0)
return false;
else
return true;
I'm using it as a sort of timer for when to make rockets disappear - each gets called like this, inside of a loop. If it returns false, the rocket disappears ("rockets" is a std::vector):
Code:
for(int i = 0; i < rockets.size(); ++i)
{
if(!rockets[ i]->move())
(...);
}
The only problem is, with the first set of code, only one rocket disappears after the designated 7.5 seconds; the rest keep going - but with the second set, they do all disappear after 7.5 seconds! Does anybody know why?