lo logré:
Código HTML:
Ver original <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
*{
margin:0px;
padding:0px;
}
<script type="text/javascript">
function move(evt) {
evt = evt || window.event;
var charCode = evt.keyCode || evt.which;
charCode = parseInt(charCode);
if(charCode != 37 && charCode != 38 && charCode != 39 && charCode != 40){
return 1;
}
var player = document.getElementById("player");
var constant = 32;
var posx = parseInt(player.style.left.replace("px", ""));
var posy = parseInt(player.style.top.replace("px", ""));
if(charCode == 37){ posx = posx-constant; if(posx<=0){ posx=0; }}
else if(charCode == 38){ posy=posy-constant; if(posy <=0){ posy=0; }}
else if(charCode == 39){ posx=posx+constant; if(posx >=constant*10){posx=constant*10; }}
else if(charCode == 40){ posy=posy+constant; if(posy >=constant*10){posy=constant*10; }}
else{ return 1; }
player.style.left = posx+"px";
player.style.top = posy+"px";
player.src = "imagen/elf_d.png";
}
<div style="background-image:url('imagen/arena.bmp'); margin:100px 0px 0px 100px; width:350px; height:350px; border-width:1px; border-style:solid; border-color:#000000;"> <div onkeyup="move(event);" contenteditable="true" id="player" style="color:rgba(255,255,255,0); width:32px; height:32px; background-image:url('imagen/elf_d.png'); left:0px; top:0px; position:relative;"></div>
saludos!!