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

Method addControls

code/main/ThirdHouse.ts:35–50  ·  view source on GitHub ↗
(x: number, y: number)

Source from the content-addressed store, hash-verified

33
34 // Private methods
35 private addControls(x: number, y: number): void{
36 // If there's a game running, we add the controls
37 if(this.gameRunning != null){
38 // UP button
39 this.renderArea.addAsciiButton(x, x + 4, y, "thirdHouseUpButton");
40 this.renderArea.addLinkCall(".thirdHouseUpButton", new CallbackCollection(this.pressedUpButton.bind(this)));
41
42 // Space button
43 this.renderArea.addAsciiButton(x + 7, x + 25, y + 1, "thirdHouseSpaceButton");
44 this.renderArea.addLinkCall(".thirdHouseSpaceButton", new CallbackCollection(this.pressedSpaceButton.bind(this)));
45
46 // DOWN button
47 this.renderArea.addAsciiButton(x + 28, x + 34, y, "thirdHouseDownButton");
48 this.renderArea.addLinkCall(".thirdHouseDownButton", new CallbackCollection(this.pressedDownButton.bind(this)));
49 }
50 }
51
52 private addInsertCandiesButtons(x: number, y: number): void{
53 // First button (10 candies)

Callers 1

updateMethod · 0.95

Calls 3

addAsciiButtonMethod · 0.80
addLinkCallMethod · 0.80
bindMethod · 0.80

Tested by

no test coverage detected