Code Behind the Game

Sometimes when I have a Kindergarten class in the computer lab and I’m introducing a new online activity – like a connect-the-dots game or a drawing program, a fourth grader will come in to the lab to do some independent computer assignment – typing up a paper or picking up a print out – and get distracted by what the Kindergarteners are doing. Occasionally, if the 4th grader is a code club member, I’ll wonder out loud to them  – do you think we could write a connect-the-dots game in Scratch?

I want them to see beyond game play, behind the app and think about it’s mechanics – the code – the logic that runs it. This is a goal of mine.  I enjoy thinking about how apps work.  How decisions were made to make the user experience. How someone coded different features. I want my students to think about these things, too. When you think about how some tech thing was built or created you become more than a technology consumer.  It becomes less like magic and turns into something they could do.  The students become technology makers.

I think Scratch is helping with this goal. A weeks after writing their first game project in Scratch, one student remarked that he now looked at games differently. He sees the characters in the games he plays as Sprites.

Another student, in fact, asked me later, when we were going to write that connect-the-dots game in code club.

No code club last week, but we’re on again tomorrow!

Pong with Flair

This week in Code Club we worked on a Scratch game project that was simple in design but could be creatively enhanced quite easily.  We used Simon Haughton’s Pong game directions.  That’s right, the old Pong game.  Of course, these 10 year olds had never heard of Pong.

When considering what project to try this week I took a look at the new Code Club Scratch projects that have just become available.  I have no doubt my students would love them all, especially Dodgeball.  I’m considering that for next time.

After their struggles with Paint Box, though,  I wanted to introduce a simpler project and Pong fit the bill.  My high school volunteers were excited about it, too.  One said he had written a Pong game before.

I started our code club meeting by talking about the independent project that is coming up. I want them to start thinking about what game or animation they want to design.  My goal, I explained, was to introduce a variety of projects to them so they could get an idea of what was possible to make using Scratch. They could even take a project they have already started and enhance it to make it their own.

With that in mind we started Pong.

Screen Shot 2015-02-13 at 9.46.39 PM

a new coders’ Pong game

I also put the original 2-person Pong game on screen and a break-out style game to give them ideas of where this kind of game could go.  It didn’t take them long to code their game so there was plenty of time for their creativity to come out.

Screen Shot 2015-02-13 at 9.47.11 PM

A code club girl’s take on Pong

Some students added extra objects on the screen to interact with and get or lose points.  Others spent extra time with the background and sounds.

There was even time at the end to look at or work on previous projects and think about their independent project that is coming up.  I saw one student adding more to his ChatBot project, another looking online at last sessions’ Showcase #1 projects.

A couple of students have asked if they could work in groups of three for the individual project.  I have my reservations about this.  Pair programming is hard enough. Some groups worked well together last time, others…. I have to come to a decision about this soon.

Paint It!

Screen Shot 2015-02-10 at 6.42.12 AMLast week Code Club was challenging. I gave my coders a difficult project. They did it, but it was probably not the best fit for the group because it has to be precisely followed with a long set up.  I used Paint Box, a project from Code Club World (We are a registered Code Club World club).  It introduces some key Scratch blocks and new ideas of how to use Scratch.  Hopefully some of those ideas will be useful.

Pen tools

Some pen tools

One of these objectives was to introduce the Pen blocks.  It’s one set of tools that I didn’t even talk about in the first round of Code Club.  I’m not sure why exactly. Perhaps because they remind me of Turtle Logo programming and for that reason, I couldn’t see how students would use them in a game of their own making. Still, the Paint Box project is pretty cool – you make your own paint program.

While Code Club hasn’t used the Pen blocks, I have introduced Simon Haughton’s Etch-a-Sketch project to some 3rd & 4th graders in a half-hour class/group setting.  So for Code Club, I went for the more challenging Paint Box project.

The second learning objective I found in this project was to see “broadcast” used in another way. I like Paint Box project’s use of the broadcast/receive code blocks.  This can be a powerful tool in coding with Scratch. It this case, it is used for simple button handling.  We have used broadcast-receive blocks before, but to see it used in a variety of ways will help them see how useful this command can be.

handling button clicks

handling button clicks

There were some unexpected behaviors in the code that the students kept calling glitches. I hadn’t noticed them when I worked through the project.  Again, we are still using Scratch 1.4 in the lab, for now, but it turns out what was making the pen “glitchy” was the placement of the Sprite center.  This was another learning objective – learn about “set costume center”.

set costume center is key

set costume center is key

The directions specify to set the costume center at the point of the pencil Sprite. If the costume center was over the drawing of the pen itself, the pen down action wouldn’t always work and drawing on the screen became “glitchy”.  It seems when costume center on the pencil Sprite combined with the mouse commands causing the Sprite to be under the mouse when “mouse down” is received, Scratch isn’t sure if you are interacting with the Stage or playing the game. If you run the program in projector mode, the glitches are alleviated and the pen works in any costume center placement. I found this out later when working through the buggy behavior with my spouse, the software engineer.

Student Paint Box project

one student’s Paint Box project

So this project was heavy on the learning objectives. By the end of the hour most of them had a couple of buttons. Only one was thinking about adding more – a rainbow pencil or “stamps”. They did it, but their creativity wasn’t tapped. I need to give them time for more creativity. Next two weeks we’ll be back to game projects then they’ll start their independent project.

Here are two coders during indoor recess working on an independent project. Yeah, they really can’t wait for the independent project to start.

Pair-programming -4th grade style - sharing the same chair.

Pair-programming -4th grade style – sharing the same chair.

One of them has asked repeatedly if this can be their project for this session and I’ve told him “Yes” each time.

If Ask, Then Answer

Last week was the first week with the full complement of code club members, new and returning.  We filled the computer lab again.  I had a Code Club World project that was new to all of them called Chatbot. I picked this Scratch project because it introduces “ask and answer” code blocks and “if statement” code blocks. Also, the project wasn’t your typical video game.

Chatbot is a new project that has just come out of “beta” testing so it used some aspects of Scratch 2.0 that aren’t available to us as our lab has version Scratch 1.4 installed.  For example the characters the project says to choose from are all 2.0 sprites.

Sprites from Scratch 2.0

Sprites from Scratch 2.0

So I wrote a couple of my own versions of the project to demo to the students and let the students pick a sprite of their choice for the project.

Chatbot Star, a Scratch ver 1.4 demo project

Chatbot Star, a Scratch ver 1.4 demo project

Screen Shot 2015-02-01 at 11.45.03 AM

Another demo of mine

It seemed to be a basic project that with a bit of creativity on the student’s part could become really fun.

I also liked that the project introduced the “join” block.  It reminds me of the Java print command.  The students noticed that if you want a space between the things you are joining, like words and the name variable, you have to actually add it.

Join blocks in action

Join blocks in action.

The project didn’t take too long.  Some students were finished and wanted to work on last weeks projects or projects from the first session, others were really getting creative with Chatbot.

Alex, my high school volunteer, and I were noticing how smoothly things were going.  There was energy in the room, but it was all focused on the tasks at hand. We stopped to enjoy the moment where everyone was enjoying themselves and playing with Scratch.

My husband asked if anyone asked the question “What’s your favorite color?” and had the Sprite change it’s color effect to match the answer.  What a cool idea.  I’m not sure how to do cases in Scratch, so I just went with if statements.  I’ll ask my high school student volunteers (yes, I’ve got a second high school student this term). It’s very exciting.

Favorite color cases

Favorite color cases

Here are a couple of innovative Chatbots from Code Club students last week:

Screen Shot 2015-02-03 at 10.00.33 PM

This coder drew her own Sprite like Scratch 2.0 Tera with different costumes for different emotions.

Extensive conversation from a veteran coder

Extensive conversation from a veteran coder