| 800 | } |
| 801 | |
| 802 | GetImageToUseBasedOnState() { |
| 803 | |
| 804 | |
| 805 | if (this.jumpHeld && this.isOnGround) return squatImage; |
| 806 | if (this.hasFallen) return fallenImage; |
| 807 | if (this.hasBumped) return oofImage; |
| 808 | if (this.currentSpeed.y < 0) return jumpImage; |
| 809 | if (this.isRunning) { |
| 810 | |
| 811 | this.currentRunIndex += 1; |
| 812 | if (this.currentRunIndex >= this.runCycle.length) this.currentRunIndex = 0; |
| 813 | return (this.runCycle[this.currentRunIndex]) |
| 814 | |
| 815 | } |
| 816 | |
| 817 | if (this.isOnGround) return idleImage; |
| 818 | return fallImage; |
| 819 | } |
| 820 | |
| 821 | UpdatePlayerSlide(currentLines) { |
| 822 | if (this.isSlidding) { |