Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Space Dodge is a fast-paced Flutter arcade game where you dodge asteroids, collect coins, and customize gameplay with dynamic difficulty and immersive effects.

License

Notifications You must be signed in to change notification settings

smit-ai/space-dodger

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ Space Dodger

Space Dodger Game

A thrilling space adventure where you pilot a spaceship through asteroid fields, dodging danger while collecting cosmic treasures!

Flutter Dart License Platform

๐ŸŽฎ About Space Dodger

Space Dodger is an exciting mobile game that combines classic arcade gameplay with modern mobile features. Navigate your spaceship through treacherous asteroid fields, collect valuable coins, and achieve the highest score possible while customizing your gaming experience with various settings and difficulty levels.

๐ŸŒŸ What Makes It Special

  • ๐ŸŽฏ Intuitive Controls: Simple left/right touch controls for smooth gameplay
  • โšก Dynamic Difficulty: Adjustable difficulty from 0.5x to 6.0x for all skill levels
  • ๐Ÿ’Ž Smart Scoring: Score multipliers based on difficulty and strategic choices
  • โค๏ธ Lives System: Multiple lives (1-3) for extended gameplay sessions
  • ๐ŸŽจ Beautiful Graphics: Space-themed visuals with particle effects and smooth animations
  • ๐Ÿ”Š Immersive Audio: Sound effects and background music for enhanced experience
  • โš™๏ธ Customizable Settings: Tailor the game to your preferences

๐ŸŽฏ Game Features

๐Ÿš€ Core Gameplay

  • Spaceship Navigation: Control your ship with responsive touch controls
  • Asteroid Dodging: Navigate through falling red asteroids to survive
  • Coin Collection: Collect yellow coins to increase your score
  • Progressive Speed: Game speed increases as your score grows
  • Lives System: Start with 1-3 lives (configurable in settings)

๐ŸŽ›๏ธ Advanced Features

  • Difficulty Scaling: 0.5x to 6.0x difficulty multiplier
    • Higher difficulty = more asteroids + better scoring
    • 3x difficulty = 3 points per coin, 6x difficulty = 6 points per coin
  • Coin Magnet: Enable to collect coins from any height
  • Magnet Bonus: +5 points when coin magnet is OFF (skill reward)
  • Speed Control: Adjustable game speed from 30ms to 120ms
  • Max Score Tracking: Persistent high score tracking

๐ŸŽจ Visual & Audio

  • Space Theme: Beautiful cosmic graphics with detailed sprites
  • Particle Effects: Explosions, coin collection effects, and engine trails
  • Smooth Animations: 60 FPS gameplay with fluid movements
  • Sound Effects: Coin collection, explosions, and game over sounds
  • Background Music: Immersive space-themed audio

โš™๏ธ Customization Options

  • Lives Selection: Choose 1, 2, or 3 lives
  • Difficulty Slider: Fine-tune challenge level (0.5x - 6.0x)
  • Game Speed: Adjust base game speed for your preference
  • Coin Magnet: Toggle automatic coin collection
  • Visual Effects: Enable/disable particle effects
  • Sound Settings: Control audio experience

๐Ÿ“ฑ Screenshots

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚        ๐Ÿ† Space Dodge ๐Ÿ†       โ”‚
โ”‚                                 โ”‚
โ”‚    ๐Ÿš€                          โ”‚
โ”‚                                 โ”‚
โ”‚  โญ     ๐Ÿ’ฅ                     โ”‚
โ”‚                                 โ”‚
โ”‚     ๐Ÿ’ฅ      โญ                 โ”‚
โ”‚                                 โ”‚
โ”‚  [โ—€]        [โ–ถ]                โ”‚
โ”‚                                 โ”‚
โ”‚ Score: 150    โค๏ธโค๏ธโค๏ธ           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Gameplay with lives display and score tracking

๐Ÿš€ Quick Start

