diff --git a/consts.js b/consts.js index 7f09454..14c3ef0 100644 --- a/consts.js +++ b/consts.js @@ -5,7 +5,8 @@ export const BOARD_HEIGHT = 30 export const EVENT_MOVEMENTS = { LEFT: 'ArrowLeft', DOWN: 'ArrowDown', - RIGHT: 'ArrowRight' + RIGHT: 'ArrowRight', + UP: 'ArrowUp' } export const PIECES = [ diff --git a/main.js b/main.js index 46221d4..a2d8985 100644 --- a/main.js +++ b/main.js @@ -265,7 +265,7 @@ document.addEventListener('keydown', event => { } } - if (event.key === 'ArrowUp') { + if (event.key === EVENT_MOVEMENTS.UP) { const rotated = [] // ESTO ES LO MÁS COMPLICADO DE LEJOS