A dependency-free browser implementation of classic Tetris built as a solo learning project to practice game loops, collision detection, grid math, and Canvas 2D rendering across desktop and mobile.

My Role
Designed and built the complete browser game independently using vanilla JavaScript and Canvas 2D with no external game engine or libraries.
Key Contributions
Built in dependency-free vanilla JavaScript, HTML, and CSS using the HTML5 Canvas 2D API. Models each piece as a center block plus per-rotation offsets, validates every candidate move against board bounds and stacked rows, and scales both game and preview canvases to the viewport.
01
Every move is validated against walls, floor, and stacked blocks. Failed rotations roll back, and wall-adjacent rotations nudge into place.
02
Arrow keys to move, rotate, and soft-drop; swipe gestures on mobile; Space/P or tap to pause and restart.
03
Fall speed increases with cleared lines from 1000ms down to a 200ms cap, with level progression every 10 lines.
04
A second canvas shows the upcoming piece in its own color so players can plan ahead.
05
The game container scales to the viewport, with Level and Score panels and Paused / Game Over overlays.
Build a complete Tetris without a game engine or libraries: seven piece types with multiple rotation states, collision against walls, floor, and stacked blocks, row clearing, and a layout that works on both desktop and mobile.
Modeled each piece as a center block plus offset squares for every rotation state, validating each candidate move against the board before committing it. Invalid rotations roll back, wall-adjacent pieces nudge inward (simple wall kick), completed rows clear and drop rows above, and Canvas 2D redraws smoothly at any viewport size.
Outcome
Shipped a fully playable, dependency-free Tetris game deployed on GitHub Pages that runs smoothly on desktop and mobile browsers.
Takeaways
Building the game loop, grid math, and collision handling from scratch strengthened my grasp of state management with timers and event handlers, while highlighting cleaner future improvements such as matrix-based rotation, hard drop, a ghost piece, and a 7-bag randomizer.
Currently seeking full-time Frontend Developer opportunities. I'm always open to discussing new career opportunities—feel free to reach out!
shahidhasanrumon2@gmail.com