<script>
var personX = 18;
var personY = 13;
function processArrowKeys(E) {
if (E.keyCode == 37 || E.keyCode == 38 || E.keyCode == 39 || E.keyCode==40) {
E.preventDefault();
}
if (E.keyCode == 37) {
if (currentterrain[personX - 1][personY] == 0 || currentterrain[personX - 1][personY] == 1 || currentterrain[personX - 1][personY] == 3) {
personX--;
}
}
if (E.keyCode == 39) {
if (currentterrain[personX + 1][personY] == 0 || currentterrain[personX + 1][personY] == 1 || currentterrain[personX + 1][personY] == 3) {
personX++;
}
}
if (E.keyCode == 38) {
for (i = 0; i < 3; i++) {
if (currentterrain[personX][personY - 1] == 0 || currentterrain[personX][personY - 1] == 1 || currentterrain[personX][personY - 1] == 3) {
personY--;
}
}
}
}
</script>
<body onkeydown="processArrowKeys(event)">
The IE debugger says that it expects an object and brakes on "handleArrowKeys(event)".
This works in FF and Chrome
I don't know why this fails, but it does.