(pos: Pos = new Pos(0, 0))
| 151 | } |
| 152 | |
| 153 | public checkCollision(pos: Pos = new Pos(0, 0)): boolean{ |
| 154 | // BUGS : if the level is >= 4, we just return a random value |
| 155 | if(Bugs.getQuestBugLevel() >= 4) |
| 156 | return Random.flipACoin(); |
| 157 | |
| 158 | for(var i = 0; i < this.quest.getEntities().length; i++){ |
| 159 | // If it's not the same object as us |
| 160 | if(this.quest.getEntities()[i] != this){ |
| 161 | // If we collide with it, we return true |
| 162 | if(this.collidesWith(this.quest.getEntities()[i], pos)) |
| 163 | return true; |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | // No collision |
| 168 | return false; |
| 169 | } |
| 170 | |
| 171 | public collidesWith(questEntity: QuestEntity, pos: Pos = new Pos(0, 0)): boolean{ |
| 172 | // If we both have a collision box collection, we return the result of the collision test |
no test coverage detected