Learn Intermediate OOP by Building a Platformer Game - Step 92

Tell us what’s happening:

Task is to assign sum to player.position.y and gravity to player.velocity.y.What is wrong?

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region


    if (platformDetectionRules.every(rule => rule)) {
player.position.y=platform.position.y +player.height;gravity=player.velocity.y;
    };


// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36 Edg/142.0.0.0

Challenge Information:

Learn Intermediate OOP by Building a Platformer Game - Step 92

So here are the instructions.

Step 92

Inside the body of the if statement, assign platform.position.y + player.height to the player’s y position.

Then, assign gravity to the player’s y velocity.

Can you start by moving each assignment on to its own line.

remember what needs to be on the right and on the left of the assignment operator

1 Like