Skip to content

aethrox/2048-neon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

40 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

2048 Neon Game - Cyberpunk Edition

2048 Neon Game Icon

Version License Status

A modern, modular implementation of the classic 2048 game with neon aesthetics, cyberpunk visuals, advanced features, and clean architecture.

๐ŸŽฎ Play Now

โœจ Features

Core Gameplay

  • Classic 2048 Mechanics - Merge tiles to reach 2048 and beyond
  • Cyberpunk Visual Theme - Dark scanned grid background with neon aesthetics
  • Neon Title Animation - Flashing title effect mimicking real neon signs
  • 24 Unique Merge Animations - Random animation effects for each merge
  • Responsive Design - Optimized for desktop and mobile devices
  • Persistent Progress - Game state saved in localStorage

Advanced Features

  • ๐Ÿ‘ป Ghost Mode - Overlay your best game to track progress
  • ๐Ÿ”ฅ Streak System - Bonus points for consecutive merges (3, 5, 7, 10, 15+ streaks)
  • โšก Special Cards - Lightning, Star, and Diamond tiles with unique effects
  • ๐ŸŽฏ Milestones - Bonus points and celebrations for reaching tile values
  • ๐Ÿ’ช Power-Ups - Undo (3 uses), Hint (5 uses), Remove (2 uses)
  • ๐ŸŒ Multi-Language - Full Turkish and English support with first-visit selection
  • ๐Ÿ’ฌ Feedback System - In-game feedback modal with webhook integration

๐Ÿ—๏ธ Modular Architecture

Version 2.4.1+ - Modular structure now active by default:

  • 1,800+ lines of JavaScript โ†’ 16 clean ES6 modules
  • 2,000+ lines of CSS โ†’ 14 organized files
  • Maintainable, Testable, Scalable - Easy to understand and extend
  • Modern Standards - ES6 imports/exports with full module support

JavaScript Structure (16 Modules)

src/js/
โ”œโ”€โ”€ main.js                    # Entry point
โ”œโ”€โ”€ config/                    # Configuration
โ”‚   โ”œโ”€โ”€ translations.js        # TR/EN translations
โ”‚   โ””โ”€โ”€ constants.js           # Game constants
โ”œโ”€โ”€ core/                      # Core game logic
โ”‚   โ”œโ”€โ”€ GameState.js          # State management
โ”‚   โ”œโ”€โ”€ TileManager.js        # Tile creation & rendering
โ”‚   โ”œโ”€โ”€ MovementEngine.js     # Movement logic
โ”‚   โ”œโ”€โ”€ ScoreManager.js       # Score tracking
โ”‚   โ””โ”€โ”€ GameController.js     # Main game loop
โ”œโ”€โ”€ features/                  # Game features
โ”‚   โ”œโ”€โ”€ Feedback.js           # Feedback system
โ”‚   โ”œโ”€โ”€ Streaks.js            # Streak tracking
โ”‚   โ”œโ”€โ”€ Milestones.js         # Milestone rewards
โ”‚   โ”œโ”€โ”€ PowerUps.js           # Power-up system
โ”‚   โ””โ”€โ”€ GhostMode.js          # Ghost overlay
โ””โ”€โ”€ ui/                        # User interface
    โ”œโ”€โ”€ Notifications.js      # Notifications
    โ”œโ”€โ”€ Menu.js               # Hamburger menu
    โ”œโ”€โ”€ Modals.js             # Info & language modals
    โ””โ”€โ”€ EventHandlers.js      # Input events

CSS Structure (14 Files)

src/css/
โ”œโ”€โ”€ main.css                  # Entry point
โ”œโ”€โ”€ animations.css            # Title flash & grid background
โ”œโ”€โ”€ base/                     # Reset & variables
โ”œโ”€โ”€ layout/                   # Grid & container
โ”œโ”€โ”€ components/               # Tiles, buttons, modals
โ”œโ”€โ”€ features/                 # Power-ups, menu
โ””โ”€โ”€ animations/               # 24 merge animations

๐Ÿš€ Quick Start

Prerequisites

  • Modern web browser
  • Local web server required (ES6 modules)

Running Locally

# Clone repository
git clone https://github.com/aethrox/2048-neon.git
cd 2048-neon

# Option 1: Live Server (recommended)
npm install -g live-server
live-server

# Option 2: Python
python -m http.server 8000

# Option 3: Node.js
npm install -g http-server
http-server -p 8000

๐Ÿ“ฑ Controls

Desktop

  • Arrow Keys - Move tiles
  • N - New game
  • G - Toggle ghost mode
  • Menu (โ˜ฐ) - Access all features

Mobile

  • Swipe - Move tiles
  • Tap - Use buttons and menu

๐Ÿ”ง Development

Adding New Features

  1. Create module in appropriate directory
  2. Export using ES6 syntax
  3. Import in main.js
  4. Update documentation

Example:

// src/js/features/NewFeature.js
class NewFeature {
    init() { /* logic */ }
}
export default new NewFeature();

// src/js/main.js
import NewFeature from './features/NewFeature.js';
NewFeature.init();

Module Dependencies

Initialization order in main.js:

  1. Managers (TileManager, ScoreManager, GameController)
  2. Features (GhostMode, PowerUps, Streaks, Milestones)
  3. UI (Menu, Modals, EventHandlers)
  4. Language setup
  5. Game start

๐Ÿ“Š Performance

  • 60 FPS animations
  • <100ms language switching
  • <50ms tile movement response
  • ~200KB total size (uncompressed)
  • GPU-accelerated CSS animations
  • Lightweight background effects - No performance impact

๐ŸŒ Browser Support

โœ… Chrome, Firefox, Safari, Edge (Desktop & Mobile)

๐Ÿ“ License

MIT License - see LICENSE file

๐Ÿ‘ค Author

Aethrox

๐Ÿ“š Documentation

๐Ÿ› Bug Reports

  • Use in-game feedback (โ˜ฐ โ†’ Give Feedback)
  • Or create a GitHub issue

๐Ÿš€ Deployment

# Netlify (netlify.toml configured)
netlify deploy --prod

# Vercel (vercel.json configured)
vercel --prod

๐Ÿ“ˆ Roadmap

  • Sound effects
  • Theme customization
  • Leaderboard system
  • Achievement badges
  • Additional languages

โญ Show Your Support

  • โญ Star the repository
  • ๐Ÿ› Report bugs
  • ๐Ÿ’ก Suggest features
  • โ˜• Buy me a coffee

Version 2.4.1 - Modular Structure Active
Made with โšก neon lights, ๐ŸŒŒ cyberpunk aesthetics, and ๐Ÿ—๏ธ modern architecture

About

A modern, modular implementation of the classic 2048 game with neon aesthetics, advanced features, and clean architecture.

Topics

Resources

License

Stars

Watchers

Forks

Contributors