0:00:00.000,0:00:02.279 Okay we're getting close now, we're [br]getting close. 0:00:02.279,0:00:05.269 There's just this moment, I can see it, [br]there's two bubbles, we're soon 0:00:05.269,0:00:07.914 going to have a thousand bubbles,[br]it's very exciting. 0:00:07.914,0:00:10.685 So we're, what do we have so far?[br]We know how to declare, 0:00:10.685,0:00:12.952 this list of numbers; integers. 0:00:12.952,0:00:15.604 We were going to look at an example that[br]used a list of integers, 0:00:15.605,0:00:18.699 and maybe that's a bit of a mistake,[br]and I'll try to fit that in again 0:00:18.699,0:00:21.012 somewhere. But you know, think about that,[br]how might you do that? 0:00:21.012,0:00:26.081 But what I want to move straight to is [br]saying, "Let's apply this thinking 0:00:26.081,0:00:30.416 to these bubbles." And instead of having[br]separate bubble object variables, lets 0:00:30.416,0:00:32.779 have a single list of bubble objects. 0:00:32.789,0:00:36.719 So if we look at this syntax, the first[br]thing we have is the type of the array. 0:00:36.723,0:00:40.091 Now we're going to have a type "Bubble"[br]the object "Bubble". 0:00:40.091,0:00:44.091 We need to make sure it's going to be an[br]array, great we need to give our array a 0:00:44.093,0:00:48.805 name, let's call it "Bubbles".[br]The wire's a good joke, just thinking of 0:00:48.805,0:00:52.565 the wire, because of the name, "Bubbles",[br]but you didn't really need to know that. 0:00:54.725,0:00:57.544 I think I should make some magic way,[br]where I could just like, edit out 0:00:57.544,0:00:58.708 unnecessary thoughts. 0:00:58.708,0:01:04.424 Okay um... and then we need to say how[br]many bubbles are we going to have in our 0:01:04.424,0:01:09.093 array; we're going to have two. We're not[br]getting very ambitious here, we're getting 0:01:09.093,0:01:13.796 very very basic simple, we're going to[br]have just two, um, I also by the way 0:01:13.796,0:01:16.828 noticed, there's this little monitor that[br]I look at, which is slightly above the 0:01:16.828,0:01:19.219 camera, I feel like I'm always looking[br]above the camera. But if I look this way, 0:01:19.219,0:01:21.724 I'm looking right at the camera, right at[br]you. 0:01:21.724,0:01:28.864 Okay, so let's try to apply this here.[br]So, what's going on? Look, bubble, let's 0:01:28.864,0:01:32.368 close this, Bubble b1; Bubble b2;[br]first of all, you know 0:01:32.368,0:01:38.280 we really should've done this, just[br]to get us in that frame of reference, of 0:01:38.280,0:01:40.942 thinking of counting from zero,[br]from the rest of your life, you should 0:01:40.942,0:01:44.084 just count from zero from now on,[br]always start at zero. 0:01:44.084,0:01:49.671 Okay, uh... what I want to do is instead[br]of having two separate variables, I want 0:01:49.671,0:01:57.692 to have an array, called "bubbles",[br]it's going to be of type "Bubble", it's 0:01:57.692,0:02:00.404 got the brackets, which means it's an[br]array, we name this "bubbles", 0:02:00.404,0:02:05.306 and it has two bubbles in it. There's a[br]lot of bubble everywhere but you know, 0:02:05.326,0:02:07.419 this is what's happening to us right now. 0:02:07.419,0:02:20.006 So we can get rid of this. Now, instead of[br]initializing a single bubble... 0:02:20.006,0:02:25.745 we can now refer to the bubbles by their[br]index value, we can say, "Bubbles index 0 0:02:25.745,0:02:29.565 make a new bubble." "Bubbles index 1 make[br]a new bubble." 0:02:29.585,0:02:34.572 So, its like we had two separate variables[br]but both of those variables exist as spots[br] 0:02:34.572,0:02:39.233 in a list. You can imagine this list with [br]two spots in it, and there's one bubble 0:02:39.233,0:02:45.398 here, and another bubble there.[br]Um, okay, so what do we do now? 0:02:45.398,0:02:47.629 We need to take this idea and say, 0:02:47.629,0:02:51.847 bubbles[0].ascend();[br]bubbles[0].display();[br]bubbles[0].top(); 0:02:51.847,0:02:59.675 bubbles[1].ascend();[br]bubbles[1].display();[br]bubbles[1].top(); 0:03:03.495,0:03:08.343 There we go, we have the identical[br]program, just what we had before. 0:03:08.343,0:03:13.699 Okay, so you know what? I'm just going[br]with this, I'm experimenting with shorter 0:03:13.699,0:03:16.320 videos, this has only been two, two and a[br]half minutes (3 mins 17 seconds actually), 0:03:16.320,0:03:20.519 but let's actually stop here, so this is a[br]good, obviously this is a huge problem 0:03:20.519,0:03:25.377 right? We've kind of done nothing to, to[br]get towards our goal of having a thousand 0:03:25.377,0:03:30.114 bubbles right? Yes, we've put it in a list[br]but we still have individual lines of code 0:03:30.114,0:03:33.379 for each bubble, we have to say,[br]bubbles[0].all the functions; 0:03:33.379,0:03:34.357 bubbles[1].all the functions; 0:03:34.357,0:03:37.358 then if we had a thousand, two and three[br]and four all the way up to 999. 0:03:37.358,0:03:41.281 So, we're on the way there but we're[br]missing an important step, and that 0:03:41.281,0:03:43.668 important step is going to be using a loop,[br]and that's we're going to be doing in the 0:03:43.668,0:03:47.453 next video. But, let's take a moment to[br]pause here and what I would say to you as 0:03:47.453,0:03:51.455 an exercise is go find something where you[br]had an object and try to make an array of 0:03:51.455,0:03:55.635 those objects. Try to make multiple[br]objects and use the array, don't just 0:03:55.635,0:03:59.291 and refer to which object by its index[br]value. 0:03:59.291,0:04:04.251 You can do interesting things like, um, I[br]could say, if I wanted to that this second 0:04:04.251,0:04:08.139 one shouldn't bother to ascend, only the [br]first one [needs to ascend]. 0:04:08.139,0:04:11.265 You can see the second one, now doesn't[br]have that function called on it, so it's 0:04:11.265,0:04:17.383 just laying there at the bottom, so that's[br]what I would say to you, take your object 0:04:17.383,0:04:21.221 that you made make an array of them and[br]try to see how that works.