Ex­po­nen­tial Idle Guides

Day 2: A The­ory of Your Own

Guide writ­ten by Minh Tea (prop). Con­tri­bu­tions from the Amaz­ing Com­munity.

Feel free to use the gloss­ary as needed.

Good morn­ing. It is dawn of the second day.

Today, we’re go­ing to cre­ate a simple the­ory with a couple of up­grades, and un­til the end of this week, we will be flesh­ing it out, bit by bit. By the end, hope­fully it will be one to be proud of.

Let’s start by cre­at­ing a folder in the SDK dir­ect­ory. Any name would do. In­side the folder, cre­ate a new file named my_­the­ory.js. This shall be your first the­ory.

Note: Within the com­munity, the term ‘vari­able’ is used for vari­ables in an equa­tion. However, in this guide, they will be called ‘up­grades’, as not only are they ca­non­ic­ally called this way in the API, the term ‘vari­able’ is used to refer to vari­ables in pro­gram­ming. When re­fer­ring to an up­grade’s value, the word ‘term’ or ‘factor’ shall be used, de­pend­ing on the equa­tion.

Note: I will be us­ing el­lipses (…) to trun­cate any code that was already pre­vi­ously writ­ten. Do not blindly copy these!

I know. I wish I could say ‘vari­ables’ all the time too.

▶︎ The first ritual

▶︎ The first up­grade

) is used. . For the LaTeX syn­tax, we use to wrap a nor­mal string in a pair of and for in­line LaTeX dis­play. You can use these mark­ers nor­mally without this func­tion as well.

▶︎ The second up­grade

) that will out­class this clicker, and set its iden­ti­fier to 1: 's power, by us­ing : , . As 's value changes every time the up­grade is bought, we will be us­ing and so these texts will peri­od­ic­ally up­date, around 10 times per second. , and for the info, we want to show the change in power when we level up the up­grade as . Since there is a com­mon part in these two texts, , we will be cre­at­ing a re­useable func­tion to shorten the code. with no decim­als) eval­u­ates to. If the value of is 9, the re­turned string will be ‘c_1 = 9’, for in­stance. . 's ef­fect so that we won’t be wast­ing money on it. We will be us­ing to in­cre­ment the cur­rency ac­cord­ing to the term: ). In-game, we can simply treat as the cur­rency’s ‘ve­lo­city’. up­grade avail­able for pur­chase, and that it can af­fect the cur­rency.

▶︎ Af­ter­math