A small reflex game built with Kotlin for Android. Catch the fruit that appears randomly and reach the highest score in 10 seconds.
- Single-screen arcade-style game
- 3x3 fruit grid with random visibility every 500 ms
- 10-second countdown game loop
- Score tracking and replay dialog
- Kotlin (Android)
- Android Gradle Plugin 8.5.0
- Gradle 8.7
- Data Binding
- Material 3 theme
- ConstraintLayout + GridLayout
app/src/main/java/com/halil/ozel/catchthefruits/MainActivity.kt- game loop, score logic, timer, replay dialogapp/src/main/res/layout/activity_main.xml- UI with Data Bindingapp/src/main/res/values/strings.xml- localized UI texts and formatted stringsapp/src/main/res/values/styles.xml- Material 3 app theme
- Game starts with score
0and time10. - Every 500 ms, all fruits hide and one random fruit is shown.
- Tapping visible fruit increases score.
- At the end of 10 seconds, game stops and replay dialog appears.
- Android Studio (recent stable version)
- JDK 17
- Android SDK 34
cd "/Users/halilozel1903/AndroidStudioProjects/CatchTheFruits"
./gradlew assembleDebugAPK output:
app/build/outputs/apk/debug/
CountDownTimerfor countdownHandler+Runnablefor fruit switching cycleAlertDialogfor restart flow- Data Binding click handlers for scoring
- The project is intentionally simple and beginner-friendly.
- You can swap fruit assets in
app/src/main/res/drawable/. - You can tune difficulty by changing game constants in
MainActivity.kt.
MIT License
Copyright (c) 2023 Halil OZEL
