Skip to main content

Casual Games Toolkit

The Flutter Casual Games Toolkit pulls together new and existing resources so you can accelerate development of games on mobile platforms.

This page outlines where you can find these available resources.

Why Flutter for games?

#

The Flutter framework can create performant apps for six target platforms from the desktop to mobile devices to the web.

With Flutter's benefits of cross-platform development, performance, and open source licensing, it makes a great choice for games.

Casual games fall into two categories: turn-based games and real-time games. You might be familiar with both types of games, though perhaps you didn't think about them in quite this way.

Turn-based games cover games meant for a mass market with simple rules and gameplay. This includes board games, card games, puzzles, and strategy games. These games respond to simple user input, like tapping on a card or entering a number or letter. These games are well suited for Flutter.

Real-time games cover games a series of actions require real time responses. These include endless runner games, racing games, and so on. You might want to create a game with advanced features like collision detection, camera views, game loops, and the like. These types of games could use an open source game engine like the Flame game engine built using Flutter.

What's included in the toolkit

#

The Casual Games Toolkit provides the following free resources.

  • A repository that includes three new game templates that provide a starting point for building a casual game.

    1. A base game template that includes the basics for:

      • Main menu
      • Navigation
      • Settings
      • Level selection
      • Player progress
      • Play session management
      • Sound
      • Themes
    2. A card game template that includes everything in the base template plus:

      • Drag and drop
      • Game state management
      • Multiplayer integration hooks
    3. An endless runner template created in partnership with the open source game engine, Flame. It implements:

      • A FlameGame base template
      • Player steering
      • Collision detection
      • Parallax effects
      • Spawning
      • Different visual effects
    4. A sample game built on top of the endless runner template, called SuperDash. You can play the game on iOS, Android, or web, view the open source code repo, or read how the game was created in 6 weeks.

  • Developer guides for integrating needed services.

  • A link to a Flame Discord channel. If you have a Discord account, use this direct link.

The included game templates and cookbook recipes make certain choices to accelerate development. They include specific packages, like provider, google_mobile_ads, in_app_purchase, audioplayers, crashlytics, and games_services. If you prefer other packages, you can change the code to use them.

The Flutter team understands that monetization might be a future consideration. Cookbook recipes for advertising and in-app purchases have been added.

As explained on the Games page, you can leverage up to $900 in offers when you integrate Google services, such as Cloud, Firebase, and Ads, into your game.

Get started

#

Are you ready? To get started:

  1. If you haven't done so, install Flutter.

  2. Clone the games repo.

  3. Review the README file for the first type of game you want to create.

  4. Join the Flame community on Discord (use the direct link if you already have a Discord account).

  5. Review the codelabs and cookbook recipes.

  6. Set up accounts on AdMob, Firebase, and Cloud, as needed.

  7. Write your game!

  8. Deploy to both the Google Play and Apple stores.

Example games

#

For Google I/O 2022, both the Flutter team and Very Good Ventures created new games.

Other resources

#

Once you feel ready to go beyond these games templates, investigate other resources that our community recommended.

FeatureResources
Animation and sprites

book_5 Special effects
handyman Spriter Pro
package_2 rive
package_2 spriteWidget

App review

package_2 app_review

Audio

package_2 audioplayers
package_2 flutter_soloudNEW
science Add sound and music to your Flutter game with SoLoudNEW

Authentication

science User Authentication using Firebase

Cloud services

science Add Firebase to your Flutter game

Debugging

quick_reference_all Firebase Crashlytics overview
package_2 firebase_crashlytics

Drivers

package_2 win32_gamepad

Game assets
and asset tools

photo_album CraftPix
photo_album Game Developer Studio
handyman GIMP

Game engines

package_2 Flame
package_2 Bonfire
package_2 forge2d

Game features

book_5 Add achievements and leaderboards to your game
book_5 Add multiplayer support to your game

Game services integration

package_2 games_services

Legacy code

science Use the Foreign Function Interface in a Flutter plugin

Level editor

handyman Tiled

Monetization

book_5 Add advertising to your Flutter game
science Add AdMob ads to a Flutter app
science Add in-app purchases to your Flutter app
quick_reference_all Gaming UX and Revenue Optimizations for Apps (PDF)

Persistence

package_2 shared_preferences
package_2 sqflite
package_2 cbl_flutter (Couchbase Lite)

Special effects

api Paint API
book_5 Special effects

User Experience

science Build next generation UIs in Flutter
quick_reference_all Best practices for optimizing Flutter web loading speedNEW

Games Toolkit updates for Flutter 3.22

#

The following codelabs and guides were added for the Flutter 3.22 release:

Low-latency, high-performance sound
In collaboration with the Flutter community (@Marco Bavagnoli), we've enabled the SoLoud audio engine. This free and portable engine delivers the low-latency and high-performance sound that's essential for many games. To help you get started, check out the new codelab, Add sound and music to your Flutter game with SoLoud, dedicated to adding sound and music to your game.
Word puzzle games
Check out the new codelab, Build a word puzzle with Flutter, focused on building word puzzle games. This genre is perfect for exploring Flutter's UI capabilities, and this codelab dives into using Flutter's background processing to effortlessly generate expansive crossword-style grids of interlocking words without compromising the user experience.
Forge 2D physics engine
The new Forge2D codelab, Build a 2D physics game with Flutter and Flame, guides you through crafting game mechanics in a Flutter and Flame game using a 2D physics simulation along the lines of Box2D, called Forge2D.
Optimize loading speed for Flutter web-based games
In the fast-paced world of web-based gaming, a slow loading game is a major deterrent. Players expect instant gratification and will quickly abandon a game that doesn't load promptly. Hence, we've published a guide, Best practices for optimizing Flutter web loading speed, authored by Cheng Lin, to help you optimize your Flutter web-based games and apps for lightning-fast loading speeds.

Other new resources

#

Check out the following videos: