Skip to content

MarynaRina/MindPlay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

21 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

MindPlay ๐Ÿง 

A modern Android application designed to train memory, concentration, and mental agility through engaging cognitive games. Built with Jetpack Compose and Kotlin, MindPlay offers a stress-free approach to brain training with smooth animations, immersive sound design, and an intuitive user interface.

๐Ÿ“ฑ Overview

MindPlay is a collection of six cognitive training games that help users improve various mental skills:

  • Memory - Pattern matching and visual memory
  • Simon - Sequential memory and pattern reproduction
  • Arithmetic - Mental math and numerical reasoning
  • Pary (Pairs) - Logical matching and pattern recognition
  • Puzzle - Spatial reasoning and problem-solving
  • Uwaga (Attention) - Reaction time and focus

The app emphasizes a relaxed, pressure-free experience while still providing challenging gameplay that adapts to user preferences.

๐Ÿš€ Features

Core Features

  • Six Cognitive Games - Each targeting different mental skills
  • Smooth Animations - Fade transitions between screens using AnimatedVisibility
  • Immersive Audio - Background music and sound effects for user interactions
  • Custom Theme System - Consistent design with MindPlay theme colors
  • Progress Tracking - Game statistics and performance metrics
  • Daily Reminders - Push notifications to encourage regular practice
  • Onboarding Flow - Welcome and tutorial screens for first-time users
  • Settings Management - Customizable preferences stored locally

Game Features

  • Multiple difficulty levels and grid modes
  • Optional stress/time modes for added challenge
  • Pause functionality during gameplay
  • Detailed result screens with metrics
  • Play again or return to menu options
  • Intro screens explaining game rules

๐Ÿ› ๏ธ Technologies

Core Stack

  • Kotlin - Primary programming language
  • Jetpack Compose - Modern declarative UI framework
  • Material 3 - Design system and components
  • Coroutines & Flow - Asynchronous programming and reactive streams

Architecture & Dependencies

  • MVVM Architecture - Clean separation of concerns
  • Koin - Dependency injection (v3.5.3)
    • koin-android
    • koin-androidx-compose
  • Navigation Compose - Type-safe navigation (v2.7.6)
  • DataStore - Preferences storage (v1.0.0)
  • Room Database - Local data persistence (v2.6.1)
    • Runtime, KTX extensions, and Kapt compiler
  • Lifecycle & ViewModel - Android Architecture Components

Build Configuration

  • Min SDK: 26 (Android 8.0)
  • Target SDK: 36
  • Compile SDK: 36
  • Java Version: 11
  • Gradle: Kotlin DSL

๐Ÿ“‚ Project Structure

