GODRICH
#css-animation#button#loader#transition#scroll#dashboard#ui#design-trends

02Seven pieces and rotation — shapes that turn by matrix multiply

Each piece is a coordinate array; applying the (x,y)→(y,−x) rotation turns it 90 degrees at a time. When it meets a wall, a small post-rotation kick preserves the wrist-feel players expect.

Best forPuzzle games, rotation controls

keydownfillRect
Seven pieces and rotation — shapes that turn by matrix multiply
Open in a new tab

02 Seven pieces and rotation — shapes that turn by matrix multiply — Measured area 8.513% · moving frames 23/23Original by GODRICH · SCSS and React ship in the zip · Tetris JavaScript: Build It in 9 Canvas Steps

The post this demo lives in

Tetris JavaScript: Build It in 9 Canvas Steps - preview of all 9 demosTetris JavaScript: Build It in 9 Canvas StepsFalling blocks, stacking, line clears — computed from rotation matrices and collision checks. A Tetris built in nine ste See all demos in this post

If you like this effect - similar demos