Lesson goal: Animated-GIF with functions

Previous: Make complex objects move | Home | Next: Draw a map

Ok, so you now know how to make complex objects move, using lines and circles.

In this lesson, let's make drawing such objects easier on ourselves, by using functions. You remember functions from this lesson, don't you?

In the code below, we've made a function called person that will draw a person at the point (x,y). Look how easy functions make it to have 3 people walking around at once!

See the example for how to use a function to draw people of different sizes.

Now you try. Draw some people, or try putting some of your own objects into functions.

Type your code here:

See your results here:

Show a friend, family member, or teacher what you've done!

Here is a share link to your code:

Does your code work? Want to run it on your iPhone?

Here's your code:

  1. Use [Control]-[C] (Windows) or [⌘]-[C] (MacOS) to copy your code.

  2. Paste it using [Control]-[V] (Windows) or [⌘]-[V] (MacOS) into this page

  3. Then click the "Use on iPhone" button that you'll see.