Score based on time

  • kbuger
  • Born
  • Born
  • kbuger
  • Posts: 2

Post 3+ Months Ago

I have a game, and i want to show the score at the end.
The problem is, i don't know how to make a timer
which starts in the beginning of the game and stop at
the end. Can anyone help me?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

yea, sure, why not?
it`s brasil vs croatia btw, so i must be in a hurry :D
Code: [ Select ]
var dateNow = new Date();
var timerCountStart = dateNow.getTime();
bt1.onPress = function()
{
    dateNow = new Date();
    timerCountEnd = dateNow.getTime();
    timerCountTotal = timerCountEnd - timerCountStart; // this will hold your time, in miliseconds    
}
  1. var dateNow = new Date();
  2. var timerCountStart = dateNow.getTime();
  3. bt1.onPress = function()
  4. {
  5.     dateNow = new Date();
  6.     timerCountEnd = dateNow.getTime();
  7.     timerCountTotal = timerCountEnd - timerCountStart; // this will hold your time, in miliseconds    
  8. }
  • kbuger
  • Born
  • Born
  • kbuger
  • Posts: 2

Post 3+ Months Ago

thank you. it works pretty good

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 69 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.