How to make the result coins obtained from scene 1 continue into scene 2

Hello all members
I need help on how to make the result coins obtained from scene 1 continue into scene 2 and into scene 3 and so on…

I hope that the pictures will be illustrated if possible because I am a beginner and I desperately need this

and thanks in advance

Hi HMDE,

If you want the amount of coins collected to persist between different scenes, you can use a global variable to store the value.

Variables - Gdevelop wiki

Cheers.

1 Like

Hi brother … Thank you for helping
Actually, this is exactly what I requested … I will try to apply it and if I don’t understand … you can help me

Just like what sanscolor said use a Global variable for this.

If you don’t understand it well,
Basically you just create a global variable and access it across to any scenes you have. You update your coins counter every scene and in that way you can get the latest coins counter on next scene.

1 Like

nmrisrl11

thank you very much
You are right, but as a beginner, this is the problem … I don’t know anything about these matters, so I try hard to understand that …

For example, this is a small game project. I have been trying for some time to link the scenes to coins, but I always fail in this

This is the project if you can help me make
https://drive.google.com/open?id=1uA2FxCku433XEBfaMc7GC-iropQty_A2

Then you will i know what the added lines are so that I understand more…
Thanks a lot for your help

Just do this
Create a global variable let’s say coinsCounter set the value to 0.

I assume that you want your coins to be updated every after the level completed, if i’m right.
I have checked your game and you have a counter for coins you collected on the game, you just need to put that counter value to the global variable you created (coinsCounter) if the game is completed, then on scene 2, you just call the global variable (coinsCounter) and that will automatically get the updated value of your coins.

2 Likes

Well, you saw my game now, where do I start this general variable from?..(( LEVEL-1 OR List-2))

You can set it anywhere you want as you’re declaring a global variable.

2 Likes

Well now I created a general variable named (CoinsCounter)

How to make the result coins obtained from scene named (( LEVEL-1)) continue into scene named (( List-2 ))

Same idea how you created your current coins counter, just get it’s value and set it to global variable you created and to access it, you need to convert it to string first, like this ToString(GlobalVariable(coinsCounter))

2 Likes

Sorry brother i bothered you
But, I have a request, can you help me to apply the steps to my project and raise it … because in this way I will know what the steps are when I review it … because whenever I try this I fail

Is there any other assistant in adding the required to my project in order to benefit …
https://drive.google.com/open?id=1uA2FxCku433XEBfaMc7GC-iropQty_A2

Is there no professional here to help me?

1 Like

I have made a tutorial on that and it would be out in some hours

1 Like

Thank you very much
i am waiting your Tutorial …
I am following most of your Tutorials

1 Like