How do I

Get help using Construct 2

Post » Mon Feb 08, 2016 12:03 pm

Everytime you start a new layout, the actions in the "on start of the layout" event will initiate too. You can use the instance variables and save these values in the local storage (https://www.scirra.com/tutorials/4877/t ... ying-value)
B
74
S
13
G
3
Posts: 995
Reputation: 7,531

Post » Mon Feb 08, 2016 1:37 pm

Good Morning, @RenatoB
Thank you for the reply but I think I confused a bit with this tutorial that you sent me, it is not What do I like, maybe I'm not being very clear in my question. I confess I have difficulty in English.
B
3
Posts: 7
Reputation: 189

Post » Mon Feb 08, 2016 1:59 pm

The local storage will save the variable value, maintaining itself at the same value even if you close the game.

After included the LocalStorage object:

On start of layout..
---->Local Storage Check for item ("vidasKey")

On Item found ("vidasKey")
----->Set value vidas to (LocalStorage.Itemvalue)

On Item missing ("vidasKey")
------>Set LocalStorage Item ("vidasKey") to 0

On end of layout
------>Set LocalStorage item ("vidasKey") to vidas
B
74
S
13
G
3
Posts: 995
Reputation: 7,531

Post » Mon Feb 08, 2016 2:57 pm

Hi,
the problem is your setting the points, vidas and stars to the default everytime a new layout is starting.
Remove those aktions from the "start layout" event and it works.
Also you need to update the vidas icons on start of a layout like you do on a hit.

I would recommend using english, for there are just more people speaking it than spanisch or portuguese.
B
7
S
2
Posts: 56
Reputation: 583

Previous

Return to How do I....?

Who is online

Users browsing this forum: HenryPK and 2 guests