November 2011
Intermediate to advanced
348 pages
7h 2m
English
In this recipe, we'll embrace our inner hippie by creating a field of colorful flowers.

Follow these steps to draw randomized flowers all over the canvas:
Flower object:// define Flower constructor
function Flower(context, centerX, centerY, radius, numPetals, color){
this.context = context;
this.centerX = centerX;
this.centerY = centerY;
this.radius = radius;
this.numPetals = numPetals;
this.color = color;
}draw method of the Flower object that creates flower petals with a for loop and then draws a yellow center:// Define Flower draw method ...
Read now
Unlock full access