I'm making a simple game in JQUERY and I want to know how to make a simple 4 way movement (up, down, left, right) with JQUERY I have this:
html
<div id="dot"></dot> <!-- the character -->
jquery
$(document).keydown(function(e) {
if(e.which == 37) {
} else if (e.which == 38){
} else if (e.which == 39){
} else if (e.which == 40){
}
});
EDIT: The movement is to simulate the "Worlds hardest game" which you can find here: http://www.el-juego-mas-dificil-del-mundo.com/. I need it to be soft (I don't know how to explain it xD)