Saturday, February 5, 2011

First Week's Lesson: Pixels

The Little Monster is creating her software in Scratch, which means that she needs to start by having a Sprite to control.  Scratch works by having Sprites and their behaviors tightly linked (sort of a primitive object-oriented structure).  It comes with a default kitty cat (who we conveniently just call "Scratch") but it didn't feel right to have the Monster work just with some other person's sprite.

So it was time to create The Pear.

To create the Pear, we first need an understanding of what a pixel is.  We had a couple routes for this.  First we talked about what the word "pixel" means.  It took a while but the Monster now knows, "picture element".  Then I had her lean way forward and look closely at the screen of the iMac, right up where she could see the little square blocks that make up the screen image.  This was a revelation!  Wow, the whole screen is just a bunch of those little blocks!  Yup, those are pixels.

Next, it was time to create the Pear.  For this, we had a secret weapon.  The Monster's very creative mom had hit think geek for xmas ideas and had gifted the Monster and Daddy D with the toy called pixelblocks. These things are a fun toy, and a great tool for understanding the concept of pixels.

Using pixelblocks, The Monster and I had already built a prototype of The Pear.  It looks like this:

This prototype was great because we could talk about the concept of X and Y coordinates, and the fact that the computer scans left to right as it draws the image.  So just like how the computer draws one pixel at a time, we can count the pixels in The Pear here, and replicate that on the computer.

We started at the top of the head, and, counting as we went, The Monster re-created the pixel blocks version on the computer.

This turned out to be very difficult and awkward.  Single pixels weren't going to work very well on this high-res screen, and I couldn't find a decent pixel editing program (what ever happened to Dpaint, anyway?).  So we had to draw large squares in Scratch's primitive bitmap editor.  It was a lot of work, and I had to help out the Monster quite a bit in getting those squares lined up correctly.

But, success!


There The Pear is, in all her glory!  (Yes, The Pear is a girl.  The Monster says so.)

Next week... time to get The Pear into the software!

No comments:

Post a Comment