()
| 71 | |
| 72 | // update() |
| 73 | public update(): void{ |
| 74 | // Try to go towards the player |
| 75 | this.goTowards(this.getRenderAreaCenter(), this.getQuest().getGame().getPlayer().getRenderAreaCenter(), 0, new Pos(1, 0)); |
| 76 | |
| 77 | // If we're far from the player, we try to jump |
| 78 | if(Math.abs(this.getRenderAreaCenter().x - this.getQuest().getGame().getPlayer().getRenderAreaCenter().x) > 5) |
| 79 | this.jump(3); |
| 80 | |
| 81 | // Call the mother class update method |
| 82 | super.update(); |
| 83 | } |
| 84 | |
| 85 | // willDie() |
| 86 | public willDie(): void{ |