Skip to content

Onnesok/asian_chicken

Repository files navigation

Asian Chicken

Asian Chicken is a 2D endless runner game built with Flutter and the Flame game engine. Guide your chicken (and other characters) through a side-scrolling world, avoid obstacles, and compete for the highest score!

Features

  • Multiple playable characters
  • Several enemy types (cat girl, witch, bat, etc.)
  • Parallax scrolling backgrounds (Pine Forest, Forest 1, Classic)
  • Sound effects and background music
  • Pause, settings, and level selection menus
  • High score tracking
  • Responsive controls (swipe and tap)
  • Customizable Control Buttons:
    • Drag and drop the Jump, Down, Left, and Right buttons to any position on the screen using the in-game Button Settings UI.
    • Button positions are saved and persist across app restarts.
    • Default layout prevents button overlap and is optimized for landscape play.

Screenshots

Game screenshots can be found in the assets/Asian chicken directory on GitHub.

Below are some example screenshots from the game:

1 2 3 4
5 6 7 8

For more screenshots, see the assets/Asian chicken folder in the repository.

Getting Started

Prerequisites

  • Flutter SDK (3.5.0 or higher recommended)
  • Dart SDK (comes with Flutter)

Installation

  1. Clone the repository:
    git clone https://github.com/Onnesok/asian_chicken.git
    cd asian_chicken
  2. Get dependencies:
    flutter pub get
  3. Run the game:
    flutter run

    The game is optimized for landscape mode.

Project Structure

asian_chicken/
│
├── lib/
│   ├── main.dart                # App entry point, sets up providers and launches the game
│   │
│   ├── game/                    # Core game logic and components
│   │   ├── asian_chicken_game.dart   # Main game class, handles game loop, parallax, and state
│   │   ├── enemy_manager.dart        # Spawns and manages enemies
│   │   ├── enemy.dart                # Enemy component and behavior
│   │   └── chicken.dart              # Player character logic and animation
│   │
│   ├── screens/                 # UI/game screens
│   │   ├── welcome_screen.dart         # Main menu and welcome screen
│   │   ├── game_over_screen.dart       # Game over UI
│   │   ├── level_screen.dart           # Level/difficulty selection
│   │   └── character_selection_screen.dart # Character selection UI
│   │
│   ├── widgets/                 # Reusable UI widgets and overlays
│   │   ├── pause_button.dart            # Pause button widget
│   │   ├── pause_menu_bracu.dart        # Pause menu overlay
│   │   ├── settings_menu_bracu.dart     # Settings menu overlay
│   │   └── loading_overlay.dart         # Loading overlay widget
│   │
│   ├── models/                  # Data models
│   │   └── enemy_data.dart              # Enemy data structure
│   │
│   └── providers/               # State management (using Provider)
│       ├── score_provider.dart          # Score and high score logic
│       ├── music_provider.dart          # Music and sound settings
│       ├── level_provider.dart          # Level/difficulty state
│       └── background_provider.dart     # Background selection state
│
├── assets/
│   ├── images/                  # All game images and sprites
│   │   ├── cat_girl/                    # Cat girl enemy sprites
│   │   ├── witch/                       # Witch enemy sprites
│   │   ├── Bat/, Rino/, AngryPig/       # Other enemy sprites
│   │   ├── ChickBoy/, chicken/          # Player character sprites
│   │   └── parallax/                    # Parallax backgrounds
│   │       ├── PineForestParallax/      # Pine forest background layers
│   │       └── forest1/                 # Forest 1 background layers
│   │       └── plx-*.png                # Classic background layers
│   │
│   ├── audio/                   # Sound effects and background music
│   │   ├── 8BitPlatformerLoop.wav       # Main background music
│   │   ├── jump14.wav, hurt7.wav        # Sound effects
│   │   └── readme.md                    # Audio credits and licenses
│   └── Icon/                    # App icons for mobile/desktop
│
├── test/
│   └── widget_test.dart         # Example widget test
│
├── pubspec.yaml                 # Project configuration, dependencies, and asset registration
└── README.md                    # Project documentation (this file)

Directory Highlights

  • lib/game/: All core game logic, including the main game loop, player, and enemy logic.
  • lib/screens/: All major UI screens, such as menus and overlays.
  • lib/widgets/: Reusable UI components and overlays for pause, settings, and loading.
  • lib/providers/: State management for score, music, level, and background.
  • assets/images/parallax/: Contains all parallax background layers, organized by theme.
  • assets/audio/: Contains all music and sound effects, with credits in readme.md.

Assets

  • Images:
    • Sprites for chicken, cat girl, witch, bat, and more
    • Parallax backgrounds: PineForestParallax, forest1, classic
  • Audio:
    • Background music: 8BitPlatformerLoop.wav (Tim Beek)
    • SFX: jump14.wav, hurt7.wav (mikiz)
    • See assets/audio/readme.md for full credits

Dependencies

Customization

  • Backgrounds: Change in settings or via BackgroundProvider
  • Characters: Select from the character selection screen
  • Levels: Choose difficulty/level from the level selection screen
  • Control Buttons: Customize button positions and layout
  • Persistent Button Settings: Save button positions across app restarts

Setup Instructions

  1. Assets:

    • Place your background image at assets/images/background.png.
    • Ensure all other required images (chicken sprites, parallax layers, etc.) are in the correct assets/images/ subfolders.
    • Update your pubspec.yaml to include all asset paths.
  2. Dependencies:

  3. Persistent Button Settings:

    • Button positions are stored using SharedPreferences.
    • No extra setup is needed; settings are saved automatically when you tap Save or Reset in the Button Settings screen.
  4. Running the Game:

    • Run with flutter run on your preferred device or emulator.
    • Use the in-game settings to adjust controls and other preferences.

Testing

  • Basic widget test included in test/widget_test.dart

Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.

License

See license here.

Acknowledgements

Support

For issues or feature requests, please open an issue on the repository.

About

Asian Chicken is a 2D endless runner game built with Flutter and the Flame game engine. Guide your chicken (and other characters) through a side-scrolling world, avoid obstacles, and compete for the highest score!

Topics

Resources

License

Stars

3 stars

Watchers

3 watching

Forks

Packages

 
 
 

Contributors