GithubHelp home page GithubHelp logo

2048's Introduction

2048 Game

This is a simple implementation of the popular 2048 game using HTML, CSS, and JavaScript. The game is designed to be played in a web browser and is a fun and challenging puzzle game where the goal is to combine tiles to reach the 2048 tile.

How to Play

  1. Accessing the Game: You can play the game by opening the index.html file in your web browser. No additional installation or setup is required.

  2. Game Rules: The game is played on a 4x4 grid. You can use your arrow keys (up, down, left, right) to move the tiles. When two tiles with the same number collide while moving, they merge into one tile with the sum of their values. The goal is to create a tile with the value of 2048.

  3. Scoring: Your score is displayed in the top-left corner. Each time two tiles merge, your score increases by the value of the merged tiles.

  4. Winning: The game is won when a tile with a value of 2048 is created. You can continue playing after winning to achieve a higher score.

  5. Losing: The game is lost when the grid is full, and no more moves can be made.

  6. Restart: You can restart the game at any time by clicking the "New Game" button.

Files and Directory Structure

  • index.html: The main HTML file that contains the game board and user interface.
  • 2048.css: The CSS file that defines the game's styling and layout.
  • 2048.js: The JavaScript file that contains the game logic and functionality.
  • images/: This directory contains the images used for tiles.

Customization

You can customize the game by modifying the CSS and JavaScript files. Here are some things you can do:

  • Styling: You can change the colors, fonts, and overall styling of the game by editing the 2048.css file.

  • Game Logic: If you want to modify the game rules or add new features, you can do so by editing the 2048.js file. Be sure to have a good understanding of JavaScript and the existing code before making significant changes.

  • Grid Size: If you want to change the grid size, you'll need to make adjustments to the HTML structure and CSS to accommodate a different grid size.

Credits

This game is based on the original 2048 game created by Gabriele Cirulli. You can find the original game and its source code here: 2048 Game by Gabriele Cirulli.

License

This project is open-source and available under the MIT License. You are free to use, modify, and distribute the code as long as you include the appropriate attribution and adhere to the terms of the MIT License.


Have fun playing 2048! If you have any questions or feedback, please feel free to open an issue or contribute to this repository. Enjoy the game!

2048's People

Contributors

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