A modern take on the classic Tetris game, built with TypeScript and HTML5 Canvas. This project serves as a foundation for a roguelike Tetris game, combining the familiar block-dropping mechanics with roguelike elements.
You can play the game online at: https://albl42.github.io/TetrisOdyssey
- Classic Tetris gameplay mechanics
- Seven standard Tetris pieces (I, J, L, O, S, T, Z)
- Smooth piece movement and rotation
- Line clearing and scoring system
- Game over detection
- Modern, clean UI
- Special pieces with unique abilities
- Power-ups and special effects
- Different board layouts and challenges
- Progressive difficulty system
- Unique game modes
- TypeScript
- HTML5 Canvas
- Modern JavaScript (ES2020)
- Node.js and npm for development
- GitHub Actions for CI/CD
- GitHub Pages for hosting
TetrisOdyssey/
├── src/ # TypeScript source files
│ ├── Game.ts # Main game logic
│ ├── Board.ts # Game board management
│ └── tetromino/
│ ├── Tetromino.ts # Tetris piece implementation
│ └── TetrominoType.ts # Tetris piece type definitions
├── dist/ # Compiled JavaScript files
├── styles.css # Game styling
├── index.html # Main HTML file
├── tsconfig.json # TypeScript configuration
└── package.json # Project dependencies
- Node.js (v14 or higher)
- npm (comes with Node.js)
-
Clone the repository:
git clone [repository-url] cd TetrisOdyssey
-
Install dependencies:
npm install
-
Build the project:
npm run build
-
Start the development server:
npm start
-
Open your browser and navigate to
http://localhost:3000
- Left/Right Arrow Keys: Move piece horizontally
- Up Arrow: Rotate piece
- Down Arrow: Soft drop (accelerate piece downward)
- The piece will automatically fall every second
npm run build
: Compiles TypeScript files to JavaScriptnpm start
: Starts the development servernpm run watch
: Watches for changes and recompiles automatically
- Create new TypeScript files in the
src
directory - Import and use them in existing files
- Run
npm run build
to compile - Test your changes in the browser
The game is automatically deployed to GitHub Pages when changes are pushed to the main branch. The deployment process:
- Builds the project using TypeScript
- Uploads the built files to GitHub Pages
- Makes the game available at
https://albl42.github.io/TetrisOdyssey
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by the classic Tetris game
- Built with basic web technologies
- Special thanks to all contributors and testers