()
| 593 | } |
| 594 | |
| 595 | Show() { |
| 596 | if (this.playersDead) |
| 597 | return; |
| 598 | push(); |
| 599 | |
| 600 | //if on the previous level and is up the top, then show |
| 601 | if (!replayingBestPlayer) { |
| 602 | if (this.currentLevelNo === population.showingLevelNo - 1) { |
| 603 | if (this.currentPos.y < this.height) { |
| 604 | translate(0, height); |
| 605 | |
| 606 | } else { |
| 607 | pop(); |
| 608 | return; |
| 609 | } |
| 610 | } |
| 611 | } |
| 612 | |
| 613 | |
| 614 | translate(this.currentPos.x, this.currentPos.y); |
| 615 | |
| 616 | // if (this.jumpHeld) { |
| 617 | // // this.height = this.height / 2 |
| 618 | // // translate(0, this.height) |
| 619 | // image(squatImage,-20,-35 ); |
| 620 | // |
| 621 | // }else{ |
| 622 | |
| 623 | |
| 624 | let imageToUse = this.GetImageToUseBasedOnState(); |
| 625 | |
| 626 | if (!this.facingRight) { |
| 627 | push() |
| 628 | scale(-1, 1); |
| 629 | if (this.hasBumped) { |
| 630 | image(imageToUse, -70, -30); |
| 631 | } else if (imageToUse == jumpImage || imageToUse == fallImage) { |
| 632 | image(imageToUse, -70, -28); |
| 633 | } else { |
| 634 | image(imageToUse, -70, -35); |
| 635 | } |
| 636 | pop() |
| 637 | } else { |
| 638 | |
| 639 | if (this.hasBumped) { |
| 640 | image(imageToUse, -20, -30); |
| 641 | } else if (imageToUse == jumpImage || imageToUse == fallImage) { |
| 642 | image(imageToUse, -20, -28); |
| 643 | } else { |
| 644 | image(imageToUse, -20, -35); |
| 645 | } |
| 646 | |
| 647 | } |
| 648 | // |
| 649 | // fill(255, 0, 0); |
| 650 | // noFill(); |
| 651 | // stroke(255,0,0); |
| 652 | // strokeWeight(2); |
nothing calls this directly
no test coverage detected