DEV Community

Cover image for 2048 Game πŸ•Ή using Flutter - Animations added
Arnav Puri
Arnav Puri

Posted on

2

2048 Game πŸ•Ή using Flutter - Animations added

I am building classical 2048 game using Flutter and here is the link to previous post

Repository Link

In this post, I want to share that I have added slide animations. It wasn't very easy to do so.

The single-cell is a stateful widget and it always stores old value. So old value slides out and new value slides in.

I am using a single animation controller which is being used by all the cells (16 total).

Every time there is a swipe I make the controller go forward.

Also for keeping track of swipe direction, I am using enums which makes it easier and faster to manage.

It can still be refactored a lot.

Next up is undo feature and show the 'game over' or 'you win' dialog

Top comments (0)

Sentry growth stunted Image

If you are wasting time trying to track down the cause of a crash, it’s time for a better solution. Get your crash rates to zero (or close to zero as possible) with less time and effort.

Try Sentry for more visibility into crashes, better workflow tools, and customizable alerts and reporting.

Switch Tools

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay