(jumpDuration: number, jumpSpeed: number = 1)
| 309 | } |
| 310 | |
| 311 | public jump(jumpDuration: number, jumpSpeed: number = 1): boolean{ |
| 312 | // BUGS |
| 313 | if(Bugs.getQuestBugLevel() >= 2) |
| 314 | jumpSpeed = Random.between(1, 5); |
| 315 | |
| 316 | // If we're not already jumping or controlled falling and we would collide by going down (which means we're on the ground), we jump (we also jump without checking all that if we are able to jump in mid-air) |
| 317 | if((this.jumping == false && this.controlledFalling == false && this.checkCollision(new Pos(0, 1))) || this.canJumpInMidAir()){ |
| 318 | this.jumping = true; |
| 319 | this.jumpDuration = jumpDuration; |
| 320 | this.jumpSpeed = jumpSpeed; |
| 321 | return true; |
| 322 | } |
| 323 | |
| 324 | return false; |
| 325 | } |
| 326 | |
| 327 | public move(pos: Pos, force: boolean = false): boolean{ |
| 328 | // BUGS |
no test coverage detected