Browser-based game built with Javascript and HTML canvas. Goal: Slam down 20 rows as fast as you can.
Live: http://bbqlettuce.github.io/tetris
- All gameplay rendered in HTML Canvas, with only the moving piece getting redrawn to keep calls to the canvas at a minimum.
- Simple controls for casual players who want to use the directional pad. Supports only one direction of rotation. Not recommended for those aiming to reach the leaderboard!
- Classic controls mimic classic Gameboy controls:
- UP triggers fast-drop
- J/K (like the traditional A/B buttons) enable omnidirectional rotation, allowing players to minimize their keypresses to get pieces in the exact positions that they want.
- Press the appropriate button to stash the current block to be used later!
- Saved block can only be swapped once; you can't stall the game by repeatedly stashing.
- Uses the timer.jquery plugin to track times; pause and restart events in the game trigger those respective actions on the timer
- Leaderboard lives on a Heroku app that holds onto a table of names and times.
- Page makes AJAX requests to the database to retrieve and update scores.
- board
- cells
- blocks
- basic blocks
- block inheritance
- game
- score view
- next block view
- block saving
- timer, runs while game is in progress, paused when game paused
- win condition at 20 rows; lose if top out
- leaderboard tracks best times
- ghost block
- better randomization through block buckets
- user interface:
- make instructions pop up more, force people to pick a set of controls
- make score submitting more visually engaging