A modern Android implementation of the classic Simon Says electronic memory game, built with Jetpack Compose and Material Design 3.
Simon Says is an engaging memory game where players must repeat increasingly complex sequences of colored lights and sounds. Each round adds a new random element to the sequence, progressively challenging the player's memory and concentration.
- Classic Simon Mechanics: Four colored buttons (Green, Red, Yellow, Blue) arranged in a 2x2 grid
- Progressive Difficulty: Each successful round adds a new element to the sequence
- Time-Limited Gameplay: 10-second timeout for player responses
- High Score Tracking: Persistent high score across game sessions
- Visual Feedback: 3D button animations with spring physics and gradient effects
- Multiple Sound Packs: Choose from 7 different sound themes:
- Standard (classic Simon tones)
- Funny
- Electronic
- Retro
- Musical
- Nature
- Sci-Fi
- Sound Control: Mute/unmute toggle in top bar
- Error Feedback: Distinct error tone for incorrect sequences
- Vibration Toggle: Optional haptic feedback (100ms) on button presses
- Settings Screen: Easy access to all game preferences
- Dark Theme: Material Design 3 dark theme support
- Lifecycle-Aware: Proper handling of app pause/resume states
- State Preservation: Game state maintained during background transitions
- Responsive Layout: Adapts to different screen sizes and orientations
- Modern UI: Jetpack Compose with Material Design 3 components
- Language: Kotlin 2.1.10
- UI Framework: Jetpack Compose (BOM 2025.03.01)
- Architecture: MVVM with StateFlow
- Dependency Injection: Koin 4.0.3
- Build System: Gradle (Kotlin DSL)
- Minimum SDK: 31 (Android 12)
- Target SDK: 35 (Android 15)
- Compile SDK: 35
androidx.core:core-ktx- Android KTX extensionsandroidx.activity:activity-compose- Compose activity integrationandroidx.lifecycle:lifecycle-runtime-ktx- Lifecycle componentsandroidx.compose.material3:material3- Material Design 3io.insert-koin:koin-android- Dependency injection
MyApplication2/
├── app/src/main/
│ ├── java/com/guy/myapplication/
│ │ ├── SimonApp.kt # Application class with DI setup
│ │ ├── ui/
│ │ │ ├── MainActivity.kt # Main activity entry point
│ │ │ ├── screens/
│ │ │ │ ├── SimonGameScreen.kt # Main game UI
│ │ │ │ └── SettingsScreen.kt # Settings UI
│ │ │ ├── components/
│ │ │ │ └── SimonPanel.kt # Colored button component
│ │ │ ├── viewmodels/
│ │ │ │ └── SimonGameViewModel.kt # Game logic controller
│ │ │ └── theme/ # Material 3 theme
│ │ ├── domain/
│ │ │ ├── model/
│ │ │ │ ├── SimonGameState.kt # Game state sealed class
│ │ │ │ └── SimonGameUiState.kt # UI state data class
│ │ │ └── enums/
│ │ │ ├── SimonButton.kt # Button enum
│ │ │ └── SoundPack.kt # Sound pack enum
│ │ ├── data/
│ │ │ └── manager/
│ │ │ └── SimonSoundManager.kt # Audio & vibration
│ │ └── di/
│ │ └── AppModule.kt # Koin DI module
│ └── res/
│ ├── raw/ # Audio files
│ ├── drawable/ # Icons & graphics
│ └── values/ # Resources
└── gradle/
└── libs.versions.toml # Version catalog
- Android Studio Ladybug or later
- JDK 11 or higher
- Android SDK 31+
- Gradle 8.9.1+
- Clone the repository:
git clone <repository-url>
cd MyApplication2-
Open the project in Android Studio
-
Sync Gradle dependencies
-
Run the application:
./gradlew installDebug# Build the project
./gradlew build
# Install debug APK
./gradlew installDebug
# Clean build artifacts
./gradlew clean# Run unit tests
./gradlew test
# Run specific test
./gradlew test --tests "com.guy.myapplication.ExampleUnitTest"
# Run instrumented tests (requires connected device/emulator)
./gradlew connectedAndroidTest
# Run lint checks
./gradlew lint# Build release APK
./gradlew assembleRelease
# Build signed release bundle
./gradlew bundleReleaseThe application follows the Model-View-ViewModel pattern with Jetpack Compose:
- View Layer: Composable functions (
SimonGameScreen,SettingsScreen,SimonPanel) - ViewModel Layer:
SimonGameViewModelmanages game logic and UI state - Data Layer:
SimonSoundManagerhandles audio/vibration, SharedPreferences for persistence - Domain Layer: Models and enums defining business logic
- Centralized State:
SimonGameUiStatedata class holds complete UI state - Reactive Updates: StateFlow exposes state to UI layer
- Immutable State: State updates using
.update { it.copy() }pattern - Lifecycle-Aware:
viewModelScopeensures coroutines respect lifecycle
The game operates in five distinct states:
- WaitingToStart: Initial state, ready to begin
- ShowingSequence: Computer displays the sequence
- PlayerRepeating: Waiting for player input with timeout
- GameOver: Game ended, show play again button
- Settings: Settings screen active
WaitingToStart
↓ (tap center button)
ShowingSequence (play sequence with animations/sounds)
↓
PlayerRepeating (10-second timeout)
↓ (correct sequence)
Generate new button → ShowingSequence
↓ (wrong button or timeout)
GameOver (flash buttons, update high score)
↓ (tap play again)
StartNewGame → WaitingToStart
The app requires the following permission:
android.permission.VIBRATE- For haptic feedback
- Audio stream:
STREAM_MUSIC - SoundPool max streams: 10
- Optimized for short game sounds
- Material Design 3 with dark theme
- Edge-to-edge display
- Gradient effects on buttons
- Spring-based animations
Following the project's CLAUDE.md guidelines:
- Architecture: MVVM with ViewModels and StateFlow
- Naming: PascalCase for classes, camelCase for functions, SCREAMING_SNAKE_CASE for constants
- Documentation: KDoc comments for public APIs
- Error Handling: Try/catch with detailed logging
- Asynchronous: Kotlin Coroutines with viewModelScope
- State Management: Immutable state with StateFlow
- Logging: TAG constant with Log.d/e/w
Currently implemented sound packs:
- Standard (complete)
- Funny (complete)
Planned sound packs:
- Electronic
- Retro
- Musical
- Nature
- Sci-Fi
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name - Follow the code style guidelines in CLAUDE.md
- Write unit tests for new features
- Commit your changes:
git commit -m 'Add some feature' - Push to the branch:
git push origin feature/your-feature-name - Submit a pull request
The project includes:
- Unit tests with JUnit 4
- Instrumented tests with Espresso
- Compose UI tests
Run tests before submitting changes:
./gradlew test lintThis project is available under the MIT License (or your chosen license).
- Inspired by the classic Simon electronic game by Ralph H. Baer and Howard J. Morrison
- Built with modern Android development best practices
- Uses Material Design 3 components
Version: 1.0.0
Build: See app/build.gradle.kts for current version details