MCPcopy Create free account
hub / github.com/Code-Bullet/Jump-King / GetImageToUseBasedOnState

Method GetImageToUseBasedOnState

Player.js:802–819  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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) {

Callers 1

ShowMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected