Skip to content

Latest commit

 

History

History

2048

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

2048 Game 🎮

🎯 Objective

Welcome to 2048, a classic puzzle game built using Python's pygame library. The objective of the game is to slide numbered tiles on a 4x4 grid to combine them and create a tile with the number 2048.


Prerequisite: Install pygame

Before running the code, you need to install the pygame library by running the following command:

pip install pygame

🚀 How to Play:

  • Use the arrow keys (←, →, ↑, ↓) to slide the tiles.
  • Tiles with the same number will merge into one when they collide.
  • After each move, a new tile (2 or 4) will randomly appear on the grid.
  • Your goal is to combine the tiles to form the 2048 tile.
  • The game ends if no more moves are possible (Game Over) or if you successfully form the 2048 tile (You Win!).

🔧 How to Run

  1. Clone the repository and navigate to the project folder:

    git clone <repository-url>
    cd <project-folder>
  2. Run the program:

    python3 2048.py
  3. Enjoy playing the 2048 game!

🛠 Features

  • Dynamic 4x4 grid with colorful tiles.
  • Game Over detection when no moves remain.
  • Winning condition when the player reaches 2048.
  • Smooth sliding animations and random tile generation.

🎉 Have Fun! Try to achieve the elusive 2048 tile and challenge yourself to beat the game!