# Tetris <iframe src="https://giphy.com/embed/26uf1VGKiJqZjItXi" width="480" height="384" frameBorder="0" class="giphy-embed" allowFullScreen></iframe> **I decided to recreate a classic game from my youth :girl: :juggling: :video_game:** --- # Issues **Making a game mobile responsive** **Stopping the ArrowUp Key from scrolling when a user rotates a tetris shape** **Fix the functionality of the pause button** --- # What I've learnt **How to add sound effects with DOM manipulation and using `.play()` inside JS functions** **How much Javscript is needed for simple games! :astonished:** --- **I came across a bug :bug: that was to do with `KeyboardEvent.keyCode` used for keydown Event Listeners to move the shapes but it is now deprecated, I found that using `event.key` instead equal to the Key in DOMString fixed this** --- # What to add **Multiple levels, so the tetris shapes start to move faster each time** **Fun, arcade background music** **Adding a preview of next tetris shape for user** **Clearer instructions for the user once the game works on all screens** --- # Demo :juggling: :confetti_ball: :smiley: [Tetris](https://millipede-cpu.github.io/tetris/)
{"metaMigratedAt":"2023-06-16T16:24:51.676Z","metaMigratedFrom":"YAML","title":"Tetris","breaks":false,"slideOptions":"{\"transition\":\"slide\"}","contributors":"[{\"id\":\"ae3532b1-4610-4f25-89ec-b00c8da7a54b\",\"add\":1777,\"del\":527}]"}
    220 views