Skip to content
codebythuraPublic

About

Fruit 2048 Compose

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

🍉 2048 – Fruit Edition

A fun and colorful 2048 puzzle game with a fruit theme, built using Jetpack Compose. Merge matching fruits to reach the highest score and unlock new fruit tiles! 🍓🍍

✨ Features

  • 🍎 Classic 2048 gameplay with a fruit twist
  • 🎨 Modern UI built entirely with Jetpack Compose
  • 🌗 Light & Dark theme support
  • 🔄 Undo move support
  • 🏆 Best score saved locally
  • 📱 Smooth animations and responsive controls

🎮 How to Play

  1. Swipe in any direction (⬆️⬇️⬅️➡️)
  2. Merge two identical fruits to create a bigger fruit
  3. Each merge increases your score
  4. The game ends when no more moves are possible

🏗️ Tech Stack & Architecture

  • UI: Jetpack Compose, Material 3
  • Language: Kotlin, Coroutines & StateFlow
  • Dependency Injection: Dagger Hilt
  • Local Persistence: Room Database
  • Testing: JUnit4, Robolectric, Compose UI Test, Turbine, UIAutomator
  • Performance & Profiling: Jetpack Macrobenchmark (StartupTimingMetric, FrameTimingMetric), Baseline Profile Gradle Plugin

🧪 Testing Strategy

The project maintains test coverage across unit, UI, and end-to-end layers:

  • Unit & Game Engine Tests: Verifies grid shifting, fruit tile merging rules, score calculation, random tile spawning, and game-over conditions using deterministic test fakes.
  • State & Flow Tests: Uses Turbine to assert reactive StateFlow emissions and Room persistence transitions.
  • Component & UI Tests: Uses Robolectric and Compose testing APIs to verify board rendering, gesture handling, and dialog states without requiring an emulator.

📸 Screenshots

🙏 Credit

Tile UI design credit to the original designer from Figma.

📄 License

This project is licensed under the MIT License.

About

Fruit 2048 Compose

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages