Trying out a sample of the Casual Games Toolkit for Flutter
I will write the steps to run a sample of the Casual Games Toolkit for Flutter.
Overview
There is a toolkit called "Flutter Casual Games Toolkit" that allows you to quickly create casual games with Flutter. It was introduced in 2022, making it relatively new. I haven't created games before, but after exploring the official page and YouTube videos, it seems quite promising, and I'm eager to give it a try. The provided templates have all functionalities pre-implemented, as mentioned later, allowing developers to focus on creating their original games. Although the 'Get Started' section lacks detailed instructions on running the samples, I will outline the steps I took to run them on my system.
The template
The templates already include the following features:
- Sound - Music
- Main menu screen
- Settings
- Ads
- In-app purchases
- Game Center and Google Play Games Services
- Crash reporting (monitoring)
While some features might require additional configuration, the details are available in the repository.
Running the Sample
Clone the sample repository
Although you currently only need the game_template
, you might require other components in the future, so let's clone the parent samples
repository. Be patient, as this might take a while due to its size.
$ git clone samples
Create a suitable development directory
Create a suitable development directory:
$ cd workspace
$ mkdir game_sample_tkugimot
Copy the code from the game_template
directory:
$ cp -r samples/game_template/. game_sample_tkugimot
Note: The above command also copies hidden files (files starting with .
).
Open the directory in IntelliJ and run pub get
:
Launch IntelliJ, navigate to File
> Open
, and open the directory. Then, install the required packages. (A dialog might appear when IntelliJ starts; you can also run pub get
there.)
$ flutter pub get
Resolving Errors
I encountered the following error in my environment:
/Users/tkugimot/development/flutter/bin/flutter --no-color pub get
Resolving dependencies...
The current Dart SDK version is 3.0.6.
Because game_template requires SDK version ^3.1.0-0, version solving failed.
Process finished with exit code 1
It seems my Dart version was outdated. I found a helpful Stack Overflow post:
In conclusion, running the following commands resolved the issue:
$ flutter channel master
$ flutter upgrade
Launch the simulator and execute main.dart
:
Click on Open iOS Simulator
to start the simulator. Choose iPhone 14 Pro (mobile)
and click the run button.
The game in the template is really simple—it's a kind of game where you slide a slider past a certain percentage to clear it. But, it looks really stylish overall...!
I've only developed simple apps in Flutter, such as the sound-producing app I mentioned in "Develop and release a simple app using Flutter that plays a sound when an icon is tapped. 1/n Developing the app."
Now, with this Casual Game Toolkit, I'm interested in creating more complex apps. My current top idea is a typing game, but considering the difficulty, I feel I might get discouraged midway due to my current level of knowledge. So, I'm thinking about building another simple app before that. I'll keep updating as I go...!