final score

0 favourites
  • i have 3 layouts each with their own event sheet, the layouts are: main menu, game, game over.

    i have my score counter on the game layout and event sheet, and would like that score to show on the game over screen to show the players final score. is this possible?

    thanks

  • Save your score as a global var, you can access them form every layout of the game.

  • Yes global var or WebStorage

  • i have it already set to global variable but for some reasoni just cant figure out how to get it to show on the final layout

  • Put a Textobject on the final layout, read the content of the global variable and paste it into the textobject.

  • hi ubivis im not quiet sure what you mean by copy the content of the variable?

  • Event : On Load Layout ( for exemple you can take a lot i think ) --> Action : Text ( Name Of your Target Text Object ) Set Text to ( Your Global Variable Name ).

  • ok i did that but now it shows the score as its starting value of 0 instead the final score

  • can you do a snapshot of the event you set up? Or maybe upload a capx file? This is much easier for all of us to see where you might have done a mistake.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • hmm, i have created a empty text object called text3 on the final layout.

    on the event sheet of the final layout i have: system>on start of layout>text3>set text to score variable

  • is the "score" Variable a global variable? Are you updating the variable on the game layout with the score?

  • the score is a global variable. and yes the global variable is located on the game layout event sheet where its set to update, and works fine on the game, but doesnt on the game over layout, it just shows its default value of 0

  • hmm, without a capx (that someone could have a look into it), it is a bit hard to find out what might be wrong.

    I am work at the moment, without access to construct, but when I'm back home (unfortunately just in about 8 hours) I can set up an example and share it. Maybe someone else is quicker

  • ah ok thanks very much for your help

  • quickly installed C2 on a VM Machine, here you can download an example: Link

    Update: Also example now attached to the post!

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