How do ensure that the game score count is fixed?

Not favoritedFavorited Favorited 0 favourites
From the Asset Store
An educational game for counting pictures. An easy to use template for developers to build larger games
  • I have a game that I have created. It is only one project and I have created a platformer game where a character collects coins and the score increases as a result. The character loses a life if they fall or are in contact with an enemy. The global variable reset, however, it would continue counting like I have not lost a life when reset. Here is the code that has been inserted:

  • i dont know why that happens but look here if this helps:

    ive never used the function -> System: Reset global variables to default (include static: True)i always reset each variable with a separate action and that always works fine with me - why not try that and tell me if it works?

  • If you are talking about the HP variable, it resets because you reset all global variables.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • dop2000, I am talking about the points not working correctly. The HP part works as intended.

  • what is the default of those global variables?

    is it 0?

  • wait does this thing work correctly for when:

    player collides with enemy

    and

    player outside layout

    if it isnt both that could because the order of actions in the event sheet arnt the same

    for the outside the layout one -

    you subtracted from hp then reset global vars

    that wont affect the hp at all

    but for the colliding with enemies -

    you reset global vars then subtracted from hp

    that will affect the hp

    does this help or did u say only the score doesnt work?

  • also do u use global vars for the score or is it instance vars?

  • I am talking about the points not working correctly. The HP part works as intended.

    What points? pointsLvl3?

    Your screenshot doesn't show how and where do you change this variable. If it's global, it will be reset to default value with all other global variables.

  • no this could be it

    did u use instance variables or global variables for the points?

    reset global vars doesnt reset instance vars

  • I have used the points as a global variable.

  • Radkampfwagen not all variable defaults are 0. The points variable default is 0.

  • sophia Ceras well you could just try doing

    reset GB points

    and reset GB hp

    rather than resetting all GBs

    most likely this wont work but you could just try it.

    Radkampfwagen

    edit -

    you have to have no space?

    how do i ping you?

  • I have ensured that the HP and points are separate. It still does not work.

  • Can you please clarify the problem?

    Which variable isn't working? What exactly is happening with it? And what exactly should be happening?

    This is a very simple issue, but we have already 13 comments in this post and still no clear explanation, it's getting a bit ridiculous.

  • Hi ! Ahah don't be angry dop2000, I understand but he must be a little lost. But it's true your explication is not too clear, it's better if we can to see your full event sheet. I think don't use Reset Points to default just use Set Points to 0, in case your variable is wrong declared. Like this, a little exemple working :

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