Beginners Interactive NetLogo Dictionary
Farsi / Persian
NetLogo Models Library:
This code example shows how to use shapes to create animations. In this example, there is a walking person and growing flowers.
A counter is used to increment the shape to be used in each animation.
For the person, each progressive frame of the person walking has a different shape. There are 9 shapes total. Each progressive shape is numbered as person_#, where the # is one higher then the shape that came before. After final numbered shape (person_9), the shapes repeat from the start (person_1) and continue to cycle through the remaining shapes. The person is moved forward a small bit with each new shape, to give the illusion of walking.
For the flowers, each progressive frame of their growth shows the development of the flower from a small seedling to a fully grown flower. Each frame has a new shape. Each progressive shape is numbered as flower_#, where the # is one higher then the shape that came before. After final numbered shape (flower_16), the shapes stop incrementing and the flower is shown as fully grown.
The model has a frame rate setting of 15 frames per second, for smooth animation that isn't too fast. The speed can be further adjusted by the user using the speed slider.