11.Filling Out the Cases Is it a bug?


#1

$(document).ready(function() {
$(document).keydown(function(key) {
switch(parseInt(key.which,10)) {
// Left arrow key pressed
case 37:
$('img').animate({left:"-=10px"},'fast');
break;
// Up Arrow Pressed
case 38:
$('img').animate({top:"-=10px"},'fast');
break;
// Right Arrow Pressed
case 39:
$('img').animate({left:"+=10px"},'fast');
break;
// Down Arrow Pressed
case 40:
$('img').animate({top:"+=10px"},'fast');
break;
}
});
});
Oops, try again. Please follow the instructions on the Full Preview page to test your code.

I don't know .......What's wrong?


#2

It means you need to play the game for you to pass, so you need to press up, down, left and right arrows :slight_smile:


#3

Thanks for your help!It works!


#4

awesome!

Happy coding & learning :green_book:


#5