What I want to do is set up a timer so every 10 minutes it will change from night or day. Could anyone help me do thatso it would be like.
if(timer == 10minpast && day == false){
_root.day = true;
}
What I want to do is set up a timer so every 10 minutes it will change from night or day. Could anyone help me do thatso it would be like.
if(timer == 10minpast && day == false){
_root.day = true;
}
Use a setInterval. Since it goes by miliseconds the interval would have to be pretty friggin' huge though.
var day:Boolean = true;
function daySwitch() {
if(day) {
//commands to make it night;
} else {
//commands to make it day;
}
day = !day;
}
setInterval(daySwitch,1000*60*10);
The parameters in the setInterval statement may be in the wrong order, but that should make it switch from night to day and vice versa every ten minutes.
Note: Doesn't account for game pausing.