MCPcopy Create free account
hub / github.com/candybox2/candybox2.github.io / constructor

Method constructor

code/main/Game.ts:139–169  ·  view source on GitHub ↗
(gameMode: string)

Source from the content-addressed store, hash-verified

137
138 // Constructor
139 constructor(gameMode: string){
140 // We save the game mode given in parameter
141 if(gameMode != null) Saving.saveString("gameGameMode", gameMode);
142
143 // We create the grid items
144 this.createGridItems();
145
146 // We create the eqItems
147 this.createEqItems();
148
149 // We create the status bar
150 this.statusBar = new StatusBar(this, 0);
151
152 // We create the player
153 this.player = new Player(this);
154
155 // We create the resources
156 this.candies = new Candies(this, "gameCandies");
157 this.lollipops = new Lollipops(this, "gameLollipops");
158 this.chocolateBars = new ChocolateBars(this, "gameChocolateBars");
159 this.painsAuChocolat = new PainsAuChocolat(this, "gamePainsAuChocolat");
160 this.candiesEaten = new CandiesEaten(this, "gameCandiesEaten");
161 this.candiesThrown = new CandiesThrown(this, "gameCandiesThrown");
162
163 // We update the status bar
164 this.updateStatusBar();
165
166 // We launch timeouts & intervals methods
167 this.oneSecondIntervalId = window.setInterval(this.oneSecondMethod.bind(this), 1000);
168 window.setTimeout(this.questMethod.bind(this), 100);
169 }
170
171 // Public methods
172 public addHotkey(hotkey: Hotkey){

Callers

nothing calls this directly

Calls 4

createGridItemsMethod · 0.95
createEqItemsMethod · 0.95
updateStatusBarMethod · 0.95
bindMethod · 0.80

Tested by

no test coverage detected