https://github.com/ayuxi03/2048-game
A clone of the viral and addictive 2048 webgame
https://github.com/ayuxi03/2048-game
2048-clone 2048-game css3 html-css-javascript html5 javascript sliding-puzzle-game webgame
Last synced: 8 months ago
JSON representation
A clone of the viral and addictive 2048 webgame
- Host: GitHub
- URL: https://github.com/ayuxi03/2048-game
- Owner: ayuxi03
- Created: 2024-07-20T22:14:00.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-22T22:05:17.000Z (over 1 year ago)
- Last Synced: 2024-07-24T01:57:31.408Z (over 1 year ago)
- Topics: 2048-clone, 2048-game, css3, html-css-javascript, html5, javascript, sliding-puzzle-game, webgame
- Language: JavaScript
- Homepage: https://ayuxi03.github.io/2048-game/
- Size: 18.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 2048 Web Game
This repository contains a web-based implementation of the popular game 2048. The game is built using HTML, CSS, and JavaScript and offers a fun and interactive way to play this classic puzzle game directly in your browser.
## Overview
The 2048 game is a sliding puzzle game where the goal is to combine tiles with the same number to reach the 2048 tile. The game ends when no more valid moves are possible. This repository includes everything needed to play the game directly in your web browser.
## Features
- **Classic 2048 Gameplay:** Slide tiles to combine them and achieve the 2048 tile.
- **Responsive Design:** The game adjusts to different screen sizes.
- **Score Tracking:** Keeps track of your current score and the highest score achieved.
- **New Game Button:** Allows you to restart the game at any time.
## Getting Started
### Prerequisites
To run this game locally, you will need a web browser. No additional software or server is required.
### Installation
1. **Clone the Repository:**
```bash
git clone https://github.com/ayuxi03/2048-game.git
2. **Open the Game:**
Simply open the **`index.html`** file in your web browser:
```bash
open index.html
### Project Structure
- **`index.html`:** The main HTML file that sets up the game structure.
- **`styles.css`:** Contains the styling for the game elements and layout.
- **`script.js`:** The JavaScript code that handles the game logic and interactions.
- **`colors.js`:** Defines the color scheme for the game tiles based on their value.
### How to Play
1. **Start the Game:** Refresh the page or click the "New Game" button to start a new game.
2. **Move Tiles:** Use the arrow keys on your keyboard to move tiles in the desired direction (Up, Down, Left, Right).
3. **Combine Tiles:** Tiles with the same number will combine when they collide, doubling their value.
4. **Achieve 2048:** The goal is to combine tiles to reach the 2048 tile.
5. **Score:** The score updates as you combine tiles. Try to beat your high score!
### Key Features
- **Responsive Layout:** The game is designed to be responsive and will adapt to various screen sizes.
- **Custom Tile Colors:** Tiles change color based on their value, with colors defined in colors.js.
- **Tile Animations:** Smooth transitions and animations enhance the gaming experience.
### Acknowledgements
The game design is inspired by the original 2048 game created by Gabriele Cirulli.
### Contributing
Contributions to the project are welcome! If you have suggestions or find any issues, please open an issue or submit a pull request.