Open Bleb1k opened 3 hours ago
i can have access to those variables by typing this
in the console:
basegain: 1
baseup: function baseup()
begin: function begin()
beginbought: 0
configYML: function configYML()
configymlbought: 0
doctype: function doctype()
doctypebought: 0
helloworld: function helloworld()
index: function index()
indexbought: 0
info: function info()
infshop: function infshop()
infunlock: 0
points: 0
push1: function push1()
push2: function push2()
shop: function shop()
sleep: function sleep(milliseconds)
stepfour: function stepfour()
stepfour2: function stepfour2()
stepfouradd: 1
stepone: function stepone()
stepone2: function stepone2()
steponeadd: 0
stepthree: function stepthree()
stepthree2: function stepthree2()
stepthreemult: 1
steptwo: function steptwo()
steptwo2: function steptwo2()
steptwomult: 1
update: function update()
updateloop: 1
upgbonus: function upgbonus()
upgbonusvar: 1
upgpriceboost: 0
upgstage: 0
this is fixed by using let
instead of var
Storing the state of the game in global scope is a bad practice
https://github.com/rando-idiot/Terminus.JS/blob/bbd663f897dfff103f71800e38337470a8ad2b7d/terminus.js#L31-L41
users have full access to these variables this way, this leads to a really messy environment