(game: Game)
| 3 | class Bridge extends Quest{ |
| 4 | // Constructor |
| 5 | constructor(game: Game){ |
| 6 | super(game); |
| 7 | |
| 8 | // Resize the quest |
| 9 | this.resizeQuest(138, 32); |
| 10 | |
| 11 | // Add collision boxes around |
| 12 | this.addPlayerCollisionBoxes(true, false, false, true); |
| 13 | |
| 14 | // Add the player |
| 15 | this.getGame().getPlayer().loadCandyBoxCharacter(this); |
| 16 | this.getGame().getPlayer().setGlobalPosition(new Pos(0, 17)); |
| 17 | this.configPlayerOrClone(this.getGame().getPlayer()); |
| 18 | this.addEntity(this.getGame().getPlayer()); |
| 19 | |
| 20 | // Add a wall at the bridge position |
| 21 | this.addBridgeFloor(); |
| 22 | |
| 23 | // Add the troll |
| 24 | this.addTroll(); |
| 25 | |
| 26 | // Add the message |
| 27 | this.getGame().getQuestLog().addMessage(new QuestLogMessage("You're trying to cross the bridge. A huge troll is blocking your way!")); |
| 28 | } |
| 29 | |
| 30 | // Public methods |
| 31 | public configPlayerOrClone(entity: QuestEntity): void{ |
nothing calls this directly
no test coverage detected