I am sill getting “Sorry, your code does not pass.”
There is clearly something I am doing wrong. Any ideas?
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
const animate = () => {
requestAnimationFrame(animate);
ctx.clearRect(0, 0, canvas.width, canvas.height);
player.update();
if(keys.rightKey.pressed && position.x < proportionalSize(400)) {}
}
// User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (iPad; CPU OS 18_1_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/131.0.6778.154 Mobile/15E148 Safari/604.1
Challenge Information:
Learn Intermediate OOP by Building a Platformer Game - Step 46
Inside the animate function, create an if statement where the condition checks if the right key was pressed and the player’s x position is less than proportionalSize(400).
I feel like I am clearly doing this but I am still being told my code doesn’t work.