.. _example-bouncing-rectangle: Animation: Bouncing rectangle ============================= This shows how to animate an image. It does not use classes, but it does use function variables. If you are familiar with classes, see some of the following examples as well: * :ref:`example-starting-template` * :ref:`example-shapes` * :ref:`example-sprite-collect-coins-move_down` .. raw:: html <iframe src="https://player.vimeo.com/video/168063840?byline=0&portrait=0" width="640" height="480" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> <p><a href="https://vimeo.com/168063840">Bouncing Rectangle Example</a> from <a href="https://vimeo.com/user6672093">Paul Vincent Craven</a> on <a href="https://vimeo.com">Vimeo</a>.</p> .. literalinclude:: ../../examples/bouncing_rectangle.py