Tiempo actual: 0:00Duración total:1:45
0 puntos de energía
Transcripción del video
- [Narrator] 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 our snowman, and we'll want to store all of these shapes inside one data structure, which represents our 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'll 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 Nick? We can't draw that with circles... That would be crazy! The short film, Nick Nack, 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. Have fun! (laughs) Yay! Go for it!