Game Timer/Counter.

0 favourites
From the Asset Store
Make a displayed number gradually increase or decrease, making an impression of a real-time counting.
  • I have been wondering how to make a timer for my game.

    I know how to make a simple every tick add one to timer kinda of timer.

    But i mean i need the milliseconds and mins counted. But im actually struggling <img src="smileys/smiley6.gif" border="0" align="middle" /> I think its something to do with *dt. But my little brain cannot figure it out.

    Im sure a maths savy can figure it out.

    Thanks.

  • There's a tutorial on the subject.

    I think you can tweak it and adapt it to your needs.

    The capx is in the comments.

  • Kyatric I tried, But im absolutely failing <img src="smileys/smiley6.gif" border="0" align="middle" /> Can you help me?

  • post your capx test, it's better if we point out your mistakes, you will learn faster

  • Yann, I managed to find this example: dl.dropbox.com/u/45711709/Timer.capx

    Its exactly what i need except if the seconds go over 60 then it doesn't add a min to the timer, it goes 61,62,63 ect. <img src="smileys/smiley6.gif" border="0" align="middle" />

  • clock.capx

  • Yann you are truly amazing!!!

    For brownie points, How would i get it to say the milliseconds aswell?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • probably something like

    milliseconds = timer-floor(timer)

  • Thanks Yann, Worked Like a charm as usual <img src="smileys/smiley4.gif" border="0" align="middle" />

  • Sorry, bringing this back to life, but milliseconds doesn't appear to be working for me. If I slow the time down, I can see that the milliseconds actually appears to loop 2-3 times before the seconds tick.

    Milliseconds = timer-floor(timer)

    right("00"&minutes,2)&" : "&right("00"&seconds,2)&" : "&right("00"&Milliseconds,2)

    What am I missing? :(

  • Is there a new way of doing a timer? I seem to remember seeing a plugin for it. Is the plugin better than the manual method?

  • AnD4D

    Yes, I have made a Time Manager plugin, which has different types of counters.

    You can find the plugin here: http://www.scirra.com/forum/topic49030.html

    The plugin counter works basically the same way as the manual timer, but its much easier and faster to create and use, than doing it the manual way. And you have a lot of different features you can do with the plugin, which you have to create yourself with the manual method.

    The downside with a plugin, is that it's not accepted to use 3rd party plugins in the Scirra Arcade. So if you want to publish your game there, you have to go the manual way.

  • AnD4D

    Try right("000"&miliseconds,3) instead.

  • I think I'm doing something wrong. It's showing 3 digits now going extremely fast, all the way up to 999, so I guess it's working, but I'd really only like to show the first 2 digits out of the 3.

    right("00"&Minutes,2)&" : "&right("00"&seconds,2)&" : "&right("000"&Milliseconds,3)

    Eventually I am to turn this into a leaderboard score, so hopefully it'll work!!!

  • left(right("000"&milliseconds,3),2) then.

    Or right("00"&str(floor(milliseconds/10)),2)

    Something like that

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)