How do I fix game timer?

0 favourites
  • 5 posts
From the Asset Store
20 high quality click sounds, ready to improve your game's UI instantly
  • i have a infinte jumping game based off the infinte jumping template and when the the time is running for how long you are survivng its fine but when it shows you what you got it doesn't show your score it just says 0 here is a little piece of the code.

  • The score is your timer "timw" right?

    You add to the timer and right away you set the txt so it shouldn't be any problem with anything interfering with those events as they run one after the other.

    Did you make sure that you print the score in the right Txt object?

    Also, "Console log" the variable "timw" after you add 1 and press F12 to see if it works

    Also, "Console log" the Txt after you set the Txt to the "timw"

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • im guessing timew is a global? and when u die u reset the global variables. including timew. try reseting globals manually, only what needs to be reset or reset the time after u copy the results in a 2ndary data variable that is local or array etc... that doesnt change when u reset the globals.

  • I think the issue is you are setting the time as string without including the global variable.

    Can you try to set the text as the following:

    "time: " & timw

    ?

  • im guessing timew is a global? and when u die u reset the global variables. including timew. try reseting globals manually, only what needs to be reset or reset the time after u copy the results in a 2ndary data variable that is local or array etc... that doesnt change when u reset the globals.

    it worked thank you it has been taking forever to fix it

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