Can't Get Score to Reset

0 favourites
  • 7 posts
  • I'm pretty sure this is my fault somehow, but if anyone can figure out the issue I would be eternally grateful! <img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question">

    Problem Description

    ____ A concise description of your problem here ____ The Score is not resetting at the start of a new game

    Attach a Capx

    ____ Upload a Capx to this post ____ https://drive.google.com/folderview?id= ... sp=sharing

    Description of Capx

    ____ Concise description of what this CapX does ____

    Steps to Reproduce Bug

    • Step 1 Shoot planes to gain a score above 0
    • Step 2 Get hit to generate the start screen then hit start
    • Step 3 check score, it should be reset to 0

    Observed Result

    ____ What happens? ____ the score isn't reset, but continues from the last play

    Expected Result

    ____ What do you expect to happen? ____ the score to reset to 0. There is an action that should reset the global variable of "Score" to "0"

    Affected Browsers

    • Chrome: (YES/NO) YES
    • FireFox: (YES/NO) YES
    • Internet Explorer: (YES/NO) YES

    Operating System and Service Pack

    ____ Your operating system and service pack ____ Windows 10/8

    Construct 2 Version ID

    ____ Exact version ID of Construct 2 you're using ____ R227

  • https://www.scirra.com/manual/83/variables

    Global variables store their values between layouts. Events in any layout can access any global variable, even if it was created in a different event sheet that is not included.

    The meaning of 'global'

    System has an action to reset globals.

  • so are you saying I should use a local variable instead?

  • You could use a local or on start of layout, reset all global variables.

  • Set score to zero in the 'on touch event' on the starting layout and before you change layout.

  • You could use a local or on start of layout, reset all global variables.

    I went with the latter and it worked perfectly. Thank you so much! and thanks to 99Instances2Go

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Closing as not a bug.

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