Summary

In this chapter, we built a playable replica of the 2048 game. We also showcased a number of implementation details that can be reused in other similar projects:

  • Creating a scalable board that fits the screen in any resolution and orientation
  • Putting together custom tiles, and implementing smooth movement for those with the help of Kivy's Animation API
  • Mapping player's controls to both touch screen gestures and keyboard arrow keys at the same time, to account for any control scheme the user might expect from the game

The Kivy framework supports game development nicely; in particular, canvas rendering and support for animations can be very useful when building video games. Prototyping in Kivy is also feasible, albeit somewhat harder to do than ...

Get Kivy Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.