Time Limit

Get help using Construct 2

Post » Thu Nov 01, 2012 3:02 pm

How do I create a running clock in my game that stays from screen to screen. Also how would create a custom sprite for the clock. Thank you for the help!
B
18
S
5
G
4
Posts: 63
Reputation: 3,912

Post » Thu Nov 01, 2012 3:38 pm

If you make the clock a global object, this means it won't get destroyed on layout changes.
B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Thu Nov 01, 2012 6:10 pm

Try this. Global variable for clock. Every tick set clock to "dt." This will make a consistent clock regardless of framerate. Make a text box. Every tick set text to global variable clock. I don't know how to have it show only seconds, but someone else might.
B
14
S
5
G
4
Posts: 121
Reputation: 3,938

Post » Thu Nov 01, 2012 6:21 pm

@ptbcomposer

int(clock) will clear the decimals
B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Fri Nov 02, 2012 4:05 am

Hmm, yes, thanks! Also, I forgot to mention. You can reset global variables to their initial value in the System events. That's the reason to make the clock text box set to a global variable.
B
14
S
5
G
4
Posts: 121
Reputation: 3,938

Post » Fri Nov 02, 2012 11:22 pm

Thank You for the answers everyone!
B
18
S
5
G
4
Posts: 63
Reputation: 3,912

Post » Wed Nov 07, 2012 6:14 pm

How do I make the clock itself?
B
18
S
5
G
4
Posts: 63
Reputation: 3,912

Post » Fri Nov 09, 2012 10:35 am

With numbers?

seconds = time % 60
minutes = int(time/60)
hours = int(time/3600)

Set text to hours & ":" & zeropad(minutes, 2) & ":" & zeropad(seconds,2)

Something like that, off the mind. YMMVMipey2012-11-09 10:35:25
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Wed Nov 28, 2012 5:07 am

I'm having trouble getting the numbers to appear in the text box. Can anyone explain to me how I would go about this in steps?
B
18
S
5
G
4
Posts: 63
Reputation: 3,912

Post » Thu Nov 29, 2012 1:54 am

How would I post my capx so I can get help directly?
B
18
S
5
G
4
Posts: 63
Reputation: 3,912

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 26 guests