()
| 187 | } |
| 188 | |
| 189 | private checkCollision(): boolean{ |
| 190 | // If the ship is outside the screen, we return true |
| 191 | if(this.shipYPosition < 0) |
| 192 | return true; |
| 193 | if(this.shipYPosition > 9) |
| 194 | return true; |
| 195 | |
| 196 | // No collision, we return false |
| 197 | return false; |
| 198 | } |
| 199 | |
| 200 | private checkCollisionWithAsteroids(): boolean{ |
| 201 | // Boolean used to know if we already lose one hp or not |