Is it possible to access global variables from outside of a game???
No, you should use files to share data outside the game.
But it seems impossible to use files in html5 . Can you teach me how to use JSON to store locally scores, acheivements, etc???
You can use webstorage in HTML5 games (it’s the same actions as the files in the native platform). It stores the data inside files from the webbrowser.
Could you tell me the correct way to do it?
An example maybe:?
I’m not sure where to place a file (if required) or what to do
I’m in a total mess
Just use the normal storage actions like you are using them to save file in a native game.
then where is the file saved? on the server?
And will it be a xml file or just plain text?
What server? Is saved to the client side. The exact location depends on the web browser and the OS where the game is loaded.