()
| 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{ |
nothing calls this directly
no test coverage detected