Learn Intermediate OOP by Building a Platformer Game - Step 103

Tell us what’s happening:

I feel like I am doing exactly what I am being asked to do. What am I doing wrong?

Here’s the prompt by the way:

Step 103

Inside your condition, add a forEach loop to iterate through the checkpoints array. Use checkpoint as the parameter name for the callback function.

Inside the loop, use the subtraction assignment operator to subtract 5 from the checkpoints’s x position.

Your code so far

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

/* file: styles.css */

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

checkpoints.forEach((checkpoint) => checkpoint.position.x -= 5)

// 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/131.0.0.0 Safari/537.36 Edg/131.0.0.0

Challenge Information:

Learn Intermediate OOP by Building a Platformer Game - Step 103

Welcome to the forum @PeterOhneT

Try using curly braces around the expression.

Happy coding

I couldn’t see the solution, because it was so darn obvious… xD

Thank you very much :))

1 Like