Step 1. New brush

There are two brushes, but that’s not enough. Let’s add more!

In mouseDragged(), add a new if statement to hold the new brush’s drawing code

⌨️ Add this code under // Brush 3

// Brush 3
if(brush == 3) {
	// the new brush code goes here
}

Let’s make this brush a little extra. Our new brush will draw both a square() and a circle().

⌨️ Add this code inside of the new brush’s if statement

// the new brush code goes here
square(10, -10, 20);
circle(-10, 10, 20);

If you run the code, pressing 3 won’t switch to our new brush. Something is still missing in keyPressed().

👥💬 Discuss

  • What might we need to add or change to use our new brush?

Next up…

Step 2. keyPressed()