(game: Game, specialInstruction: string = null)
| 45 | |
| 46 | // Constructor |
| 47 | constructor(game: Game, specialInstruction: string = null){ |
| 48 | super(game); |
| 49 | |
| 50 | // Set the special instruction |
| 51 | this.specialInstruction = specialInstruction; |
| 52 | |
| 53 | // Reset the player |
| 54 | this.getGame().resetPlayer(); |
| 55 | |
| 56 | // Create player spells |
| 57 | this.createPlayerSpells(); |
| 58 | |
| 59 | // Set the real quest position |
| 60 | this.realQuestPosition = new Pos(0, 2); |
| 61 | |
| 62 | // And the size to add to the real quest size |
| 63 | this.sizeToAddToTheRealQuestSize = new Pos(0, 12); |
| 64 | |
| 65 | // If there is a special instruction, change the real quest position |
| 66 | if(this.specialInstruction != null){ |
| 67 | this.realQuestPosition.add(new Pos(0, 1)); |
| 68 | } |
| 69 | |
| 70 | // If there is at least a spell, change the real quest position |
| 71 | if(this.playerSpells.length != 0){ |
| 72 | this.realQuestPosition.add(new Pos(0, this.playerSpellsHeight)); |
| 73 | } |
| 74 | |
| 75 | // Add two delimiters in the quest log |
| 76 | this.getGame().getQuestLog().addDelimiter(); |
| 77 | |
| 78 | // Create the player collision boxes entity |
| 79 | this.playerCollisionBoxes = new Wall(this, new Pos(0, 0)); |
| 80 | |
| 81 | // Set the quest slowed down variable at the game level (and the quest speed up too) |
| 82 | this.getGame().setQuestSlowedDown(false); |
| 83 | this.getGame().setQuestSpeedUp(0); |
| 84 | } |
| 85 | |
| 86 | // Public methods |
| 87 | public addPlayerCollisionBoxes(top: boolean, right: boolean, bottom: boolean, left: boolean): void{ |
nothing calls this directly
no test coverage detected