How do I Get The Game To Do Something The First Time It Runs

Get help using Construct 2

Post » Wed Aug 03, 2016 4:29 am

Hi there!

I'm trying to get a game to execute a command *once* the very first time it is run (I'm exporting using Node Webkit). I could do this with local storage, but that seems like an inelegant solution. Is there another solution I'm overlooking perhaps?
B
8
S
1
G
1
Posts: 19
Reputation: 1,093

Post » Wed Aug 03, 2016 7:11 am

if you are using score system like High Score and saving them in local storage then

On start of the layout
if High Score =0 then do anytihng
Image
B
64
S
39
G
45
Posts: 651
Reputation: 32,214

Post » Wed Aug 03, 2016 7:43 am

Local storage as a flag/variable is the simplest way. You don't even need to store a value really, just of the key exists, you know the program has been run before.
Mistakes were made.
B
51
S
25
G
107
Posts: 1,581
Reputation: 60,458

Post » Fri Aug 05, 2016 6:03 am

Alrighty, guess it'll have to do. Thanks for the help!
B
8
S
1
G
1
Posts: 19
Reputation: 1,093

Post » Fri Aug 05, 2016 10:10 am

You can see an example of that in the Score system of this tutorial.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
289
S
112
G
94
Posts: 7,333
Reputation: 69,293


Return to How do I....?

Who is online

Users browsing this forum: jorgmaquoi, Yahoo [Bot] and 10 guests