How can I set my 3 digit countdown timer stay in 3 digit format all the way to zero?

Dell7730Dell7730 Member, PRO Posts: 388
edited June 2015 in Working with GS (Mac)

My countdown timer starts at 180 for 3 minutes, how can I make it where it'll reach zero in this 000 format?
BTW I'm using Integer instead of the system's time.

Best Answers

  • SocksSocks London, UK.Posts: 12,822
    edited June 2015 Accepted Answer

    I'm not sure how you are ending the countdown, you don't say, so it's a bit of an open ended question, but this displays 180 to 000:

    padInt(180- game.Time,3)

    . . . . . . . .

    So this, below, will display 180 to 000:

    When [numeric expression] 180- game.Time > 0
    --Display Text
    ----padInt(180- game.Time,3)

  • tatiangtatiang Posts: 11,949
    Accepted Answer

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SocksSocks London, UK.Posts: 12,822
    edited June 2015 Accepted Answer

    @Dell7730 said:
    it ends

    Deep, profound even.

    @Dell7730 said:
    if Attribute game.countdown =0 then it's the end, lol

    That's no real help, as you don't say what 'it's the end' means in real terms - it's neither a piece of mathematical information, coding information, design information, narrative or . . . . well or anything ! :smiley: You're asking for technical input, so your response would ideally be technical.

    But putting all that aside, try this:

    . . . . . .

    When [numeric expression] 180- game.Time > 0
    --Display Text
    ----padInt(180- game.Time,3)
    Otherwise:
    --Display Text
    ----'it's the end'

    :tongue:

Answers

  • Dell7730Dell7730 Member, PRO Posts: 388

    @Socks said:
    I'm not sure how you are ending the countdown, you don't say, so it's a bit of an open ended question, but this displays 180 to 000:

    padInt(180- game.Time,3)

    So this will display 180 to 00

    When game.time > 0
    --Display Text
    ----padInt(180- game.Time,3)

    it ends

    if Attribute game.countdown =0 then it's the end, lol

  • Dell7730Dell7730 Member, PRO Posts: 388

    thank you again, you guys rock as usual

  • Dell7730Dell7730 Member, PRO Posts: 388

    @Socks said:
    :tongue:

    if Attribute game.countdown =0 then Destroy this actor

    that's basically and technically what happens in my game, lol
    not trying to be difficult or anything, just simply how it is, lol

  • SocksSocks London, UK.Member Posts: 12,822
    edited June 2015

    @Dell7730 said:
    if Attribute game.countdown =0 then Destroy this actor

    This should do it:

    When [numeric expression] 180- game.Time =< 0
    --Destroy

  • Dell7730Dell7730 Member, PRO Posts: 388

    this is what I have right now that works based on your awesome expertise

    inside my Display Text thingy... lol
    padInt(game.Countdown,3)

    and it does start at 180 and end at 000

Sign In or Register to comment.