Planning
Step 1
In this lesson, we will be drawing a minion using shapes

It will also blink when the mouse button is pressed.

Step 2

Note: The green code is called comments. They are ignored by the computer and can be created by adding two slashes before any text `//`

Step 3

We should see this:

Challenge
Step 4
Make the eye

You'll have to draw the rest of the eye on your own.

HINT: Use the "glasses frame" ellipse as a building block for making the other ellipses.

Step 5

You should see something like this:

Information
Step 6
The curve function

To draw a smile we will be using the `curve` function and the syntax looks like this:

`curve(x1, y1, x2, y2, x3, y3, x4, y4)`

Here's what each coordinate will need to look like for our smile curve:

Challenge
Step 7
Draw the smile

Use the information in the step above and the hints below to make the minion smile.

HINT: Here is a diagram with the coordinates to some of the points for the curve. The question mark is coordinates that you need to figure out on your own.

Step 8

The minion should now have a smile.

Step 9
The mousePressed function

The `mousePressed` function is special because it will be automatically called when the mouse is pressed.

Challenge
Step 10
Make the minion blink when the mouse is pressed

When the mouse is pressed, draw a big yellow circle to represent the eyelid.

HINT: That big white circle we made for the eye earlier can be used again with a yellow fill. You can also reuse the curve for the mouth and add a black fill.

Step 11
The mouseReleased function

Similar to mousePressed, there is a special function called `mouseReleased` that is called when the mouse button is released.

Challenge
Step 12
Make the eye blink open when the mouse button is released

To redraw the eye when the mouse is released, it may be helpful to revisit Step 4 and Step 7 in this lesson.

Step 13

The minion should now blink shut and open when the mouse is pressed and released

The lesson is now complete!

Account

MVCode Clubs

Created By

Course:

Visual Effects lessons

Access Level