i am working on a game that has "powerups" in it. the problem is that i need some kind of internal timer in the powerup class so after a certain time, the effect wears off. i would really appreciate help.
   
   
            public int time = 15;
public void CountTime()
{    
   //this is where the code for counting the time  will be 
   
}
public void TimeUp()
{
     if time < 0
        Disappear();
}
int timer = 0;
final int MAX_TIMER_VAL = 500; // adjust the value as needed
if (timer > 0) timer--;
timer = MAX_TIMER_VAL;