Tschrock / ShinoBooper

A very simple cookie-clicker-like game with pones instead of cookies
http://shinoboop.cyberpon3.net/
0 stars 0 forks source link

Minor Bug #1

Open DrMilgram opened 7 years ago

DrMilgram commented 7 years ago

Apparently the global boops variable is lefted in some "public" mode and you can modify it from web consoles just using this.boops = value

Even if this is a very minor bug i feel like i have to report it because can lead to major rigging in the highscores

DrMilgram commented 7 years ago

so i made a workaround of that problem but i don't like it that much. I think that there is a better engineering solution for that. anyway here's what i tried to do:

i made a big game() function in the game.js files i have added some getters for all the variables and setted all the functions asthis."nameFunction" = function (){...} to make them "public" and allow access from all the other parts of the game. At the end of the file i explicited called the this.init() function to build the game.

then i update the highscore.js file with all the getters instead of the raw variables (since they are no more visible)

then i changed thethis.init() in the onload in the body of index.html with this.game() so it will just start the game and will call the

init() automatically.

i'm not sure this works with all the database thing, but i'm sure it's just an idea of how to fix that bug.

Workaround.zip