()
| 174 | } |
| 175 | |
| 176 | public update(): void{ |
| 177 | if(this.getQuestEnded() == false){ |
| 178 | // Test if the player is dead, if so, end the quest (he won!!) and return |
| 179 | if(this.getGame().getPlayer().shouldDie()){ |
| 180 | this.endQuest(true); // true because we always win |
| 181 | return; |
| 182 | } |
| 183 | |
| 184 | // Add some enemies |
| 185 | this.handlePatterns(100, 115); |
| 186 | |
| 187 | // Move the player vertically |
| 188 | this.moveVertically(); |
| 189 | |
| 190 | // Update entities |
| 191 | this.updateEntities(); |
| 192 | |
| 193 | // Force scrolling of everything |
| 194 | this.globalScrolling(); |
| 195 | } |
| 196 | |
| 197 | // Draw |
| 198 | this.preDraw(); |
| 199 | this.drawSea(); |
| 200 | this.drawEntities(); |
| 201 | this.drawAroundQuest(); |
| 202 | this.addExitQuestButton(new CallbackCollection(this.endQuest.bind(this, true), this.getGame().goToMainMap.bind(this.getGame())), "buttonExitQuestKeeping"); |
| 203 | this.postDraw(); |
| 204 | } |
| 205 | |
| 206 | // Public getters |
| 207 | public getDistance(): number{ |
nothing calls this directly
no test coverage detected