I have been playing around with the codes and find a way to do that, by modifying the file src/views/map/controls.js. Do the following:
// window.addEventListener('keydown', ({ keyCode }) => {
// switch (keyCode) {
// case 65:
// case 81:
// case 37: { handleMove('LEFT');handleMove('UP');return }
// case 87:
// case 90:
// case 38: { return handleMove('UP') }
// case 68:
// case 39: { return handleMove('RIGHT') }
// case 83:
// case 40: { return handleMove('DOWN') }
// default: return undefined
// }
// })
var map = [];
onkeydown = onkeyup = function(e){
var direction = {
'37': 'LEFT',
'38': 'UP',
'39': 'RIGHT',
'40': 'DOWN'};
e = e || event;
map[e.keyCode] = e.type == 'keydown';
for(var i = 37;i <= 40;i++){
if(map[i]){
handleMove(direction[i]);
}
}
}
I have been playing around with the codes and find a way to do that, by modifying the file src/views/map/controls.js. Do the following: // window.addEventListener('keydown', ({ keyCode }) => { // switch (keyCode) { // case 65: // case 81: // case 37: { handleMove('LEFT');handleMove('UP');return } // case 87: // case 90: // case 38: { return handleMove('UP') } // case 68: // case 39: { return handleMove('RIGHT') } // case 83: // case 40: { return handleMove('DOWN') } // default: return undefined // } // })
var map = []; onkeydown = onkeyup = function(e){ var direction = { '37': 'LEFT', '38': 'UP', '39': 'RIGHT', '40': 'DOWN'}; e = e || event; map[e.keyCode] = e.type == 'keydown'; for(var i = 37;i <= 40;i++){ if(map[i]){ handleMove(direction[i]); } } }
hope it helps!