Skip to content

Commit

Permalink
feat: disable the ability to move the game using the keyboard
Browse files Browse the repository at this point in the history
  • Loading branch information
WhiteMinds committed Feb 18, 2024
1 parent 9abe913 commit 8589bcb
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
14 changes: 0 additions & 14 deletions src/components/ConwayGameOfLife/useGameKeybindings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,7 @@ export function useGameKeyboardHandler(
const ctl = controllerRef.current
if (ctl == null) return

const stepDistance = 24

switch (e.code) {
case 'ArrowUp':
ctl.addCameraOffset(0, -stepDistance)
break
case 'ArrowRight':
ctl.addCameraOffset(stepDistance, 0)
break
case 'ArrowDown':
ctl.addCameraOffset(0, stepDistance)
break
case 'ArrowLeft':
ctl.addCameraOffset(-stepDistance, 0)
break
case 'Equal':
ctl.zoomIn()
break
Expand Down
1 change: 0 additions & 1 deletion src/pages/home/SlideFooter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ const InfoDialog: FC = () => {
const mouseBindings = [{ key: 'Left button', bind: 'Create / Delete cells' }]

const keyboardBindings = [
{ key: 'Arrow keys', bind: 'Move around' },
{ key: '+, -', bind: 'Zoom In and out' },
{ key: 'Space', bind: 'One generation forward' },
{ key: 'Tab', bind: 'Many generation forward' },
Expand Down

0 comments on commit 8589bcb

Please sign in to comment.