How do I timer countdown?

  • Hi Everyone!!

    I have been moving forward with my little project, and wanted to add Global Variables of Time and Score, but using bitmap fonts I've created.

    https://www.dropbox.com/s/3iu4s8v8ts5hd5c/help_1.png?dl=0

    Bitmap Fonts works on the engine

    https://www.dropbox.com/s/qdyvo4l36pr5y7z/help_2.png?dl=0

    Bitmap Fonts on the HUD layer

    What I want to do is to have the timer in its maximum time of 300 seconds and every 1 seconds, the Time subtract by a 1 seconds.

    However, nothing happens and even the bitmap I have given an instance with value, but nothing happens, I have seen videos on the subject but it does not work for me.

    https://www.dropbox.com/s/l2a2bp2vch73tpx/help_3.png?dl=0

    Event Sheet

    If there is a solution I will thank you!!

    Cheers

  • Your link to the Event Sheet is invalid.

  • Your link to the Event Sheet is invalid.

    I just fixed the link, I hope you can see the image.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You're subtracting from a different variable, my guess is you're displaying Time? You're subtracting from TIME_COUNT. Probably subtract from Time_Fonts.Time

  • You're subtracting from a different variable, my guess is you're displaying Time? You're subtracting from TIME_COUNT. Probably subtract from Time_Fonts.Time

    Hi!

    I tried to do that for every 1 second, 1 is subtracted from time_font, but there is no case, the counter does not decrease, I am not using the global variable.

    https://www.dropbox.com/s/xnepk53b9tc4rdj/help_4.PNG?dl=0

    If I'm using a bitmapfont for the timer, how should it work?

  • Are you sure the problem is with the spritefont and not somewhere else in your code?

    Does it work if you use a text object instead of the spritefont?

    Is your Time_Countdown group always enabled?

    Start your game in Debug mode (ctrl-F4) and check time_font variable - if it's decreasing every second.

  • Are you sure the problem is with the spritefont and not somewhere else in your code?

    Does it work if you use a text object instead of the spritefont?

    Is your Time_Countdown group always enabled?

    Start your game in Debug mode (ctrl-F4) and check time_font variable - if it's decreasing every second.

    Hi!!

    Thanks for answering!!

    https://www.dropbox.com/s/p4pem1dz2rhvb6a/help_5.PNG?dl=0

    You're right inside the system it works, but how do I then visually lower the counter?

  • So you set your spritefont text to "300" on start of your layout, but where is the event that updates it every second?

    You update your variable, but not the spritefont object.

    You need to add "Time_Fonts Set text to time_font" into the "Every 1 second" event.

  • So you set your spritefont text to "300" on start of your layout, but where is the event that updates it every second?

    You update your variable, but not the spritefont object.

    You need to add "Time_Fonts Set text to time_font" into the "Every 1 second" event.

    Ok, I was able to add this new action within the condition.

    https://www.dropbox.com/s/nnig7uss46qhrfs/help_6.PNG?dl=0

    But the counter is deleted in the HUD.

    https://www.dropbox.com/s/gv1tsa94828wc89/help_7.PNG?dl=0

  • Not to "time_font", to time_font without the quotation marks!

  • Not to "time_font", to time_font without the quotation marks!

    Thank you for your response, but still, time does not countdown.

    https://www.dropbox.com/s/bna8sgo6770w2lq/help_8.PNG?dl=0

  • Wait, why does the first line say "Time_Fonts -> Subtract from time_font"? It should be "System->Subtract from time_font".

    This means you have two time_font variables - one global variable and one instance variable on Time_Fonts object.

    Every 1 second you are changing the instance variable, but you set your text to the global variable (which doesn't change).

    You need to decide which one you want to use and delete the other one.

  • Wait, why does the first line say "Time_Fonts -> Subtract from time_font"? It should be "System->Subtract from time_font".

    This means you have two time_font variables - one global variable and one instance variable on Time_Fonts object.

    Every 1 second you are changing the instance variable, but you set your text to the global variable (which doesn't change).

    You need to decide which one you want to use and delete the other one.

    Thank You very Much!! It worked your help!!

    I decided to delete the instance and hold with the global variable, thank you very much.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)