A maths question regarding displaying time

juzcookjuzcook Member Posts: 259
edited November -1 in Working with GS (Mac)
Nearing the end of my major project and I'm trying to tidy up a few of the loose ends and minor details to polish it up!

My problem is displaying the time the player has spent in the game in an Hours, Minutes and Seconds display. The page where you see the time, is constantly updating even when you're looking at it.

I'm using the display text function to show it, but I'm having trouble removing the decimal points that appear in the Hours and Minutes part of the equation. Is there a simple way I can fix that? Hope I made that clear enough!

Juz

Comments

  • quantumsheepquantumsheep Member Posts: 8,188
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    use the floor function. It drops off the decimal part of a number

    e.g. floor(3.1415926535) = 3
    floor(123.948) = 123

    Edit: Or what QS posted. I forgot I that up. :p
  • juzcookjuzcook Member Posts: 259
    Ahh that's PERFECT!! Thanks a bunch guys. I figured it might have somethign to do with using the floor function, I'd just never used it and wouldn't have known where to start!
  • fremachucafremachuca Member Posts: 26
    anyone have the gameproject for codemonkey's "ClockAndRandom(Demo)"?
    i can't download it from the site anymore.
  • simo103simo103 Member, PRO Posts: 1,331
    search for it in GS creator New+ section it comes up there for download (double click it when you see it)
  • fremachucafremachuca Member Posts: 26
    thanks!
Sign In or Register to comment.