Teaching my kids how to make sprites
Most of the time, when my kids walk into the office they gaze at the computers and ask me what all the code on the screens means. It reminded me of what I felt when I looked at a listing of a simple program when I was a kid and what happened when I typed in those magical three letters on my C64: RUN.
So today, I decided to get my kids into some real programming and I wanted them to experience the magic of thinking up of something, doing some code and then see those ideas transfered to the computer screen. What better way to start then but by using the good old sprites on the C64 as for me, this was my first experience of how something that was written on paper could come to life on the computer.
I made a couple of print-outs showing the classic sprite grid, the 24×21 grid that makes up the little drawings the breadbox renders. My kids got drawing straight away and then I told them that every time a line of their drawing crossed a case on the little grid, they had to color it. Basically, they began digitizing their drawings.
Next up, it was time for some math, as they had to calculate the bytes by adding up the values of of the different colored cases (a good school exercise as well). While they were doing the math, I typed in a little program that basically turned on the different sprites and made them move on the screen (it was based on the example of the C64 manual).
Then it was their turn to sit at the computer and type in their respective DATA-sections, making sure they marked each line as “processed” on their sheets of paper before moving on to the next.
And then it was time for them to type in those 3 letters themselves and run the program. Their little eyes lit up as they saw their own drawings appear on the screen and fly from left to right, top to bottom and back again. They had just created their first very own program! I’m sure they’ll be singing “I adore my C64″ all day now!