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

Method constructor

code/main/Dragon.ts:23–42  ·  view source on GitHub ↗
(game: Game)

Source from the content-addressed store, hash-verified

21
22 // Constructor
23 constructor(game: Game){
24 super(game);
25
26 // Set the default step and player position
27 if(Saving.loadBool("dragonDone") == false){ // If we never talked with the dragon yet
28 this.step = DragonStep.PLAYER_MOVING;
29 this.playerPos = 0;
30 }
31 else{ // Else, we already talked with the dragon
32 this.step = DragonStep.TALKING;
33 this.playerPos = 60;
34 }
35
36 // Launch the interval and get the ID
37 this.timerIntervalID = setInterval(this.actionInterval.bind(this), 100);
38
39 // Resize and update
40 this.renderArea.resizeFromArray(Database.getAscii("places/dragonFoot"), 0, 3);
41 this.update();
42 }
43
44 // getRenderArea()
45 public getRenderArea(): RenderArea{

Callers

nothing calls this directly

Calls 4

updateMethod · 0.95
bindMethod · 0.80
resizeFromArrayMethod · 0.80
getAsciiMethod · 0.80

Tested by

no test coverage detected