// Keyboard move controls
$(document).keyup(function(e) {
switch (e.which) {
// Move Buttons (Keyboard Down)
case 40:
captainPlanet.animate({ top: "+=200px" }, "normal");
break;
// Move Buttons (Keyboard Right)
case 39:
captainPlanet.animate({ left: "+=200px" }, "normal");
break;
// Move Buttons (Keyboard Up)
case 38:
captainPlanet.animate({ top: "-=200px" }, "normal");
break;
// Move Buttons (Keyboard Left)
case 37:
captainPlanet.animate({ left: "-=200px" }, "normal");
break;
default:
break;
}
});