Hundreds of features to explore
Games made in Construct
Your questions answered
Popular & trusted by schools and Universities world-wide
Construct 3 runs in the browser & works offline
Students do not need accounts with us
Our educational partners
Free education resources to use in the classroom
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
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!
If you make the clock a global object, this means it won't get destroyed on layout changes.
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.
int(clock) will clear the decimals
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.
Thank You for the answers everyone!
How do I make the clock itself?
Develop games in your browser. Powerful, performant & highly capable.
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. YMMV
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?
How would I post my capx so I can get help directly?