hexodin's Recent Forum Activity

  • Thank you, about the ZeroPad function, returns a error on r75: "Unknow Expression 'ZeroPad'", but the "right" function works well.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I made a little counter for time remaining to level ends in my game. I can't upload it now, but the example consists only in:

    1. Add a Text on layout;

    2. Add a global variable like "secondsToPlay" and set a number of seconds, for example 150 for 2 minutes and a half, or 120 to 2 minutes on Event Sheet;

    3. Add Event: System > Every 1 second(s);

    • 3.1. Add Action > Text > "Time Remaining: " & Floor(secondsToPlay/60) & ":" & Floor(secondsToPlay%60)
    • 3.2. Add Action > System > Subtract 1 from secondsToPlay;

    The counter will start: 2:0 - 1:59 - 1:58 - ... - 1:9 - n

    The problem is: As you can see, I don't know how I can put a zero left on numbers to have this visual representation: 02:00 - 01:59 - 01:58 - ... - 01:09 - n.

    In programming languages, for example, we can format the outputed string like: print "Missiles: %02" % numberOfMissiles and obtain a plain text like: "Missiles: 003".

    From now on, the question is obvious: "How can I do this with Construct 2?", how can I format my string? Or... if anyone has a better way to do this...

    Thanks in advance.

hexodin's avatar

hexodin

Member since 11 Jan, 2012

None one is following hexodin yet!

Trophy Case

  • 12-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

14/44
How to earn trophies