nighthawkcoders / platformer3x

JavaScript Gaming Project, Student / Teacher cooperative development
https://nighthawkcoders.github.io/platformer3x/
Apache License 2.0
1 stars 6 forks source link

Fix going through block on Quidditch level #63

Closed kaylale124 closed 5 months ago

kaylale124 commented 5 months ago

Walking through the platform has been fixed

Code Changed:

case "jumpPlatform":
                // Player is on top of the jump platform
                if (this.collisionData.touchPoints.this.right) {
                    this.state.movement = { up: false, down: false, left: true, right: false, falling: false};
                    this.y -= 4;
                    // Player is touching the wall with left side
                } else if (this.collisionData.touchPoints.this.left) {
                    this.state.movement = { up: false, down: false, left: false, right: true, falling: false};
                    this.y -= 4;
                } else if (this.collisionData.touchPoints.this.onTopofPlatform) {
                    this.state.movement = { up: false, down: false, left: true, right: true, falling: false};
                    this.gravityEnabled = false;
                }