Skip to content

dkconnect/ai-tetris

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tetris AI Screenshot

The Tetris AI

A modern, AI-powered Tetris game with a stunning design and intelligent gameplay. Built with JavaScript, HTML5 Canvas, and a touch of creativity!

Version JavaScript HTML5 Canvas

Get StartedFeaturesFile StructureContributingCredits


Introduction

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.


Features

  • 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.

Get Started

Prerequisites

  • A modern web browser (Chrome, Firefox, Safari, etc.)
  • A local server (e.g., live-server for VS Code, or any HTTP server) to run the game locally.

Installation

  1. Clone the Repository:
    git clone https://github.com/dkconnect/ai-tetris.git
    cd ai-tetris
  2. 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.
  3. Open the Game:
    • Navigate to http://localhost:8000 (or the port your server uses) in your browser.
    • Click "Start the AI Tetris" to begin!

Usage

Landing Page

  • 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.

Game Page

  • 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.

Explore the Code

  • Check out the GitHub repository linked on the landing page to dive into the source code and contribute!

File Structure

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            

Contributing

Contributions are welcome! Whether you want to fix a bug, add a feature, or improve the design, we’d love to have your input.

Steps to Contribute:

  1. Fork the Repository: Click the "Fork" button on the GitHub repository page.
  2. Clone Your Fork:
    git clone https://github.com/your-username/ai-tetris.git
    cd ai-tetris
  3. Create a Branch:
    git checkout -b feature/your-feature-name
  4. Make Changes: Edit the code, test your changes, and ensure everything works.
  5. Commit and Push:
    git add .
    git commit -m "Add your feature description"
    git push origin feature/your-feature-name
  6. Create a Pull Request: Go to the original repository on GitHub and create a pull request from your branch.

Credits

  • 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.

License

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!

About

Tetris Game using AI. Made with AI to play with AI.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published