Super Mario moves, excercise is not complete!


#1


https://www.codecademy.com/en/courses/web-beginner-en-JwhI1/2/3?curriculum_id=50a3fad8c7a770b5fd0007a1#

My Mario moves correctly but the excercise isnt complete and still asks me to move the img

$(document).ready(function() {
    $(document).keydown(function(key) {
        switch(parseInt(key.which,10)) {
            // Left arrow key pressed
            case 65:
                $('img').animate({left: "-=10px"}, 'fast');
                break;
            // Up Arrow Pressed
            case 87:
                // Put our code here
                    $('img').animate({top: "-=10px"},'fast');
                break;
            // Right Arrow Pressed
            case 68:
                $('img').animate({left: "+=10px"},'fast');
                // Put our code here
                break;
            // Down Arrow Pressed
            case 83:
                $('img').animate({top: "+=10px"},'fast');
                // Put our code here
                break;
        }
    });
});


#2

Don't try to use WASD for controlling Mario. The website checks you code by doing its own little checks to verify that when the keys are pressed that Mario actually does something. Change it back to
Case 37
Case 38
Case 39
Case 40

Regards,
Barry Allen


#3

I had it with the arrows but it did the same!


#4

Maybe try putting a default case in your switch statement. Your code is otherwise completely identical to mine, and i have finished jQuery... I don't know why jQuery is doing this to you :pensive:

Regards,
Barry Allen


#5

Maybe ill try from another browser or another computer:P

Thank you!


#6

I had the same problem but found that my code was in fact correct, but had to click on the in full screen in order for the code to operate...


#7

Okay so this tripped me up, I am using a kind of old samsung chromebook, I was using the UK keyboard and couldn't complete this course because this challenge wasn't working until I changed my keyboard to a US, now it all workd