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?
Develop games in your browser. Powerful, performant & highly capable.
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
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.
Alrighty, guess it'll have to do. Thanks for the help!
You can see an example of that in the Score system of this tutorial.