Skip to content

A modern, cross-platform 2048 puzzle game built with Flutter and Firebase. Features real-time leaderboards, user authentication, and smooth animations

Notifications You must be signed in to change notification settings

mohitj2401/2048-game

Repository files navigation

Flutter 2048 Game

A modern implementation of the classic 2048 game using Flutter and Firebase.

Features

  • Classic 2048 Gameplay: Swipe to merge tiles and reach 2048!
  • Authentication: Sign up and login using Email/Password (Firebase Auth).
  • Guest Mode: Play anonymously without creating an account.
  • Leaderboard: Compete with other players. The leaderboard displays the top scores and player names (authenticated users only).
  • Game State Persistence: Your game progress is automatically saved. Resume your unfinished games when you return to the app!
  • Session Persistence: Stay logged in across app restarts.
  • Responsive Design: Beautiful UI with smooth animations.

Tech Stack

  • Frontend: Flutter (Dart)
  • Backend: Firebase (Auth, Firestore)
  • State Management: Provider
  • Local Storage: SharedPreferences

Setup & Installation

  1. Prerequisites:

    • Flutter SDK installed.
    • Firebase project set up.
  2. Clone the repository:

    git clone <repository-url>
    cd flutter_2048_game
  3. Install Dependencies:

    flutter pub get
  4. Firebase Configuration:

    • Ensure you have the google-services.json file in android/app/.
    • Ensure you have the GoogleService-Info.plist file in ios/Runner/ (if targeting iOS).
    • Add your SHA-1 fingerprint to the Firebase Console for Android authentication.
  5. Run the App:

    flutter run

Testing

Run the unit tests to verify the game logic:

flutter test

Project Structure

  • lib/main.dart: Entry point and app configuration.
  • lib/screens/: UI screens (Auth, Game, Leaderboard).
  • lib/providers/: State management (Auth, Game).
  • lib/services/: Backend services (Database).
  • lib/widgets/: Reusable UI components.

About

A modern, cross-platform 2048 puzzle game built with Flutter and Firebase. Features real-time leaderboards, user authentication, and smooth animations

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published