10:33 am

MacMost Now 363: Learning to Program with Scratch

The free program Scratch from MIT allows you to learn how to program using a simple drag-and-drop interface. You can make and share your own games. You can even view examples made by others. This is great for children and adults who want to learn basic programming.

Video Transcript (Click to Expand)
Hi, this is Gary with MacMost Now. On today's episode, I want to show how you could teach kids and adults how to program on you Mac. So when I was a kid, I was lucky. The computers you bought back then, like the Apple II, had a programming language built in, BASIC, and you can use that, start programming on day 1. A whole generation learned how to program on these machines. Today's computers you can't do that. You have to get some sort of software application to allow you to program. Fortunately, there are a lot of good options. One really good one is called Scratch and it's from M.I.T. and it can help just about anybody from children to adults learn how to program. So here's a look at Scratch. It opens up and it's got a screen area over here and it has commands that you can drag and drop, from the left, into your script area here in the middle. So, you don't actually type in Scratch, you actually drag and drop things that already exists and learn how to manipulate these objects here on the right. So, it's object-oriented from the get-go. So I start off with this cat here, and I've selected the script for this cat here in the middle section. I'm going to drag over this 'move 10 steps' here and when I double click on it, it'll execute that command. See, you can see I'm making that cat move 10 steps. I can also then add something else to it like for instance, ' turn 15 degrees'. Now, if I click it, i'll move 10 steps and it'll turn 15 degrees. There we go, and I can continue building using different things up here so I can go to Control and say when the green flag is clicked, execute this command. Now I don't have to click in the script area but I could actually click on the green flag to execute it. I can also do a repeat loop so I can encapsulate the move and turn into a repeat loop that can do it 10 times. So, I click the green flag, and there we go. Now, it comes with all sorts of things built in. I could click to choose a New Sprite and say choose something like a baseball and stick that in there and can move that around and now I can apply scripts to this baseball here or I can apply scripts to the cat there. So that just scratches the surface, if you excuse the pun. Not only have I seen kids use this but I've even seen college students and adults use it. As a matter of fact, in a recent game competition, I saw that were created using Scratch. They used it because they could quickly create a game and get it going in a short period of time. So, I've seen people prototype with this. The website for Scratch also includes all sort of examples submitted by users. So you can learn by taking apart other peoples' codes as well. Here's some examples of some games that come with Scratch that you can explore. Here's a PacMan game, you can control this with the arrow keys, here's, let's see a Marble Racer game, you can control this with the arrow keys as well, race around the track, trying to get off into the green area, here's even a game that scrolls, simple platformer. Scratch is a wonderful program, it's free whether it's you that's getting the programming or maybe your kids, I definitely recommend you download it and check it out. Till next time, the is Gary Rosenzweig with MacMost Now. No, I don't think you can learn this.

Comments: 2 Responses to “MacMost Now 363: Learning to Program with Scratch”

    Ricky Wilson
    3/17/10 @ 1:57 pm

    I want to be able to make iPhone apps. I don’t know any programming language yet, but I am starting a book called “Learn C on the Mac” by Dave Mark. This book is a part of a series which leads to iPhone development. Is there any easier/quicker way to learn programming for the iPhone? I am a 17 year-old mac savvy junior in high school, and I may want to pursue this in college.

    Thanks :)

      3/17/10 @ 2:55 pm

      I don’t know that book, but it may put you on the fast track and help you breeze through programming in college. It is hard to recommend anything because everyone learns differently. Just don’t give up if you don’t like that book. Another book would teach differently. Or, maybe another method (classroom. hands-on, etc.)

Comments Closed.