dimanche 26 avril 2015

How to change a variable in the JavaScript without loading the JavaScript content?

I have a typing web game written using JS. The JS contains all the necessary definition and algorithm of the game. There is a global variable called game_mode. By altering this variable to either 0, 1 or 2, I can load different game modes on the webpage. My difficulty is, I can't figure out a way where I can edit game_mode before I load the JS content using HTML. If I load the JS, the JS already starts running and thus the game starts, using the game_mode hard-coded. Is there anyway to do so?




Aucun commentaire:

Enregistrer un commentaire