Prerequisites

  • Flutter SDK: 3.0.0 or higher
  • Dart SDK: Latest stable version
  • Development Environment: Android Studio, VS Code, or your preferred IDE
  • Device/Emulator: Android device, iOS device, or emulator

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/space-dodger.git
    cd space-dodger
  2. Install dependencies

    flutter pub get
  3. Run the game

    flutter run

Building for Release

Android APK:

flutter build apk --release

Android App Bundle (Recommended for Play Store):

flutter build appbundle --release

iOS App:

flutter build ios --release

Web Version:

flutter build web --release

๐ŸŽฎ How to Play

Basic Controls

  • Left Button (โ—€): Move spaceship to the left
  • Right Button (โ–ถ): Move spaceship to the right
  • Settings Icon (โš™๏ธ): Access game settings and customization
  • Pause Icon (โธ๏ธ): Pause/resume the game
  • Refresh Icon (๐Ÿ”„): Restart the current game

Gameplay Rules

  1. Objective: Collect as many coins as possible while avoiding asteroids
  2. Scoring System:
    • Base score = difficulty multiplier ร— 1 point
    • Magnet bonus = +5 points when coin magnet is OFF
    • Example: 3x difficulty + magnet OFF = 8 points per coin
  3. Lives: Start with 1-3 lives (configurable)
  4. Game Over: Lose all lives when colliding with asteroids
  5. Progression: Game speed increases with higher scores

๐Ÿ† Scoring Strategy

  • Beginner: Start with 1.0x difficulty and coin magnet ON
  • Intermediate: Try 2.0x-3.0x difficulty for better scoring
  • Expert: Challenge yourself with 4.0x-6.0x difficulty and magnet OFF
  • High Score: Combine high difficulty with magnet OFF for maximum points

โš™๏ธ Game Settings Explained

Lives System

  • 1 Life: Hardcore mode - one mistake and you're done
  • 2 Lives: Balanced challenge - room for one mistake
  • 3 Lives: Casual mode - forgiving gameplay for beginners

Difficulty Levels

  • 0.5x: Very Easy - Few asteroids, perfect for learning
  • 1.0x: Easy - Standard gameplay
  • 2.0x: Medium - More challenging
  • 3.0x: Hard - High asteroid density
  • 4.0x: Very Hard - Intense gameplay
  • 5.0x: Extreme - Maximum challenge
  • 6.0x: Insane - Ultimate test of skill

Game Speed

  • 30ms: Very Fast - For experienced players
  • 60ms: Fast - Standard speed
  • 90ms: Moderate - Balanced gameplay
  • 120ms: Slow - Relaxed pace for beginners

Coin Magnet

  • ON: Automatic coin collection from any height
  • OFF: Manual collection only (requires precise positioning) + 5 bonus points

๐Ÿ—๏ธ Project Structure

space-dodger/
โ”œโ”€โ”€ lib/
โ”‚   โ”œโ”€โ”€ main.dart                 # App entry point
โ”‚   โ”œโ”€โ”€ screens/
โ”‚   โ”‚   โ””โ”€โ”€ game_screen.dart      # Main game screen and logic
โ”‚   โ”œโ”€โ”€ models/
โ”‚   โ”‚   โ”œโ”€โ”€ game_objects.dart     # Game entities (Ship, Bomb, Coin)
โ”‚   โ”‚   โ””โ”€โ”€ sound_manager.dart    # Audio management
โ”‚   โ””โ”€โ”€ widgets/
โ”‚       โ”œโ”€โ”€ game_painter.dart     # Custom painting for game graphics
โ”‚       โ”œโ”€โ”€ settings_panel.dart   # Settings dialog widget
โ”‚       โ””โ”€โ”€ space_background.dart # Animated background
โ”œโ”€โ”€ assets/
โ”‚   โ”œโ”€โ”€ app_icon.png             # Custom app icon
โ”‚   โ””โ”€โ”€ sounds/                  # Audio files
โ”œโ”€โ”€ android/                     # Android-specific configuration
โ”œโ”€โ”€ ios/                         # iOS-specific configuration
โ””โ”€โ”€ pubspec.yaml                 # Dependencies and configuration

๐ŸŽจ Technical Architecture

