Chapter 1: Getting Started with Flutter Games
Welcome to Building Games with Flutter!
We will show you how to use Google's Flutter framework to build scalable games that work across mobile and web platforms. Flutter may seem a strange choice at first for building games because there are more established frameworks for making games, such as Unity or Unreal Engine, but a lot of these tools are very complex to learn and it takes a long time to start producing games with them.
Building on your existing knowledge of Flutter and Dart, we will take you through the steps needed to build a 2D game that will work across all supported platforms. Starting with the basics, we will build on this knowledge and gradually get on to more advanced game topics. By the end of the book, you will be able to make your own 2D games containing the following:
- Animating graphics around the screen
- Playing sound effects and music
- Controlling your player with keys, joystick, or gestures
- Detecting when graphics collide
- Creating game level maps and navigating around them
- Designing games
- Scaling the game across different platforms
- Advanced graphical effects
- Intelligent enemies
We will cover the core concepts with examples and then build on this, chapter by chapter, gradually building up a full game that works across different devices. Each chapter will contain code samples to help learn the building blocks of game development, along with the code, image, and sound resources to build our complete game. The game involves the player navigating around a map and avoiding the enemies while collecting as much gold as they can.
In this chapter, we want to delve a bit deeper into Flutter and Dart and what features they have that make them a great choice for game development. This will give you an understanding of why Flutter and Dart can be used for fast, smooth games across many platforms.
In this chapter, we will cover the following topics:
- Working with Flutter
- Using Dart
- Summarizing the book
- Creating a simple example animation
We have a lot to cover, so let's get started!