how to make energy bar increase by 1 each minute and set a timer for it?
Hi,
how i can set a time for an energy bar like what you can see in facebook games?
and make it increase the energy bar value by 1 for each minute?
Hi,
how i can set a time for an energy bar like what you can see in facebook games?
and make it increase the energy bar value by 1 for each minute?
You can use the Timer class to have a Timer object repeatedly execute a function every minute. You define the Timer....
var energyTimer:Timer = new Timer(60000); // one minute delay - repeats indefinitely
energyTimer.addEventListener(TimerEvent.TIMER, addEnergy);
function addEnergy(evt:TimerEvent):void {
// adjust the energy value and the displays of it here
}
energyTimer.start(); // use when you want the Timer to begin
Already have an account? Login
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.