How do I save a global variable? (Like flappy birds score)

Get help using Construct 2

Post » Sat May 10, 2014 12:00 pm

I want to save a global variable so that when the game loads the high score from the previous time you opened the game is still there? surely I can do this without any online stuff
B
6
S
1
Posts: 69
Reputation: 643

Post » Sat May 10, 2014 3:37 pm

You need to use webstorage. I save a game highscore there.
B
10
S
1
Posts: 22
Reputation: 587

Post » Sat May 10, 2014 3:46 pm

If I were to give you my capx file or show you my code, could you tell me how to do? Regardless of how I try it doesn't work :/
B
6
S
1
Posts: 69
Reputation: 643

Post » Sat May 10, 2014 6:31 pm

@DylanBannan, please don't start multiple threads with the same request - you currently have 3 requesting help for web storage, all started within an hour of each other.

Have you searched the tutorials?
A big fan of JavaScript.
B
74
S
20
G
69
Posts: 2,205
Reputation: 43,832

Post » Sun May 11, 2014 1:29 am

@DylanBannan I don't want to edit your .capx. But i can take a several sscreenshot of my work.
drive.google.com/file/d/0B9kuXoWVwWfpTGlmbmlpNTlkU28/edit?usp=sharing
at start of the game it trying to see, variable best in webstorage exist? If no, they set it.
drive.google.com/file/d/0B9kuXoWVwWfpT3R0T25pUmstdUk/edit?usp=sharing
And next, they compare score with bestscore.
Check this: scirra.com/manual/120/webstorage
B
10
S
1
Posts: 22
Reputation: 587


Return to How do I....?

Who is online

Users browsing this forum: marcinkowski, Yahoo [Bot], zenox98 and 26 guests