app/src/main/java/com/mind/play/
โ”œโ”€โ”€ MainActivity.kt                 # Entry point with lifecycle management
โ”œโ”€โ”€ MindPlayApp.kt                  # Application class with Koin setup
โ”œโ”€โ”€ core/
โ”‚   โ”œโ”€โ”€ components/                 # Reusable UI components
โ”‚   โ”‚   โ”œโ”€โ”€ AnimatedCard.kt
โ”‚   โ”‚   โ”œโ”€โ”€ GameResultScreen.kt
โ”‚   โ”‚   โ”œโ”€โ”€ MindPlayBottomNavigation.kt
โ”‚   โ”‚   โ”œโ”€โ”€ MindPlayProgressBar.kt
โ”‚   โ”‚   โ”œโ”€โ”€ MindPlayToggle.kt
โ”‚   โ”‚   โ””โ”€โ”€ Buttons (Primary, Secondary)
โ”‚   โ”œโ”€โ”€ di/
โ”‚   โ”‚   โ””โ”€โ”€ AppModule.kt           # Dependency injection modules
โ”‚   โ”œโ”€โ”€ navigation/
โ”‚   โ”‚   โ”œโ”€โ”€ NavGraph.kt            # Navigation setup and routes
โ”‚   โ”‚   โ”œโ”€โ”€ NavigationAnimations.kt
โ”‚   โ”‚   โ””โ”€โ”€ Screen.kt              # Screen destinations
โ”‚   โ”œโ”€โ”€ notifications/
โ”‚   โ”‚   โ”œโ”€โ”€ NotificationScheduler.kt
โ”‚   โ”‚   โ”œโ”€โ”€ ReminderReceiver.kt
โ”‚   โ”‚   โ””โ”€โ”€ BootReceiver.kt
โ”‚   โ””โ”€โ”€ sound/
โ”‚       โ””โ”€โ”€ SoundManager.kt        # Audio playback management
โ”œโ”€โ”€ data/
โ”‚   โ”œโ”€โ”€ local/                     # Room database entities and DAOs
โ”‚   โ””โ”€โ”€ repository/                # Data layer abstractions
โ”œโ”€โ”€ domain/
โ”‚   โ””โ”€โ”€ models/                    # Business logic models
โ”œโ”€โ”€ ui/
โ”‚   โ”œโ”€โ”€ dashboard/
โ”‚   โ”‚   โ””โ”€โ”€ HomeScreen.kt          # Main dashboard
โ”‚   โ”œโ”€โ”€ games/
โ”‚   โ”‚   โ”œโ”€โ”€ GamesScreen.kt         # Games selection grid
โ”‚   โ”‚   โ”œโ”€โ”€ arithmetic/            # Simple arithmetic game
โ”‚   โ”‚   โ”œโ”€โ”€ memory/                # Card matching game
โ”‚   โ”‚   โ”œโ”€โ”€ pary/                  # Logical pairs game
โ”‚   โ”‚   โ”œโ”€โ”€ puzzle/                # Sliding puzzle game
โ”‚   โ”‚   โ”œโ”€โ”€ simon/                 # Color sequence game
โ”‚   โ”‚   โ””โ”€โ”€ uwaga/                 # Attention/reaction game
โ”‚   โ”œโ”€โ”€ onboarding/
โ”‚   โ”‚   โ”œโ”€โ”€ WelcomeScreen.kt
โ”‚   โ”‚   โ””โ”€โ”€ OnboardingScreen.kt
โ”‚   โ”œโ”€โ”€ settings/
โ”‚   โ”‚   โ””โ”€โ”€ SettingsScreen.kt
โ”‚   โ”œโ”€โ”€ splash/
โ”‚   โ”‚   โ””โ”€โ”€ SplashScreen.kt
โ”‚   โ””โ”€โ”€ theme/
โ”‚       โ””โ”€โ”€ Theme files             # Colors, typography, shapes
โ””โ”€โ”€ res/
    โ”œโ”€โ”€ drawable/                   # Icons and graphics
    โ”œโ”€โ”€ values/                     # Strings, colors, themes
    โ””โ”€โ”€ raw/                        # Audio files

Architecture Pattern

The app follows MVVM (Model-View-ViewModel) architecture:

View (Composables) โ† ViewModel โ† Repository โ† Data Source
                        โ†“
                   StateFlow/State

Each game module contains:

  • Screen.kt - Main composable with game logic
  • ViewModel.kt - State management and business logic
  • Models.kt - Game state and data classes
  • IntroScreen.kt - Game rules and configuration
  • components/ - Game-specific UI components

๐ŸŽฎ Screens & Navigation Flow

Navigation Graph

Splash Screen
    โ†“
    โ”œโ”€โ†’ Welcome Screen (first launch)
    โ”‚       โ†“
    โ”‚   Onboarding Screen
    โ”‚       โ†“
    โ””โ”€โ†’ Home Screen โ†โ†’ Bottom Navigation
            โ†“              โ†“              โ†“
        Dashboard      Games Menu     Settings
                           โ†“
                    [Individual Games]
                    โ”œโ”€ Arithmetic
                    โ”œโ”€ Memory
                    โ”œโ”€ Pary
                    โ”œโ”€ Puzzle
                    โ”œโ”€ Simon
                    โ””โ”€ Uwaga
                           โ†“
                    [Game Flow]
                    Intro โ†’ Gameplay โ†’ Results

Screen Descriptions

Core Screens

  • SplashScreen - Initial loading screen with logo
  • WelcomeScreen - First-time user greeting
  • OnboardingScreen - Interactive tutorial walkthrough
  • HomeScreen - Main dashboard with quick access
  • GamesScreen - Grid view of all available games
  • SettingsScreen - User preferences and app configuration

Game Screens

Each game follows a consistent flow:

  1. Intro Screen - Game rules, difficulty selection
  2. Game Screen - Active gameplay with timer, progress, pause
  3. Result Screen - Performance metrics, play again option

Game Mechanics

Arithmetic (Prosta arytmetyka)

  • Solve addition and subtraction problems
  • Multiple choice answers
  • Progress tracking with score display
  • Optional time limit mode

Memory

  • Match pairs of cards by flipping them
  • Multiple grid sizes (2x4, 3x4, 4x4)
  • Round-based progression
  • Time-based challenges

Simon

  • Watch and memorize color sequences
  • Reproduce the pattern by tapping colors
  • Sequences grow longer each round
  • Audio-visual feedback

