How do I do this? (Hard :D)

Get help using Construct 2

Post » Thu Jul 13, 2017 6:56 pm

I want to show up interstitial ad every 3 times when the character died, but
in my game if the character died, then reset all global variables, thats why I can not know, how to do this?
Any idea?
B
20
S
10
G
10
Posts: 143
Reputation: 7,096

Post » Thu Jul 13, 2017 7:02 pm

Instead of using the reset global variables, reset them individually (besides number of deaths) upon death.
B
56
S
33
G
23
Posts: 334
Reputation: 16,743

Post » Thu Jul 13, 2017 9:18 pm

This is a good idea, but have a lot of global variables.
B
20
S
10
G
10
Posts: 143
Reputation: 7,096

Post » Fri Jul 14, 2017 5:04 pm

So you want a few variables (counters) that do not get reset.

Use "WebStorage". (the newer versions of C2 have LocalStorage, but I prefer using WebStorage instead, this you can get by adding a New Object then right-click to select 'Show Depreciated Objects').

WebStorage (or LocalStorage) basically saves and keeps the value... even when you restart or close the whole game and come back the next day. This is normally used for "Best Scores" and "Total Coins Collected", etc. You can use this in your Game layout as a counter. And the Menu or Levels page to reset it.
B
10
S
2
Posts: 107
Reputation: 978

Post » Fri Jul 14, 2017 8:16 pm

Thx the answer!
B
20
S
10
G
10
Posts: 143
Reputation: 7,096


Return to How do I....?

Who is online

Users browsing this forum: Sparkz and 1 guest