If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content
Current time:0:00Total duration:1:45

3. Putting shapes together

Video transcript

okay so far you've made a single shape object which contains information to draw a circle but we'll need more shapes to build a snowman and we'll want to store all of these shapes inside one data structure which represents us snowman model one way we can do this is with an array where each position in the array holds one shape object in the next exercise you will define an array called shapes array to do this think of this shapes array as our entire model it has everything the computer needs to draw all the pieces of the model but what about a hat for neck we can't draw the outer circles that would be crazy the short-film knick-knack was made with simple geometric shapes one easy way to draw any shape is to define a series of points called vertices for example the Hat would need eight vertices like this each of these points is represented by a pair of coordinates and then the entire list of these vertices can be stored in a larger array so we'll have an array of arrays to store any shape we want and we'll let another part of the program actually connect these dots for us first up we have two exercises for you in the first exercise you'll be creating a shapes array to hold each of your shape objects this will allow you to add your head and your body after that you'll have a chance to create any shape starting with a classic black hat I find ya go for