# 2048-zh **Repository Path**: jun-wan/2048-zh ## Basic Information - **Project Name**: 2048-zh - **Description**: 基于原版2048的中文多语言版本,支持中英文切换,默认中文界面,可在设置中切换语言。保持原版游戏的所有特性,适合中文用户使用。 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2025-08-12 - **Last Updated**: 2025-08-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: HTML, CSS, JavaScript ## README # 2048 中文版 / 2048 Chinese Version [![HTML5](https://img.shields.io/badge/HTML5-5.0+-orange.svg)](https://developer.mozilla.org/zh-CN/docs/Web/HTML) [![CSS3](https://img.shields.io/badge/CSS3-3.0+-blue.svg)](https://developer.mozilla.org/zh-CN/docs/Web/CSS) [![JavaScript](https://img.shields.io/badge/JavaScript-ES5+-yellow.svg)](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript) [![License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE) 基于 [gabrielecirulli/2048](https://github.com/gabrielecirulli/2048) 二次开发的中文版本。 Based on [gabrielecirulli/2048](https://github.com/gabrielecirulli/2048) with Chinese localization. --- ## 🚀 快速导航 / Quick Navigation **[中文](#-中文版本) | [English](#-english-version)** ## 🎮 在线体验 / Online Demo ### 🌐 当前可用 - **[原版英文版本](https://play2048.co/)** - 原项目官方在线体验(英文界面) - **[中文版本在线体验](https://tvemixy.fun/2048/)** - 部署在个人服务器上的中文版本(服务器有效期至2026年) --- ## 🇨🇳 中文版本 ### 🎮 游戏特色 - **默认中文界面** - 游戏启动时自动显示中文 - **多语言支持** - 可在设置中切换中英文 - **语言记忆** - 自动保存用户语言选择 - **完整功能** - 保持原版游戏的所有特性 ### 🚀 快速开始 #### 方法1: 直接打开(推荐) - 直接双击 `index.html` 文件 - 在浏览器中打开即可开始游戏 #### 方法2: 使用Python本地服务器 ```bash # 在项目目录下运行 python -m http.server 8000 # 然后在浏览器中访问 http://localhost:8000 ``` #### 方法3: 使用Node.js ```bash # 安装http-server npm install -g http-server # 在项目目录下运行 http-server # 访问显示的地址即可 ``` ### 🎯 游戏玩法 1. 使用**方向键**移动方块 2. 相同数字的方块相撞时会**合并** 3. 每次移动后随机出现新数字(2或4) 4. 目标是获得**2048**! ### ⚙️ 语言设置 1. 点击游戏界面右上角的"**设置**"按钮 2. 在设置弹窗中选择语言(中文/English) 3. 语言切换立即生效,无需刷新页面 ### 📱 兼容性 - ✅ Chrome, Firefox, Safari, Edge - ✅ iOS Safari, Android Chrome - ✅ 支持触摸和键盘操作 - ✅ 响应式设计,完美适配移动端 ### 🛠️ 技术栈 - **前端**: HTML5, CSS3, JavaScript (ES5) - **架构**: 模块化设计,支持多语言 - **存储**: 本地存储保存游戏进度和语言设置 - **兼容**: 支持旧版浏览器(通过polyfill) ### 📁 项目结构 ``` 2048-master/ ├── index.html # 主页面 ├── README.md # 项目说明 ├── LICENSE # MIT许可证 ├── .gitignore # Git忽略文件 ├── js/ # JavaScript文件 │ ├── core/ # 游戏核心逻辑 │ │ ├── game_manager.js # 游戏管理器 │ │ ├── grid.js # 网格系统 │ │ └── tile.js # 瓦片逻辑 │ ├── ui/ # 界面相关 │ │ ├── html_actuator.js # HTML渲染器 │ │ ├── keyboard_input_manager.js # 键盘输入处理 │ │ ├── local_storage_manager.js # 本地存储管理 │ │ └── settings_manager.js # 设置管理器 │ ├── config/ # 配置文件 │ │ └── languages.js # 语言配置 │ ├── polyfills/ # 兼容性支持 │ │ ├── animframe_polyfill.js │ │ ├── bind_polyfill.js │ │ └── classlist_polyfill.js │ └── application.js # 应用入口 ├── style/ # 样式文件 │ └── main.css # 主样式 └── assets/ # 资源文件 ├── icons/ # 图标文件 │ ├── favicon.ico │ └── apple-touch-*.png └── fonts/ # 字体文件 ├── clear-sans.css └── ClearSans-*.webfont.* ``` ### 📄 许可证 本项目基于 [MIT 许可证](LICENSE) 开源。 原项目由 [Gabriele Cirulli](http://gabrielecirulli.com) 创建。 ### 🤝 贡献 欢迎提交改进和修复!请: 1. Fork 这个仓库 2. 创建功能分支 3. 提交你的更改 4. 发起 Pull Request --- ## 🇺🇸 English Version **[返回中文版本](#-中文版本) | [Back to Chinese Version](#-中文版本)** ### 🎮 Online Demo #### 🌐 Currently Available - **[Original English Version](https://play2048.co/)** - Official online demo (English interface) - **[Chinese Version Online Demo](https://tvemixy.fun/2048/)** - Chinese version deployed on personal server (server valid until 2026) ### 🎮 Game Features - **Default Chinese Interface** - Game starts in Chinese automatically - **Multi-language Support** - Switch between Chinese and English in settings - **Language Memory** - Automatically saves user language preference - **Full Features** - Maintains all original game features ### 🚀 Quick Start #### Method 1: Direct Open (Recommended) - Double-click `index.html` file - Open in browser to start the game #### Method 2: Python Local Server ```bash # Run in project directory python -m http.server 8000 # Then visit in browser http://localhost:8000 ``` #### Method 3: Node.js ```bash # Install http-server npm install -g http-server # Run in project directory http-server # Visit the displayed address ``` ### 🎯 How to Play 1. Use **arrow keys** to move tiles 2. Same number tiles **merge** when they collide 3. New numbers (2 or 4) appear randomly after each move 4. Goal is to get **2048**! ### ⚙️ Language Settings 1. Click the "**Settings**" button in the top right 2. Select language (中文/English) in settings popup 3. Language switches immediately without page refresh ### 📱 Compatibility - ✅ Chrome, Firefox, Safari, Edge - ✅ iOS Safari, Android Chrome - ✅ Supports touch and keyboard operations - ✅ Responsive design, perfect mobile adaptation ### 🛠️ Tech Stack - **Frontend**: HTML5, CSS3, JavaScript (ES5) - **Architecture**: Modular design with multi-language support - **Storage**: Local storage for game progress and language settings - **Compatibility**: Supports legacy browsers (via polyfills) ### 📁 Project Structure ``` 2048-master/ ├── index.html # Main page ├── README.md # Project description ├── LICENSE # MIT License ├── .gitignore # Git ignore file ├── js/ # JavaScript files │ ├── core/ # Game core logic │ │ ├── game_manager.js # Game manager │ │ ├── grid.js # Grid system │ │ └── tile.js # Tile logic │ ├── ui/ # UI related │ │ ├── html_actuator.js # HTML renderer │ │ ├── keyboard_input_manager.js # Keyboard input handler │ │ ├── local_storage_manager.js # Local storage manager │ │ └── settings_manager.js # Settings manager │ ├── config/ # Configuration │ │ └── languages.js # Language config │ ├── polyfills/ # Compatibility support │ │ ├── animframe_polyfill.js │ │ ├── bind_polyfill.js │ │ └── classlist_polyfill.js │ └── application.js # Application entry ├── style/ # Style files │ └── main.css # Main styles └── assets/ # Asset files ├── icons/ # Icon files │ ├── favicon.ico │ └── apple-touch-*.png └── fonts/ # Font files ├── clear-sans.css └── ClearSans-*.webfont.* ``` ### 📄 License This project is open source under the [MIT License](LICENSE). Original project created by [Gabriele Cirulli](http://gabrielecirulli.com). ### 🤝 Contributing Welcome contributions and fixes! Please: 1. Fork this repository 2. Create a feature branch 3. Commit your changes 4. Submit a Pull Request --- ## 🎉 享受游戏吧! / Enjoy the game! *基于原项目: [gabrielecirulli/2048](https://github.com/gabrielecirulli/2048)* *Based on: [gabrielecirulli/2048](https://github.com/gabrielecirulli/2048)*