Core Components

  • GameScreen: Main game controller, UI, and game loop
  • Ship: Player-controlled spaceship with movement logic
  • Bomb: Hazardous asteroids that must be avoided
  • Coin: Collectible items that increase score
  • GamePainter: Custom rendering for optimized graphics
  • SettingsPanel: Comprehensive game configuration interface
  • SoundManager: Audio playback and management

Game Loop Architecture

  1. Input Processing: Handle touch inputs and continuous movement
  2. Entity Updates: Move ship, bombs, and coins based on game speed
  3. Collision Detection: Check for collisions and coin collection
  4. Scoring System: Calculate points based on difficulty and settings
  5. State Management: Update lives, score, and game state
  6. Visual Effects: Render particles, explosions, and animations
  7. Audio Feedback: Play appropriate sound effects

Performance Optimizations

  • Efficient Collision Detection: Optimized hitbox calculations
  • Object Pooling: Reuse game objects to minimize memory allocation
  • Custom Painting: Direct canvas rendering for smooth 60 FPS
  • State Management: Minimal widget rebuilds with proper state handling
  • Memory Management: Automatic cleanup of off-screen objects

๐Ÿ”ง Development Guide

Adding New Features

  1. New Game Objects: Extend game_objects.dart with new entity classes
  2. Visual Enhancements: Modify game_painter.dart for new graphics
  3. UI Improvements: Update game_screen.dart or settings_panel.dart
  4. Game Logic: Enhance game loop in game_screen.dart
  5. Audio: Add new sounds to sound_manager.dart

Code Style

  • Follow Flutter/Dart best practices
  • Use meaningful variable and function names
  • Add comments for complex game logic
  • Maintain consistent code formatting

Testing

# Run tests
flutter test

# Run with coverage
flutter test --coverage

# Debug mode
flutter run --debug

๐Ÿ› Troubleshooting

Common Issues

Game won't start:

  • Ensure Flutter SDK is properly installed
  • Run flutter doctor to check setup
  • Try flutter clean && flutter pub get

Performance issues:

  • Disable visual effects in settings
  • Close other apps to free memory
  • Use a device instead of emulator

Touch not responding:

  • Check device/emulator connection
  • Restart the app
  • Verify touch input is enabled

Build errors:

  • Update Flutter: flutter upgrade
  • Clean project: flutter clean
  • Reinstall dependencies: flutter pub get

Debug Commands

# Check Flutter installation
flutter doctor

# Clean and rebuild
flutter clean
flutter pub get

# Run in debug mode
flutter run --debug

# Build release APK
flutter build apk --release

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿค Contributing

We welcome contributions! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Contribution Guidelines

  • Follow existing code style and conventions
  • Add tests for new features
  • Update documentation as needed
  • Ensure all tests pass before submitting

๐Ÿ“ž Support & Feedback

  • GitHub Issues: Report bugs or request features
  • Discussions: Join community discussions
  • Email: Contact the development team
  • Documentation: Check this README and code comments

๐ŸŽ‰ Acknowledgments

  • Flutter Team: For the amazing framework
  • Dart Team: For the powerful programming language
  • Flutter Community: For excellent documentation and support
  • Game Development Community: For inspiration and best practices
  • Beta Testers: For valuable feedback and bug reports

๐ŸŒŸ Future Roadmap

  • Multiplayer mode
  • Power-ups and special abilities
  • Different ship types
  • Achievement system
  • Leaderboards
  • More visual themes
  • Enhanced sound effects
  • Tutorial mode

๐Ÿš€ Ready to embark on your space adventure? Download Space Dodger now! ๐Ÿš€

Built with โค๏ธ using Flutter

Download APK

About

Space Dodge is a fast-paced Flutter arcade game where you dodge asteroids, collect coins, and customize gameplay with dynamic difficulty and immersive effects.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 54.4%
  • C++ 19.6%
  • CMake 15.0%
  • Shell 4.6%
  • Batchfile 2.7%
  • HTML 1.6%
  • Other 2.1%