display object only once - (using Webstorage)

Get help using Construct 2

Post » Wed Aug 13, 2014 9:42 am

Hey gus,

I would like to display an object at the very beginning of a layout BUT ONLY ONCE ! So when I quit my game a launch it again, the object doesnt appear on that layout because it was already viewed during the previous launch.

Maybe something like a tutorial screen, it also does not appear everytime you launch some game.

I guess it will be done with Webstorage feature but I dont know how.
Thanks.
B
14
S
4
Posts: 110
Reputation: 1,538

Post » Wed Aug 13, 2014 9:49 am

should be something like:

on the beginning of the layout if key does not exist show object and create key
if key does exist - don't show object..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Aug 13, 2014 10:55 am

LittleStain wrote:should be something like:

on the beginning of the layout if key does not exist show object and create key
if key does exist - don't show object..



yes but it wont work when I close the app or game and launchit again right? because it wont remember that the key exists, the values will be default again.. thats why i think the Webstorage should be used but dont know how
B
14
S
4
Posts: 110
Reputation: 1,538

Post » Wed Aug 13, 2014 11:00 am

The key that exists is a webstorage thing..

on start of layout
- webstorage: Local/session key exists
-- don't show object
-webstorage: Local/session key does not exist
-- show object
-- webstorage: Set local/session value
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Aug 13, 2014 11:22 am

LittleStain wrote:The key that exists is a webstorage thing..

on start of layout
- webstorage: Local/session key exists
-- don't show object
-webstorage: Local/session key does not exist
-- show object
-- webstorage: Set local/session value


oh I see..alright thn I will try that, thanks
B
14
S
4
Posts: 110
Reputation: 1,538


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 20 guests