A modern, AI-powered Tetris game with a stunning design and intelligent gameplay. Built with JavaScript, HTML5 Canvas, and a touch of creativity!
Get Started • Features • File Structure • Contributing • Credits
Welcome to The Tetris AI, a beautifully redesigned Tetris game that combines classic gameplay with modern aesthetics and AI-powered intelligence! Watch as the AI plays Tetris with precision, or take control yourself in this visually stunning experience. With vibrant colors, gradient effects, and a sleek interface, this project brings Tetris into the 21st century.
Built using JavaScript, HTML5 Canvas, and CSS, this project features a responsive design, enhanced piece rendering, and a clean landing page to welcome players. Whether you're a gamer, a developer, or an AI enthusiast, The Tetris AI offers something for everyone.
- AI-Powered Gameplay : Let the AI take control and play Tetris with optimal strategies.
- Gorgeous Design : Vibrant colors, gradient effects, borders, and shadows make the pieces pop.
- Responsive Layout : Play on any device, from desktops to mobile phones.
- Modern Landing Page : A sleek landing page with a centered logo, start button, and GitHub link.
- Enhanced Pieces : Pieces feature gradients, borders, and shadows for a 3D, floating effect.
- Smooth Animations : Fluid piece movements and rotations for an immersive experience.
- Source Code Access : Explore the code and contribute via the GitHub repository.
- A modern web browser (Chrome, Firefox, Safari, etc.)
- A local server (e.g.,
live-serverfor VS Code, or any HTTP server) to run the game locally.
- Clone the Repository:
git clone https://github.com/dkconnect/ai-tetris.git cd ai-tetris - Set Up a Local Server:
- If you have live-server installed:
live-server
- Alternatively, use Python’s HTTP server:
python -m http.server 8000
- Or use any other local server of your choice.
- If you have live-server installed:
- Open the Game:
- Navigate to
http://localhost:8000(or the port your server uses) in your browser. - Click "Start the AI Tetris" to begin!
- Navigate to
- The index.html page displays the Tetris AI logo, a "Start the AI Tetris" button, and a GitHub icon linking to the source code.
- Click the "Start the AI Tetris" button to proceed to the game.
- The game.html page features the Tetris grid, a "Lines Cleared" counter, a "Next Piece" preview, and buttons to "Play AI" or "Reset" the game.
- Click "Play AI" to watch the AI play Tetris, or use keyboard controls (if implemented) to play manually.
- The pieces are rendered with stunning gradients, borders, and shadows for a modern look.
- Check out the GitHub repository linked on the landing page to dive into the source code and contribute!
Here’s an overview of the project’s file structure:
ai-tetris/
├── images/
│ ├── images/content-removebg-preview.png
├── js/
│ ├── ai.js
│ ├── game_manager.js
│ ├── grid.js
│ ├── piece.js
│ ├── polyfill.js
│ ├── random_piece_generator.js
│ ├── stopwatch.js
│ ├── timer.js
│ └── tuner.js
├── style/
│ └── main.css
├── game.html
├── index.html
└── README.md
Contributions are welcome! Whether you want to fix a bug, add a feature, or improve the design, we’d love to have your input.
- Fork the Repository: Click the "Fork" button on the GitHub repository page.
- Clone Your Fork:
git clone https://github.com/your-username/ai-tetris.git cd ai-tetris - Create a Branch:
git checkout -b feature/your-feature-name
- Make Changes: Edit the code, test your changes, and ensure everything works.
- Commit and Push:
git add . git commit -m "Add your feature description" git push origin feature/your-feature-name
- Create a Pull Request: Go to the original repository on GitHub and create a pull request from your branch.
- Creator: Dibyanshu
- Design Enhancements: Modernized by Grok (xAI) with a stunning UI, vibrant colors, and enhanced piece rendering.
- Libraries Used:
- Font Awesome – For the GitHub icon on the landing page.
- Google Fonts – For the Poppins font used in the design.
This project is licensed under the MIT License. See the LICENSE file for details.
Built with ❤️ by Dibyanshu
Let’s play Tetris like never before!