Learn Intermediate OOP by Building a Platformer Game - Step 79

Tell us what’s happening:

I appear to have followed the instructions from the step correctly but the second test isn’t passing. How is this code wrong?

Your code so far

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

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


    if (keys.rightKey.pressed && isCheckpointCollisionDetectionActive) {
platforms.forEach(i => {
  i.position.x - 5
  })
    }


// User Editable Region
/* file: styles.css */

Your browser information:

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

Challenge Information:

Learn Intermediate OOP by Building a Platformer Game - Step 79

platforms.forEach(i => {
i.position.x -= 5
})
this does not pass either

this is not changing the value of i.position.x, so your function is doing nothing
the instructions say to use the subtraction assignment operator, which is different from the subtraction operator

instead of i, you should use platform as the parameter

1 Like

I did, still does not pass

what is your code now?

nevermind, i can’t believe how strict the parameter had to be all of a sudden

do you want to report a bug for it? you can do so by opening a github issue

1 Like