Saturday, January 25, 2014

The MOOC and Me: Building From Scratch


I'd like to think I'm making progress.

I've watched three weeks worth of lectures so far. Weeks 0, 1 and 2. For some reason it's a 12 week course going from week 0 to week 12 with no week 11. Apparently, Harvard math. There's a project assigned at the end of each week but, since the deadline for completing them all is the end of the year, I'm taking my time to ensure I understand what I'm (supposed to be) doing. One of the problems I've run into is that the Harvard students get more information on campus that is not made explicit in the videos. I found out about a whole on-line file of downloadable study aids including slides and notes and such only because it happened to be mentioned in passing in one of theWeek 2 (i.e., third week) lectures (Not, "Be sure to check out . . ." but, "Oh, yeah, that's addressed in the study guide."). I've gone back over the beginnings and become aware of a few other assumptions that are not obvious to non-resident students (i.e., references to things in lectures 5 and 6 that were never covered in the previous lectures).

The first week's project requires building something--anything--using a visual training language called "Scratch" which was developed by MIT and uses colored puzzle pieces to assemble a program. Since only certain pieces can fit into others it kind of limits the damage one can do. I've built the basics of an adorably stupid little "game" involving a parrot and a polar bear. Periodically, the parrot flies across the screen left to right. If it gets to the other side a palm tree grows on the spot. As the number of palm trees grows they begin to fill in the space forcing the polar bear to shift away. The polar bear can stop the destruction of his habitat by leaping up and hitting the parrot causing the bird to go back and start over. So far so good/inane.

The problems are these:

1) The characters are sprites from a library. Some of them have multiple images, called costumes, that can be used to simulate motion but the polar bear's costumes merely make him blink. There is another bear in the library composed of multiple parts that I could manipulate to create more costumes and make it not only jump but reach up to hit the bird, but it's an ugly bear. And the parts are extremely difficult to manipulate. And even then don't do exactly what I want.

2) When the bear hits the bird right now, it just goes back to the edge of the screen and starts over. I want it to fall to the ground so I can introduce a third character, a cat which will run across the screen, pick up the bird, announce the number of points it is worth and carry it off before the next parrot starts. Just because. I can get the bird to fall down O.K. when the bear hits it but the next parrot merely starts at the usual place and flies straight down.

3) I really want the parrot to speed up as the "game" progresses but, so far at least and with the puzzle pieces I can find available, I don't see how to do that. I can manually change the variable for speed but I don't seem to be able to make it change itself while the program is running. Within the structure of the puzzle pieces I don't see how to make Speed = Speed + 1.

But, at least I'm having fun. And maybe learning something. Next week's problem set requires some actual coding in C.


No comments:

Post a Comment