(pos: Pos)
| 355 | } |
| 356 | |
| 357 | public moveWormsLike(pos: Pos): boolean{ |
| 358 | // If we can move normally |
| 359 | if(this.checkCollision(pos) == false){ |
| 360 | // If we can't move two steps below but we can move on step below, then we move one step below (if we're not jumping or controlled falling) |
| 361 | if(this.checkCollision(pos.plus(new Pos(0, 2))) == true && this.checkCollision(pos.plus(new Pos(0, 1))) == false && this.jumping == false && this.controlledFalling == false){ |
| 362 | return this.move(pos.plus(new Pos(0, 1))); |
| 363 | } |
| 364 | // Else we just move normally |
| 365 | else{ |
| 366 | return this.move(pos); |
| 367 | } |
| 368 | } |
| 369 | // Else, if we can move just one step above (and we're not jumping or controlled falling) |
| 370 | else if(this.checkCollision(pos.plus(new Pos(0, -1))) == false && this.jumping == false && this.controlledFalling == false){ |
| 371 | // We move one step above |
| 372 | return this.move(pos.plus(new Pos(0, -1))); |
| 373 | } |
| 374 | |
| 375 | // Else we don't move |
| 376 | return false; |
| 377 | } |
| 378 | |
| 379 | public removeQuestEntityWeapons(): void{ |
| 380 | this.questEntityWeapons = []; |
no test coverage detected