Fleet – infinite concatenation of animations

In this section, we will animate the fleet so that it has perpetual movement from right to left and vice versa, as shown by the arrows in the following screenshot:

Fleet – infinite concatenation of animations

In order to do this, we will learn how to concatenate one animation just after another one is completed. Indeed, we will create an infinite loop of animations so that the fleet is in perpetual movement.

Tip

We can concatenate two animations with the on_complete event.

The following code, fragment 1 (of 2), of fleet.py shows how to concatenate these events:

155. # File name: fleet.py (Fragment 1) 156. from kivy.uix.gridlayout import GridLayout 157. ...

Get Kivy – Interactive Applications and Games in Python - Second Edition 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.