Tell us what’s happening:
Hi, I know the correct answer to this step, I’m wondering why wrapping the callback function in keys is arbitrary. Is it just syntax being syntax or is it something necessary for this to work correctly?
Your code so far
if (keys.rightKey.pressed && isCheckpointCollisionDetectionActive) {
platforms.forEach((platform) => platform.position.x -= 5)
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36
Challenge Information:
Learn Intermediate OOP by Building a Platformer Game - Step 79