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

Method update

code/main/Hell.ts:64–91  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

62 }
63
64 public update(): void{
65 if(this.getQuestEnded() == false){
66 // Test if the player won the quest, if so, end the quest and return
67 if(this.thePlayerWon()){
68 this.endQuest(true);
69 return;
70 }
71
72 // Test if the player is dead, if so, end the quest and return
73 if(this.getGame().getPlayer().shouldDie()){
74 this.endQuest(false);
75 return;
76 }
77
78 // Update entities
79 this.updateEntities();
80 }
81
82 // Draw
83 this.preDraw();
84 this.drawBackground(0, 20);
85 this.drawEntities();
86 this.drawAroundQuest();
87 if(this.getQuestEnded() == false) this.addExitQuestButton(new CallbackCollection(this.getGame().goToMainMap.bind(this.getGame())), "buttonExitQuestNoKeeping");
88 else if(this.getQuestEndedAndWeWon() == false) this.addExitQuestButton(new CallbackCollection(this.getGame().goToMainMap.bind(this.getGame())), "buttonExitQuestNoKeepingBecauseLose");
89 else this.addExitQuestButton(new CallbackCollection(this.getGame().goToMainMap.bind(this.getGame())), "buttonExitQuestKeeping");
90 this.postDraw();
91 }
92
93 // Private methods
94 private addCamazotz(pos: Pos): void{

Callers

nothing calls this directly

Calls 15

thePlayerWonMethod · 0.95
endQuestMethod · 0.95
drawBackgroundMethod · 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
getQuestEndedAndWeWonMethod · 0.80

Tested by

no test coverage detected