The instructions state:
Step 78
Inside the callback function, create a new const variable called collisionDetectionRules and assign it an empty array.
Inside that array, add a conditional statement that checks if the player’s y position plus the player’s height is less than or equal to the platform’s y position.
Please assist - I have tried the following:
platforms.forEach((platform) => {
const collisionDetectionRules = [
(player.position.y + player.height) <= platform.position.y ? undefined : undefined
]
});
but just get an error:
Sorry, your code does not pass. You're getting there.
You should have a conditional statement that checks if the player's y position plus the player's height is less than or equal to the platform's y position.
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0
Challenge Information:
Learn Intermediate OOP by Building a Platformer Game - Step 78