Giter VIP home page Giter VIP logo

2048's Introduction

2048 Game

Overview

This is a Python implementation of the popular 2048 game. The goal of the game is to achieve highest score and tile possible with 0 undo. You can use the undo for practice.

Screenshot

Installation

  1. Install the required dependencies:
    pip install numpy pygame

How to Play

Controls

  • Arrow Keys: Move the tiles in the respective direction (left, right, up, down).
  • Spacebar: Undo the last move.
  • R Key: Reset the game.
  • Escape Key: Quit the game.

Objective

Slide the tiles on the board to combine them and create a tile with the number 2048. The advanced players can keep going for 4096 and 8192. The game ends when no more moves are possible.

Rules

  • Adding Tiles: Each move adds a new tile (2 or 4) to the board at a random empty position.
  • Combining Tiles: When two tiles with the same number collide while moving, they merge into a tile with the total of their values.
  • Undo: You can undo the last move by pressing the Spacebar.

Running the Game

  1. Execute the script:

    python game_engine.py
  2. Enjoy the game!

Features

  • Scoring System: Track your score as you combine tiles.
  • Undo Functionality: Undo your last move with the Spacebar.
  • Reset Functionality: Reset the game with the R key.
  • Game Over Detection: The game will notify you when no more moves are possible.

2048's People

Contributors

alanzty avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.