give coins to player for level completion.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By THE HELIX

Hi i am new to godot.I have been struck with a problem ;
Basically it is a 2D arcade game.
I would like to give coins to my player for completing the level.They should be able to use those coins to unlock next level.
could u please help me out ?

:bust_in_silhouette: Reply From: JulioYagami

You can use singletons to keep your coin amount var as a global var, so you can acess it later with:

"singleton_name".coins += 10 // some amount

thank’s for ur advice.

but how do i reward my player for level completion?

THE HELIX | 2018-12-06 14:39

Hi, i assume that when level is completed, some signal is fired, or some function is executed. The you just use the code @JulioYagami told you there. If this is not the case, perhaps you should post some code.

p7f | 2018-12-06 16:23