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
74
S
44
G
48
Posts: 697
Reputation: 34,736

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
55
S
28
G
115
Posts: 1,709
Reputation: 65,116

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
298
S
120
G
96
Posts: 7,339
Reputation: 71,454


Return to How do I....?

Who is online

Users browsing this forum: Walessio and 5 guests