Ryan Bever ← Bitsbox Community My feedback 1 result found Use arrow keys 6 votes Vote Vote Vote Vote We're glad you're herePlease sign in to leave feedback Signed in as (Sign out) Close Close 1 vote 2 votes 3 votes Remove votes You have left! (?) (thinking…) 2 comments · General » Feature Requests · Delete… · Admin → How important is this to you? Not at all You must login first! Important You must login first! Critical You must login first! We're glad you're herePlease sign in to leave feedback Signed in as (Sign out) Close Close An error occurred while saving the comment Ryan Bever commented · Apr 13, 2022 · Edit… · Delete… Here is code for arrow keys window.focus() addEventListener('keydown',checkKey) function checkKey(event) { pressed = event.key if (pressed == 's') { mainLoop = setInterval(shipMover,time) } else if (pressed == 'ArrowUp') { ship.rotate(NORTH) } else if (pressed == 'ArrowLeft') { ship.rotate(WEST) } else if (pressed == 'ArrowRight') { ship.rotate(EAST) } else if (pressed == 'ArrowDown') { ship.rotate(SOUTH) } } Save Submitting...
Here is code for arrow keys
window.focus()
addEventListener('keydown',checkKey)
function checkKey(event) {
pressed = event.key
if (pressed == 's') {
mainLoop = setInterval(shipMover,time)
} else if (pressed == 'ArrowUp') {
ship.rotate(NORTH)
} else if (pressed == 'ArrowLeft') {
ship.rotate(WEST)
} else if (pressed == 'ArrowRight') {
ship.rotate(EAST)
} else if (pressed == 'ArrowDown') {
ship.rotate(SOUTH)
}
}