A match-3 puzzle game built using Flutter and the Flame game engine. "Carmole" combines the fun of classic block-matching with a unique twist: instead of candies or gems, you drop and combine junkyard cars using a crane!
Carmole is a Flame-based 2D puzzle game inspired by titles like Candy Crush, but with a junkyard theme. A crane drops old cars of different colors onto a grid. If you align 4 or more cars of the same color in a row or column, they are cleared from the board.
- Project Setup
1.1 Clone the repository or create a new folder:
cd C:\Users\Colibecas\Documents\Flutter-projects
flutter create carmole_game
cd carmole_game
1.2 Install Flame:
flutter pub add flame
1.3 Update assets in pubspec.yaml:
flutter:
uses-material-design: true
assets:
- assets/images/
1.4 Create the folders:
mkdir assets
mkdir assets\images
mkdir lib\components
mkdir lib\game
-
Folder Structure
carmole_game/ ├── assets/ │ └── images/ ├── lib/ │ ├── components/ │ │ ├── car_component.dart │ │ ├── crane_component.dart │ │ └── grid_component.dart │ ├── game/ │ │ ├── carmole_game.dart │ │ └── game_state_manager.dart │ └── main.dart ├── pubspec.yaml └── README.md
-
Running the Game (Windows Desktop) Make sure Windows desktop support is enabled:
flutter config --enable-windows-desktop flutter doctor
Run the game:
flutter run -d windows
Main Game Class: Launches the Flame game and manages game objects.
Grid Component: Handles the grid logic and placement of cars.
Car Component: Defines the appearance and logic for individual cars.
Crane Component: Simulates the crane that drops cars onto the board.
Game State Manager: Tracks score, level, matches, and reset functionality.
import 'package:flutter/material.dart';
import 'package:flame/game.dart';
import 'game/carmole_game.dart';
void main() {
runApp(
GameWidget(
game: CarmoleGame(),
),
);
}
Drop cars with the crane: Tap anywhere on the game area to drop a new car in the current column.
Create matches: Align 4 or more cars of the same color vertically or horizontally to clear them.
Gravity: Cleared cars leave empty spaces; remaining cars fall to fill the gaps.
Score: Earn points for every cleared car and match.
Flutter (UI Framework)
Flame (Lightweight game engine for Flutter)
- Grid is centered and fully interactive.
- Crane shows a preview car aligned to the hook side. When the crane flips left/right, the preview stays under the hook. Dropped cars now keep a neutral orientation (no accidental mirroring).
- Tap anywhere to drop the preview car in the current column.
Flame Engine Documentation
Flutter Official Docs
- Implement smooth animation for crane movement
- Add collision/match logic to clear cars (4+ in a line)
- Display score, level, and match counters in HUD
- Add sound and particle effects
- Refine car sprites and visual polish
This project is licensed under the MIT License. See the LICENSE file for details.