Skip to content

Ryan Bever

My feedback

1 result found

  1. 6 votes
    Vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    You have left! (?) (thinking…)
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    An error occurred while saving the comment
    Ryan Bever commented  · 

    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)
    }
    }

Feedback and Knowledge Base