Online Test Banks
Score higher
See Online Test Banks
eLearning
Learning anything is easy
Browse Online Courses
Mobile Apps
Learning on the go
Explore Mobile Apps
Dummies Store
Shop for books and more
Start Shopping

HTML5 Game Development: Keeping Track with the Timer Object

Part of the HTML5 Game Development For Dummies Cheat Sheet

The Timer object will help you keep track of time in your games. You can have as many timers as you wish in your game.

timerObj = new Timer() Creates a new Timer object called timerObj. The counter automatically begins counting when it is created.
reset() Resets the timer so it begins counting at zero.
getElapsedTime() Returns the number of seconds since the timer was created or reset.
  • Add a Comment
  • Print
  • Share
blog comments powered by Disqus
Advertisement

Inside Dummies.com

Dummies.com Sweepstakes

Win $500. Easy.