Back to battles
mediumupcoming

2048 Game

The classic 2048 sliding tile puzzle with animations and game modes.

30 min limit0 participants
javascriptcssgames
PRD
# 2048 Game PRD

## Overview
Build the classic 2048 sliding tile puzzle game with smooth animations, touch controls, score tracking, and game state persistence.

## Requirements
- 4x4 grid as the playing field
- Spawn a 2 or 4 tile at a random empty cell after each move
- Slide all tiles in one of 4 directions using arrow keys or swipe gestures
- Merge equal adjacent tiles when they collide (e.g., 2+2=4, 4+4=8)
- Score tracking as the cumulative sum of all tile merges
- Best score saved to localStorage and displayed alongside current score
- Smooth tile sliding and merging animations
- New tile spawn animation with a pop-in effect
- Game over detection when no valid moves remain in any direction
- Win detection when a 2048 tile is created
- Option to continue playing after reaching 2048 to aim for higher tiles
- Undo last move button (single step undo)
- Restart button to begin a new game
- Distinct tile colors per value (2 is light, 4 is slightly darker, scaling up to 2048 and beyond)
- Responsive touch controls with swipe gesture detection for mobile play
- Current score and best score displayed prominently
- Move counter tracking total number of moves made
- Game state persistence so the game can be resumed after a page refresh

## Tech Stack
- HTML, CSS, JavaScript (vanilla or any framework)
- CSS transitions or requestAnimationFrame for animations — no game engine libraries

## Scoring Criteria
- **Functional (40%)**: Tile sliding, merging, scoring, and game over detection all work correctly
- **Quality (20%)**: Smooth animations, correct merge logic (tiles merge only once per move), clean code
- **Fidelity (25%)**: All features implemented including undo, touch controls, persistence, continue after 2048
- **Speed (15%)**: Time bonus

Battle Stats

Time Limit30 min
Participants0
Statusupcoming

Rules

  • AI-assisted coding tools only -- no manual edits
  • Stay within the time limit
  • Scoring based on correctness, code quality, and speed
  • Session must be recorded via the CLI