The Armor Games website will be down for maintenance on Monday 10/7/2024
starting at 10:00 AM Pacific time. We apologize for the inconvenience.
The Armor Games website will be down for maintenance on Monday 10/7/2024
starting at 10:00 AM Pacific time. We apologize for the inconvenience.
1 | 5453 |
can you use the current frame rate of your game as a variable?
my timer's code
timer += 1;
if(timer >= 30)
{
timer = 0;
time += 1;
_root.gameOverMenu.timerText.text = time;
}
can i use the game's frame rate instead of 30? if(timer >= frameRate)
Sounds like you might just want to use an actual timer based on time, not progression of frames then. Check out this post. Although setInterval might be more useful to you.
You could probably make a variable in _root.gameOverMenu like
_root.gameOverMenu.time = 0;
//as2
var timer:Number = setInterval(timeIncrease, 1000)// 1000 milliseconds = 1 sec
function timeIncrease(){
_root.gameOverMenu.time += 1;
_root.gameOverMenu.timerText.text = _root.gameOverMenu.time;
}
You must be logged in to post a reply!