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

Method update

code/main/Cellar.ts:52–76  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

50 }
51
52 public update(): void{
53 if(this.getQuestEnded() == false){
54 // Test if the player won the quest, if so, end the quest and return
55 if(this.thePlayerWon()){
56 this.endQuest(true);
57 return;
58 }
59
60 // Test if the player is dead, if so, end the quest and return
61 if(this.getGame().getPlayer().shouldDie()){
62 this.endQuest(false);
63 return;
64 }
65
66 // Update entities
67 this.updateEntities();
68 }
69
70 // Draw
71 this.preDraw();
72 this.drawEntities();
73 this.drawAroundQuest();
74 if(this.getQuestEnded()) this.addExitQuestButton(new CallbackCollection(this.goToFifthHouse.bind(this)), "buttonExitQuestKeeping");
75 this.postDraw();
76 }
77
78 // Private methods
79 private addGround(): void{

Callers

nothing calls this directly

Calls 13

thePlayerWonMethod · 0.95
endQuestMethod · 0.95
getQuestEndedMethod · 0.80
getPlayerMethod · 0.80
updateEntitiesMethod · 0.80
preDrawMethod · 0.80
drawEntitiesMethod · 0.80
drawAroundQuestMethod · 0.80
addExitQuestButtonMethod · 0.80
bindMethod · 0.80
postDrawMethod · 0.80
shouldDieMethod · 0.45

Tested by

no test coverage detected