Pary (Pairs)

  • Match logical pairs (concepts, opposites, etc.)
  • Grid-based selection
  • Correct/incorrect visual feedback
  • Multiple rounds with increasing difficulty

Puzzle

  • Sliding tile puzzle (3x3 or 4x4 grid)
  • Move tiles to complete the image
  • Move counter and timer
  • Win/lose conditions

Uwaga (Attention)

  • React to specific stimuli
  • Tap correct targets as they appear
  • Reaction time tracking
  • Configurable difficulty

๐Ÿ”Š Sound System

The app features a comprehensive audio system via SoundManager:

  • Background Music - Continuous ambient music during gameplay
  • Sound Effects:
    • Tap/click sounds for button interactions
    • Success sounds for correct answers
    • Error sounds for mistakes
    • Card flip sounds
    • Completion fanfare

Audio playback is managed through the Activity lifecycle:

  • Automatically pauses when app goes to background
  • Resumes when app returns to foreground
  • Properly released on app termination

๐Ÿ’พ Data Persistence

DataStore (Preferences)

  • User settings (sound, notifications)
  • Onboarding completion status
  • Theme preferences

Room Database

  • Game progress and statistics
  • User performance history
  • Achievement tracking

๐ŸŽจ Theming

MindPlay uses a custom theme system with:

  • Primary Colors - Purple/violet palette
  • Secondary Colors - Complementary accents
  • Semantic Colors - Success (green), error (red), warning
  • Custom Typography - Rubik font family
  • Material 3 Components - Modern design language
  • Dark/Light Mode Support - Adaptive themes

Theme colors are accessed via MindPlayTheme.colors.*

๐Ÿ”” Notifications

The app includes a notification system for daily reminders:

  • ReminderReceiver - Handles scheduled notifications
  • BootReceiver - Restores alarms after device restart
  • NotificationScheduler - Manages notification timing
  • Permissions: POST_NOTIFICATIONS, SCHEDULE_EXACT_ALARM, USE_EXACT_ALARM

๐Ÿงช Testing

Test Structure

  • Unit Tests - JUnit (implementation included)
  • Instrumented Tests - AndroidX Test + Espresso
  • Compose Tests - UI testing with ui-test-junit4

Test packages:

app/src/androidTest/java/    # Instrumented tests
app/src/test/java/           # Unit tests

Running Tests

# Run unit tests
./gradlew test

# Run instrumented tests
./gradlew connectedAndroidTest

# Run specific test
./gradlew test --tests "com.mind.play.ExampleTest"

๐Ÿ“ฆ Installation & Setup

Prerequisites

  • Android Studio - Hedgehog (2023.1.1) or later
  • JDK - Version 11 or higher
  • Android SDK - API 26+ (minimum), API 36 (target)
  • Gradle - 8.0+ (included via wrapper)

Clone & Build

# Clone the repository
git clone <repository-url>
cd MindPlay

# Grant execute permission to Gradle wrapper (macOS/Linux)
chmod +x gradlew

# Build the project
./gradlew build

# Install on connected device/emulator
./gradlew installDebug

Configuration Files

The project uses these key configuration files:

  • build.gradle.kts (project & app level) - Build configuration
  • gradle.properties - Gradle settings
  • settings.gradle.kts - Project structure
  • gradle/libs.versions.toml - Dependency version catalog
  • local.properties - SDK location (generated, not in VCS)
  • proguard-rules.pro - Code obfuscation rules

First Run

  1. Launch Android Studio
  2. Open the project directory
  3. Wait for Gradle sync to complete
  4. Select a device/emulator (API 26+)
  5. Click Run โ–ถ๏ธ

The app will display the splash screen, then the welcome/onboarding flow for first-time users.

๐ŸŽฏ Key Implementation Details

Navigation Animations

All screen transitions use fade animations:

enterTransition = { NavigationAnimations.fadeInTransition() }
exitTransition = { NavigationAnimations.fadeOutTransition() }

Game State Management

Games use Kotlin StateFlow for reactive UI updates:

val gameState by viewModel.gameState.collectAsState()

Dependency Injection

Koin modules provide singleton instances:

single { SoundManager(androidContext()) }
single { SettingsRepository(get()) }

Composable Patterns

  • AnimatedVisibility - Smooth transitions between game phases
  • LazyVerticalGrid - Efficient grid layouts for game cards
  • remember/mutableStateOf - Local state management
  • collectAsState - Flow to Compose state conversion

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages