Oct
16

Animating a point walking flow with python

Using the SimpleGUICS2Pygame can animate the walking path easily. (The SimpleGUICS2Pygame is a implementation of simplegui.)

I wrote an small code for the simulation in codeskulptor, you can run it directly and see the effect:

http://www.codeskulptor.org/#user40_o37gkz7Wyy_11.py

But you need to install and import it at first:

  • installation:
    >>> pip install SimpleGUICS2Pygame
  • import:
    import SimpleGUICS2Pygame.simpleguics2pygame as simplegui

 

The most important part of this code is the timer_handler() function: which frequently updates the circle position.

Settings:

line 15: input your walking flow points

line 18: set your background image

line 21: set the smoothing of the animation: from 1 to 1000

Written by connygy. Posted in python

Trackback from your site.

Leave a comment