Skip to content

Latest commit

 

History

History
55 lines (34 loc) · 3.62 KB

README.md

File metadata and controls

55 lines (34 loc) · 3.62 KB

2048 Game made with Flutter

2048 Game in Flutter Logo

The game is purely made using Flutter's Animation System using AnimatedWidget and Explicit animations.

The main puprose of this project is to demonstrate the usage of the Flutter Animations together with a more complex state management. The Game is build with the popular Riverpod, a Reactive Caching and Data-binding Framework, used to manage the state for the game. Using this project you will be able to grasp and learn how to combine a state management solution like Riverpod or Provider or even Bloc using the Flutter's built in Animation System and use AnimatedWidget, Excplicit Animations and AnimationController to create a conditional animations, which is why I didn't use a game engine like FlameEngine to build the game. The purpose was not to demonstrate "How to make a game in Flutter", but "How to implement AnimationWidget and Excplicit Animations and manage and control them using AnimationController and state management solution like Riverpod" but of course you can also use this project as a guide on how to build games in Flutter.

The project is made in Flutter 3.0 at the moment and is not related in anyway to the Flame Game Engine or the Game toolking the Flutter team released with version 3.0

The logic and algorithms used in this Project are unique not copied from other clone repos, so I tried to keep them as simple and as performant as possible.

Credit goes to Gabriele Cirulli which is the original creator of the 2048 game which is based on 1024 by Veewo Studio.

Lastly please use this project entirely to improve your Flutter skills, there are plenty of clones on the Play Store and AppStore already.

Running the game on Web, Android, iOS and MacOS

Running the Game

  1. Get Packages
flutter pub get
  1. Run Builder
flutter pub run build_runner build
  1. Run App
flutter run --release

Gameplay

The game running at 60FPS on Samsung Galaxy S10+

2048.mp4

Medium

Step by step posts explaining in details making the 2048 Game in Flutter.

Making 2048 Game in Flutter by using Explicit Animations - Getting Started with making 2048 Game in Flutter.

Making 2048 Game in Flutter by using Explicit Animations - Part 2 - In this part we will implement the Algorithms and logic for the game.

Making 2048 Game in Flutter by using Explicit Animations - Part 3 - In this part we will finally add the AnimationControllers and Explicit Animations.

Making 2048 Game in Flutter by using Explicit Animations - Part 4 - In this part we will see how to save the state of the game.

Making 2048 Game in Flutter by using Explicit Animations - Part 5 - In this last part we will see how we can use the Debug, Profile and Performance tools to find Animation Junks in Flutter.

Licence

flutter_2048 is Licenced under the MIT Licence