(quest: Quest, pos: Pos, goingRight: boolean)
| 3 | class DesertBird extends QuestEntity{ |
| 4 | // Constructor |
| 5 | constructor(quest: Quest, pos: Pos, goingRight: boolean){ |
| 6 | super(quest, |
| 7 | pos, |
| 8 | new Naming("A desert bird", "a desert bird"), |
| 9 | new RenderArea(9, 4), |
| 10 | new Pos(0, 0), |
| 11 | new CollisionBoxCollection(new CollisionBox(this, new Pos(0, 0), new Pos(9, 4))) |
| 12 | ); |
| 13 | |
| 14 | // If we're heading to right |
| 15 | if(goingRight){ |
| 16 | this.setQuestEntityMovement(new QuestEntityMovement(new Pos(1, 0))); |
| 17 | this.setQuestEntityAnimation(new QuestEntityAnimation(3, Random.upTo(2), Random.upTo(1), "places/quests/desert/birdRightUp", "places/quests/desert/birdRightDown")); |
| 18 | } |
| 19 | // Else |
| 20 | else{ |
| 21 | this.setQuestEntityMovement(new QuestEntityMovement(new Pos(-1, 0))); |
| 22 | this.setQuestEntityAnimation(new QuestEntityAnimation(3, Random.upTo(2), Random.upTo(1), "places/quests/desert/birdLeftUp", "places/quests/desert/birdLeftDown")); |
| 23 | } |
| 24 | |
| 25 | // Set destructible |
| 26 | this.setDestructible(true); |
| 27 | this.setMaxHp(6); |
| 28 | this.setHp(6); |
| 29 | } |
| 30 | |
| 31 | // willDie() |
| 32 | public willDie(): void{ |
nothing calls this directly
no test coverage detected