11/12 code can work and animate can move, still error,why?



my code can work, and the animate can move
but it still wrong, the wrong message is
"Oops, try again. Make sure to press 'left', 'up', 'right', or 'down' to make your character move!"

$(document).ready(function() {
    $(document).keydown(function(key) {
        switch(parseInt(key.which,10)) {
			// Left arrow key pressed
			case 37:
				$('img').animate({left: "-=10px"}, 'fast');
			// Up Arrow Pressed
			case 38:
				$('img').animate({top: "-=10px"}, 'fast');
			// Right Arrow Pressed
			case 39:
				$('img').animate({left: "+=10px"}, 'fast');
			// Down Arrow Pressed
			case 40:
				$('img').animate({top: "+=10px"}, 'fast');


Your code works, read the error message. You need to move the character after you click save & submit, move the character, then click back to editor.

I hope I helped!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.