Skip to content

Commit

Permalink
Have an autopilot mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Dzialocha committed Sep 9, 2017
1 parent dd8b983 commit 7c29bce
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions automaton/scripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const view = new View()

const isDebugMode = false
let isPatternFocussed = false
let isMoveLocked = false

// Someone or me entered universe
function onUniverseChange(isMe) {
Expand Down Expand Up @@ -251,6 +252,10 @@ window.addEventListener('keydown', (event) => {
view.focusPattern()
}
break
case KeyCode.CAPS_LOCK:
isMoveLocked = !isMoveLocked
visuals.controls.move({ forward: isMoveLocked })
break
case KeyCode.UP:
case KeyCode.W:
visuals.controls.move({ forward: true })
Expand Down

0 comments on commit 7c29bce

Please sign in to comment.