A fully functional Tetris clone built from scratch in under 60 minutes.
This project was created as a preparatory exercise for the Advanced Programming exam at the University of Pisa (MSc in Computer Science / ICT Solution Architect), taught by Prof. Antonio Cisternino.
The goal was not to create a polished product, but to challenge the capabilities of SolidJS's fine-grained reactivity and to test rapid prototyping skills under time constraints.
- Constraint: ~1 Hour of coding time.
- Goal: Implement core mechanics (Grid, Tetrominos, Gravity, Collision, Line Clearing).
- Stack: SolidJS + TypeScript.
Unlike React, SolidJS does not use a Virtual DOM. Instead, it compiles its templates to real DOM nodes and updates them with fine-grained reactions. For a game loop like Tetris, this ensures high performance and direct state management without unnecessary re-renders.
Despite the short timeframe, the core mechanics are operational:
- ✅ Game Loop: Managed via
requestAnimationFrameorsetIntervalfor gravity. - ✅ Collision Detection: Wall kicks and floor collision logic.
- ✅ State Management: Using SolidJS
SignalsandStoresfor the grid and active piece. - ✅ Rendering: Reactive rendering of the 10x20 grid.
This project uses Vite for a lightning-fast development server.
git clone [https://github.com/fabiopsh/tetris-on-solidjs.git](https://github.com/fabiopsh/tetris-on-solidjs.git)
cd tetris-on-solidjs
npm installnpm run devnpm run build