Game Timer/Counter.

Get help using Construct 2

Post » Sun Jan 15, 2012 9:15 pm

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 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.
B
6
S
1
G
1
Posts: 42
Reputation: 810

Post » Sun Jan 15, 2012 9:43 pm

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.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Sun Jan 15, 2012 10:20 pm

@Kyatric I tried, But im absolutely failing Can you help me?
B
6
S
1
G
1
Posts: 42
Reputation: 810

Post » Sun Jan 15, 2012 10:48 pm

post your capx test, it's better if we point out your mistakes, you will learn faster
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Mon Jan 16, 2012 9:02 pm

@Yann, I managed to find this example: http://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.
B
6
S
1
G
1
Posts: 42
Reputation: 810

Post » Mon Jan 16, 2012 9:25 pm

Last edited by Yann on Sun Sep 14, 2014 9:57 pm, edited 1 time in total.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Mon Jan 16, 2012 9:42 pm

@Yann you are truly amazing!!!

For brownie points, How would i get it to say the milliseconds aswell?
B
6
S
1
G
1
Posts: 42
Reputation: 810

Post » Mon Jan 16, 2012 9:54 pm

probably something like
milliseconds = timer-floor(timer)
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Mon Jan 16, 2012 10:12 pm

Thanks @Yann, Worked Like a charm as usual
B
6
S
1
G
1
Posts: 42
Reputation: 810

Post » Sat Jul 07, 2012 4:02 pm

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? :(
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
68
S
8
G
6
Posts: 930
Reputation: 9,358

Next

Return to How do I....?

Who is online

Users browsing this forum: Braus, Draconinho, Magistross, nedzad, R0J0hound and 28 guests